← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #211347]: How to increment values in array

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Principally there is a trick to transfer parameters to the handler
(there is a Q&A around here).

But in these cases I use the region to transfer such values to the
handler.

# the observe part
SCREEN.currentTimeEntry = arr[1]
onAppear("submitclear.png", myHandler) # HERE I WANT IT SHOULD TAKE VALUE FROM ARR [1]
observe(10)

# the handler part
    until[3:6]=eval(event.region.currentTimeEntry)

- the region you are using is the whole screen, hence region is SCREEN
- SCREEN.currentTimeEntry = arr[1] stores the content of arr[1] as a value in the region object SCREEN
- in the handler event.region is the current observed region (hence SCREEN in this case)
- so event.region.currentTimeEntry retrieves the stored value

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