Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-14 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Answered => Solved

layanor confirmed that the question is solved:
Yes i have pulled a lot of code out of this. I think I have fixed most
of the issues with the help I was given :) I am not going to ask a new
question soon on how to speed up this code I have so far. Thank you all
for the help!

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-13 Thread Manfred Hampl
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Manfred Hampl proposed the following answer:
In addition to my previous comment:
You are right, the program will loop in the first while block:

A break statement will only escape the innermost loop. So the "break" in line 
12 will not cause the first big loop (lines 2 - 12) to end.
As already written before, there is no need for a while statement in line 11. 
If you replace lines 11-12 with a simple "break" with a first level-indent 
(indented the same amount as line 8), then the "break" will cause an escape 
from the first loop (and lead to a never-ending loop in lines 13-15 as long as 
that part is not corrected).

By the way, I do not really understand why lines 2-12 are packed into a
"while true" loop.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-13 Thread Manfred Hampl
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Open => Answered

Manfred Hampl proposed the following answer:
Your new code will loop forever in lines 13-15
You probably need a "break" inside this loop to continue processing below that 
part.

Remark:
line 11 seems redundant.
The block in lines 8-10 will loop as long as that blue/red block is visible on 
the screen and ends when it is no more there.
I do not see the need to test whether that block now is not there any more 
(unless it is supposed to immediately re-appear).
In my opinion a simple "break" with a first-level indent would have been enough.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-12 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Answered => Open

layanor is still having a problem:
I rearranged the code a bit more but the loop will still not break on
the first loop.

https://gyazo.com/a5fec13cf88d61ff488821490c7f8b38

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-12 Thread Manfred Hampl
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Open => Answered

Manfred Hampl proposed the following answer:
Your code will only loop i the first "while true:" loop YOu have to put
a "break" statement into the first loop.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-12 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Answered => Open

layanor is still having a problem:
I don't understand. The break is added like you suggested and does not
work in this situation. In fact, this is the code you gave to me with
some editing.

Can you give examples for ending workfloow with  "while" , "for", "if" ?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-11 Thread masuo
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

masuo posted a new comment:
@layanor
# 3 comment is the last thing I can help.
You should Finish making your workflow to using "while" , "for", "if" and other 
things.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-10 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

layanor posted a new comment:
Also, I want the code to start again for the beginning after its picked
the winner. That way it is completely automated with setting up the
matches and declaring winners!

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-10 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

layanor posted a new comment:
Sorry! I forgot to add the rest of the code.

https://gyazo.com/dd9520432ac9fa38ecb958e1ab4b3f33

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-10 Thread masuo
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

masuo proposed the following answer:
There is not "break" in this codes.
Add break where you want to go out from while loop.
probably after click() .

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-09 Thread layanor
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

layanor posted a new comment:
https://gyazo.com/e0a916124999037281e150a98d4603c5

The code is not seeing either pic. Is there something wrong here?  The
pic is on the screen for about 4 - 15 seconds.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-09 Thread masuo
Question #655511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/655511

Status: Open => Answered

masuo proposed the following answer:
If either the green image or the magenta image will appear sooner or
later, there is a way to wait until it appears.

while True:
player1 = exists(greenimage,0)
player2 = exists(magentaimage,0)

if not player1 and not player2:
sleep(0.5)
continue
else:
break
if player1:
print "PLAYER 1 WINS"
else:
print "PLAYER 2 WINS"

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #655511]: Waiting to do 1 of 2 actions

2017-08-09 Thread layanor
New question #655511 on Sikuli:
https://answers.launchpad.net/sikuli/+question/655511

Hello! 

I am starting up a game for my live stream viewers so they can bet points on a 
fighting game I made. 

https://gyazo.com/68eddbbdc23c238bcd6828977ddf0f79

Half of the code I have worked and will start up matches for me. "Lines 1 - 12"

However, the rest of the code does not work. 
I checked the pictures and sikuli does see them. 

Key things to know about this is, while the match is being played out, sikuli 
needs to be idle until a victor has won. So the amount to wait is a bit random. 

Any help and improvement on this could would be great :)

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp