← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #252884]: Time based if statements

 

Question #252884 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252884

Smizzy posted a new comment:
Thanks! Ive got this attractive looking setup now!

#outside the loop
delay1 = 10
timer1 = -delay1

#inside the loop
if (time.time() - time1) > delay1 :
        crafter(w1[0],w1[1],w1[2],w1[3],w1[4])
        time1 = time.time()

That way it runs the first time without delay but then doesn't check it again for 10 seconds.  And the rest of the loop is running smoothly while this function is on cooldown :D
Thanks!!!!!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.