← Back to team overview

sikuli-driver team mailing list archive

[Question #215630]: i need help looping my script

 

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

hello,
im trying to make a macro for work but i cant seem to make the script loop. basically i would like the script to click a link, do stuff on the page that loads and then go back to the original page and repeat until there are no more links to click. 
everything works fine until the very end, after the main page reloads the script ends instead of clicking the next link. i dont get any errors, it just doesnt loop.
heres the code i have
from org.sikuli.script.natives import Vision

Vision.setParameter("MinTargetSize",6)
mmd = Settings.MoveMouseDelay
Settings.MoveMouseDelay = 0.01
setROI(Region(1179,86,145,110))

click("biIlin.png") #this loads the webpage i want to work with
setROI(Region(552,207,191,66))
wait("BillingQueue.png", 15)
setROI(Region(562,215,997,416))
click(Pattern("Status.png").targetOffset(70,-1))
click("NetEntered.png")
wait(10)
click(Pattern("SortQueueByD.png").targetOffset(158,0))
click(Pattern("AccountAccou.png").targetOffset(-5,-15))
wait(10)
setROI(Region(628,114,83,736))

while exists("1354260405577.png"):  # this is the pattern i want the macro to click on
    click("1354260405577.png")
    setROI(Region(564,282,871,183))
    click(Pattern("SelectaQueue-1.png").targetOffset(160,0))
    click("SaveBillingS.png")
    click(Pattern("SelectBillin.png").targetOffset(74,-1))
    click("RTB.png") #clicking this reloads the main page

like i said the script works fine, but it only runs once.
any help would be appreciated. 

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