New question #279591 on Sikuli:
https://answers.launchpad.net/sikuli/+question/279591
Hi
I am new to sikuli and over the last few days have been racking my brains
trying to understand what to do. I have done basic programming at school long
time ago. any help will be much appreciated.
So I have been trying to create a bot for an online multiple choice game. The
game presents a picture, in this case of footballers and 4 possible answers.
what i am trying to achieve is for the bot to click on the answer based on the
image presented. There are 30 questions from a pool of around 200 footballers.
so the problem i have is there are 400+ variables so a repetitive if exist():
click () for each possible instance would take ages and probably wont work.
would it work if i created variables say:
#this would be the photo of the footballer
footballers = {
'xabi': ["1450363840859.png"],
'chivu': ["1450364273740.png"],
'diego': ["1450364038327.png"],
'didier': ["1450364076406.png"],
}
#this is the name as it appears in the graphics.
boxNames = {
'xabi': [Pattern("1450363969156.png").exact()],
'chivu': [Pattern("1450364291974.png").exact()],
'diego': [Pattern("1450364052508.png").exact()],
'didier': [Pattern("1450364168522.png").exact()],
}
this is just a sample, as i said there are possible 200 names.
how would you write a function that sees the image of a footballer in a region
of the screen, identifies the footballers, matches the name from boxNames, find
the image and click the image.
other examples of what I've seen (not from this project) so far of setting
variables which maybe applicable here:
bugs = {
'b': ["b1.png", "b2.png"],
'y': ["y1.png", "y2.png"],
'r': ["r1.png", "r2.png"],
}
pills = {
'b': [Pattern("left-b.png").exact(), Pattern("right-b.png").exact()],
'r': [Pattern("left-r.png").exact(), Pattern("right-r.png").exact()],
'y': [Pattern("left-y.png").exact(), Pattern("right-y.png").exact()],
}
what i though was going to be quite easy seems very difficult to me right now.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp