← Back to team overview

sikuli-driver team mailing list archive

[Question #264563]: Can Sikuli create variables?

 

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

Can sikuli create variables?
Hi Rainman, hope I'm not abusing, this is the most difficult script I would ever dare to make in Sikuli, I made I kinda pseudocode, hope you could help me. Thanks Advanced.

I have a little 330 x 600 px window inside chrome flash website, with this inside...

*  idxxx   somename
  idxxy   anothername
   idxxz   anewname
*  idxyx   yetsomename
   idxyy   yetanothername
*  idxyz   yetanewname
   idyxx   andyetsomename
*  idyyx   andyetanothername
   idyzx   andyetanewname

It is a table listing some names, with a scrollbar at the right side (cuz the list is larger than 9 names), also some names have at their left side a "StarImage" (represented by starsign) that are either orange or black.

I would like to count from top to bottom how many "StarImages" are no matter if they are orange or black, both count as one. (eg. if there are 3 black and 3 orange, then are 6 in total)
Then I would like to create a variable named...
toclickonVar = 2
So if "toclickonVar = 2" I will click on the second "StarImage" found from top to bottom.

But if for example "toclickonVar = 6" and the total "StarImage" count was 4 (like in example table above), so ImageCount < "toclickonVar" then I will like to subtract ImageCount from "toclickonVar" and then press the PageDown key and the Down key (in order to scroll down), then count again how many "StarImages" are from top to bottom and click on the new(current) "toclickonVar" if it still is greater than the new(current) "StarImages" count, then repeat the processes described in this paragraph.

Is this possible, I thought about the easiest way to achive this, if you got better idea is welcome. So far I have write this...

App.focus("Chrome")
Settings.DelayAfterDrag = 0
Settings.DelayBeforeDrop = 0
Settings.MoveMouseDelay = 0
hover(Pattern("1427842411231.png").similar(0.94))
mouseDown(Button.LEFT)

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