← Back to team overview

sikuli-driver team mailing list archive

[Question #227390]: For Loop problem

 

New question #227390 on Sikuli:
https://answers.launchpad.net/sikuli/+question/227390

I have read the FAQ #1413737 and that didnt really help me understand what i am trying to do.

I want to use the For Loop and the FAQ above didnt mention the for loop like i have seen in other areas.

here is my code:



def billassist(x):
    type('b', KeyModifier.ALT)
    type('b')
    waitVanish(Pattern("Client-1.png").similar(0.94), 120)
    type('w', KeyModifier.CTRL)



for x in range(0, 10):
    billassist(x)

i want to run that function 9 times one after each other but the problem is it doesn't perform exactly like i want.

I expected the loop to run the method once and then when the method  completes run again but instead the for loop just runs it 9 times repeatedly all at once and not only do i not get my expected results but my program is bogged down because its receiving 9 commands at once or back to back really fast instead of 9 set of instructions one at a time after the previous attempt finished.


What am I doing wrong?

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