sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #19228
Re: [Question #232183]: [How To] set variable value from OCR numerics
Question #232183 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232183
Status: Answered => Open
Phillip Kelly is still having a problem:
Ok I will make your suggested changes.
But I have another problem it seems. I handle the bet placement by passing the bet screen locale to a function.
def bet_a1(place):
for i in xrange(0, bet_size):
click(place)
else:
click("deal_img.png", 0)
This works fine except that after several hours of play Sikuli exits
with the following error :-
[error] TypeError ( an integer is required )
for hands_to_play in xrange(0, 9999999):
if bet_record.count(300) >= 1:
exit
if not exists("win_img.png", 0) and not exists("push_img.png", 0):
if betseq == 1:
bet_a1(bet_site) #/ error occurs in this line due to value of bet_site which is a screen locale
wait(5)
hands_to_play = hands_to_play - 1
The screen locale are defined
def banker_y(match):
return match.y
banker = findAll("banker_img.png")
sorted_banker = sorted(banker, key=banker_y)
for icon in sorted_banker:
exists(banker)
banker = find("banker_img.png")
def player_y(match):
return match.y
player = findAll("player_img.png")
sorted_player = sorted(player, key=player_y)
for icon in sorted_player:
exists(player)
player = find("player_img.png")
At some point I can not avoid using screen locales to place bets. Even if I do use true and false flags for bet placement decisions I still have to use screen locales to place the bets.
The variable bet_site I use I think is really nice because I can let the logic determine where to place the bet.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.