Simple Sikuli script to run loop and few other things.

Asked by josh

how should i go about creating a simple Sikuli script, that loops a list of items , checks to see if there ready, if so collect, if not proceed to the next one on the list. then reloop after a short break. also if a random were to appear it would hit the red "X" no matter what its doing currently.

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
RaiMan (raimund-hocke) said :
#1

already looked at faq 1437?

Revision history for this message
josh (savannalynne11) said :
#2

i have, the issue is, two days ago i knew nothing.. and ive been trying to cram it all in at once.
ive tried a few of those but i keep having problems because im not sure what i can use, and what i can't use with certain things..
if i get one thing to work something else fuks up , lol , i just figured som1 could explain it a little simpler,, or perhaps what i explained would be enough to show me pretty much what it should look like. its for a facebook game btw.
if i waiting a week or two and kept reading on about java, and phython n whatnot, i would probably be able to figure it out.
im just really impatient.lol

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

send your script.sikuli zipped to my mail https://launchpad.net/~raimund-hocke

I will have a quick look at it.

Revision history for this message
josh (savannalynne11) said :
#4

could not figure it out, so i sent it to your email. not sure how much that will help. but its sent

Revision history for this message
josh (savannalynne11) said :
#5

could not figure it out, so i sent it to your email. not sure how much that will help. but its sent

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

ok sent it back revised.

You might think about using FOREVER in the first line, since if the image never comes up, Sikuli has to be killed (looping forever ;-).

Revision history for this message
josh (savannalynne11) said :
#7

thank you =D , ive checked it out. ran it a few times.. it seems that if the red "X" the "random event" doesn't pop up it wont start,, (wont skip the random). but if i click something to produce a red "X" it will click the x, then begin the script.

then it will click them all even if the purple arrows are not present (probably my screenshots), im hoping anyways.

but if it can skip properly if the item isn't present, then i think it would be perfect for what i need it for =]

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

this is what I meant with "optional processing in the else: branches instead of exiting the script:

I do not want to discourage you, but if the straight foreword approach does not help any longer, it gets a bit more complicated:
- you have to implement more branches if:else: that might even be nested, to walk through a tree of possibilities
- you might have to come back to some point, that you previously had to skip (looping with while:)
- there might be some template actions that could be packed into functions to be repeated at different places with different parameters
... even more

If you want to do this step further, you need some at least procedural programming/scripting knowledge and have to get your self some Python knowledge.

If you have a script to look at, come back (but next 10 days I am not available, see faq 1739)

Revision history for this message
josh (savannalynne11) said :
#9

well ill keep researching and trying a few different approaches, to see if i can't figure this thing out a little better, but if i can't pull through it and get this working properly ill be getting a hold of you in about 11 days =D lol,,, and if you can pull it off and make my happy, ill throw you 5 or 10 bucks for wasting your time with my problems LOL.
the facebook game is called potfarm btw.. i might just make a fresh facebook account, with that game on it. if i can't figure it out. that way u can see what im actually trying to accomplish here.. but thank you again..

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

How did the fly survive in the pot of milk?

Struggling as long until the milk turned into butter.

All the best ;-)

Can you help with this problem?

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

To post a message you must log in.