creating a timer in sikuli, need update from old code.
Hello, i was looking for a timer that i could use, i found the 2012 post https:/
here is my code:
#Timers
common ="common.png"
rare ="rare.png"
brare ="brare.png"
tresure ="tresure.png"
Settings.timer =time.time()
start = time.time()
runn =True
def stop(event):
global runn
runn =False
Env.addHotkey(
def timer(name, elapse=0):
if elapse >0:
else:
rest =eval(Settings.
if rest >0:
return False
else:
return True
while runn:
print "counting"
if timer(1,2):
elif exists(rare):
timer(2,4)
elif exists(brare):
timer(3,6)
else:
pass
while timer() and runn:
print "Elapsed: %d seconds"
The error it is giving me is:
error] TypeError ( unsupported operand type(s) for +: 'float' and 'str' )
[error] --- Traceback --- error source first
line: module ( function ) statement
18: main ( timer ) exec(Settings.
27: main ( <module> ) if timer(1,2):
really appreciate the help.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask dizarus for more information if necessary.