I need help guys :)

Asked by aareth

Hi all,

I am completely newbie to programming and sikuli so please bare with me!

I am learning sikuli testing at the moment and it is going well...however I am completely stuck with repeating an action....So in short, I would like to create kind of a loop so that the programme goes back to a specified line. Is this possible with a GOTO like command in sikuli? I really dont understand functions that well so I am struggling at the moment...

This is what I am trying to do: I am trying to automate a roulette game (and trying to implement a martingale strategy).

1) I click on the bet chip
2) then I click on "Red"
3) click on spin
4) if the result is red then goto 1
5) if result is not red (i.e. black) then goto 6
6) click on the bet chip
7) click on red
8) click on red again (to double the bet)
9) click on spin
10) if red then goto 1
11) if black then goto 6....
so on...

Any suggestion would be very much appreciated guys.. i am completely stuck :(

Thank you!

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
DenisD (denis-work-acc) said :
#1

Sorry, I don't know operators in Sikuli IDE, perhaps there is GOTO.
But I know that there you can find loops, so, try something like:

boolean isSpinAgain = true;

while(isSpinAgain){

your code line 1
your code line 2
...
your code line n

if( if the result is black){
 your code line n+1
 ...
 your code line n+n
}

}

I can be mistaken with syntax, because as I mentioned before, I've never used the Sikuli IDE, but you can easily find the information here http://doc.sikuli.org/extensions/sikuli-guide/index.html .

The main idea is a loop with IF constructions: if you get red you do nothing, otherwise you perform additional logic and after that your loop starts new iteration.

Hope it'll help.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

SikuliX "talks" Python.
see faq 1858

Can you help with this problem?

Provide an answer of your own, or ask aareth for more information if necessary.

To post a message you must log in.