← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #664904]: Log how many times image is clicked

 

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

Description changed to:
Hi All!

I'm still new into sikuli, please bear with me. =)

I've finally setup a basic script and its running fine but now I wanted
to log how many times the script looped and like how many times an image
is clicked.

my script is something like this, its already looping back from
beginning but wanted to track them.

---------------------------------------------
while True

if exists(image):
    click(image)
--------------------------------------------

Thanks

---------------------------------------------------------------------
a solution:

loopCount = 0
clickCount = 0
while True
    loopCount += 1
    if exists(image):
        click(image)
        clickCount += 1
   print "loops:", loopCount, " clicks: ", clickCount

If you want to have logging with a time stamp:
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#writing-and-redirecting-log-and-debug-messages

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.