Re: [Sikuli-driver] [Question #678649]: How do I use Multi Thread Clicking?
Question #678649 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678649 Status: Answered => Open Lisa Howells is still having a problem: I was using multi threading because what i'm trying to do is use sikuli for playing an android game that supports multi touch. I want it to be able to detect and do things at once. For example I want it to be able to look at the HP bar of a character, and the mana bar of a character, and then be able to click the skill buttons that restore low hp or mana, but those things might happen around the same time. Now imagine if I had 6 characters on my party, and they all had their own separate buttons for healing hp and mana, and I wanted to be able to detect when any of the 6 have low hp/mana so they can click their buttons. there's 12 possible buttons I want to click and sometimes it will happen at the same time. it doesn't need to be at the exact same time, but lets say I needed to click 6 different buttons at once because everyone had low hp, I would want them all to be clicked in under 2 seconds. How can I set up sikuli so it can constantly be detecting their 6 hp bars, and clicking each of the party member's own healing buttons as needed? I've already figured out how to make sikuli detect when individual HP/mana bars of one party member is low by using exists() and then clicking the member's heal button with click(), but I don't get how to make it work for multiple party members at the same time. I'm bad at explaining stuff, so here's a picture I drew instead: https://i.imgur.com/HHcl5Vf.png on the left is the 12 buttons, on the right is the bars that I'm detecting right now with basic sikuli code using exists() and click() i'm able to have one party member's hp/mana detected, and to restore it by clicking one of the matching button when its low. how do I make this so it can work with 6 party members so it can detect the right HP bar and click the right button that matches it? -- 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 #678649]: How do I use Multi Thread Clicking?
Question #678649 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678649 Summary changed to: How do I use Multi Thread Clicking? -- 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 #678649]: How do I use Multi Thread Clicking?
Question #678649 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678649 Description changed to: I'm trying to do basic multi threaded clicking in sikuli (I would also one day like to have exists() working in a similar multi threaded way). This is my simple example code: import threading loc1 = Location(117, 803); loc2 = Location(499, 777); loc3 = Location(1211, 754) x = [loc1, loc2, loc3, loc1, loc2, loc3, loc1, loc2, loc3] def worker(location): click(location) threads = [] for i in x: t = threading.Thread(target=worker, args=(i,)) threads.append(t) t.start() when I run the code it almost looks like it works. the mouse teleports around to the right locations but sometimes it doesn't actually click even though the log reports clicks. And then I get errors like: [error] RobotDesktop: checkMousePosition: should be L[1211,754]@S(0) but after move is L[117,802]@S(0) Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. [error] RobotDesktop: checkMousePosition: should be L[1211,754]@S(0) but after move is L[499,777]@S(0) Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. [log] CLICK on L[117,803]@S(0) (657 msec) [log] CLICK on L[499,777]@S(0) (651 msec) [log] CLICK on L[499,777]@S(0) (653 msec) [log] CLICK on L[1211,754]@S(0) (717 msec) [log] CLICK on L[117,803]@S(0) (725 msec) [log] CLICK on L[117,803]@S(0) (728 msec) [log] CLICK on L[1211,754]@S(0) (725 msec) [log] CLICK on L[1211,754]@S(0) (765 msec) [log] CLICK on L[499,777]@S(0) (768 msec) how do I make this so that it works properly so that I can click multiple things at once (or in very rapid succession?) -- 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 #678649]: How do I use Multi Thread Clicking?
Question #678649 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678649 Summary changed to: How do I use Multi Thread Clicking? -- 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 #678649]: How do I use multi Thread Clicking?
New question #678649 on Sikuli: https://answers.launchpad.net/sikuli/+question/678649 I'm trying to do basic multi threaded clicking in sikuli (I would also one day like to have exists() working in a similar multi threaded way). This is my simple example code: import threading loc1 = Location(117, 803); loc2 = Location(499, 777); loc3 = Location(1211, 754) x = [loc1, loc2, loc3, loc1, loc2, loc3, loc1, loc2, loc3] def worker(location): click(location) threads = [] for i in x: t = threading.Thread(target=worker, args=(i,)) threads.append(t) t.start() when I run the code it almost looks like it works. the mouse teleports around to the right locations but it doesn't actually click even though the log reports clicks. And then I get errors like: [error] RobotDesktop: checkMousePosition: should be L[1211,754]@S(0) but after move is L[117,802]@S(0) Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. [error] RobotDesktop: checkMousePosition: should be L[1211,754]@S(0) but after move is L[499,777]@S(0) Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. [log] CLICK on L[117,803]@S(0) (657 msec) [log] CLICK on L[499,777]@S(0) (651 msec) [log] CLICK on L[499,777]@S(0) (653 msec) [log] CLICK on L[1211,754]@S(0) (717 msec) [log] CLICK on L[117,803]@S(0) (725 msec) [log] CLICK on L[117,803]@S(0) (728 msec) [log] CLICK on L[1211,754]@S(0) (725 msec) [log] CLICK on L[1211,754]@S(0) (765 msec) [log] CLICK on L[499,777]@S(0) (768 msec) how do I make this so that it works properly so that I can click multiple things at once (or in very rapid succession?) -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Lisa Howells posted a new comment: RaiMan thank you so much I had been trying to get this to work for a while! I have one last question. Why does Masou's 3 line script example not work and it terminates and then gives that error? I want to learn why so I don't make mistakes like that in the future. -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Status: Open => Solved Lisa Howells confirmed that the question is solved: Thanks RaiMan, that solved my question. -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Status: Answered => Open Lisa Howells is still having a problem: Tried your exact 3 line script. I ran it 4 times, it did the same thing all 4 times, the program clicks the button (then the button goes away) and then it clicks where the button was a couple times and then the program closes (and then the sikuli IDE opens up again). it only gave this error message on the fourth try though. first 3 tries had no error message. [error] script [ testScript ] stopped with error at line --unknown-- [error] Error caused by: Traceback (most recent call last): File "C:\Users\Lisa\Documents.sikuli\TestScript.sikuli\TestScript.py", line 2, in click("randomButton.png") Line 2275, in file Region.java at org.sikuli.script.Region.wait(Region.java:2275) at org.sikuli.script.Region.wait(Region.java:2293) at org.sikuli.script.Region.getLocationFromTarget(Region.java:3302) at org.sikuli.script.Region.click(Region.java:3907) at org.sikuli.script.Region.click(Region.java:3892) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) org.sikuli.script.FindFailed: FindFailed: randomButton.png: (58x65) seen at (777, 625) with 0.79 in R[0,0 1680x1050]@S(0) Line 2275, in file Region.java -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Status: Needs information => Open Lisa Howells gave more information on the question: [error] Error caused by: Traceback (most recent call last): File "C:\Users\Lisa\Documents.sikuli\ClickButton.py", line 6, in click("randomButton.png") Line 2275, in file Region.java at org.sikuli.script.Region.wait(Region.java:2275) at org.sikuli.script.Region.wait(Region.java:2293) at org.sikuli.script.Region.getLocationFromTarget(Region.java:3302) at org.sikuli.script.Region.click(Region.java:3907) at org.sikuli.script.Region.click(Region.java:3892) at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) org.sikuli.script.FindFailed: FindFailed: randomButton.png: (57x27) seen at (1313, 540) with 0.75 in R[0,0 1680x1050]@S(0) Line 2275, in file Region.java this happens once the button has been found and clicked and gone away so there's no button on the screen until it randomly comes back in a few minutes. I want the program to not stop, but to keep looking for when the button appears again but this error happens instead. -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Status: Answered => Open Lisa Howells is still having a problem: but why does it say findfailed when I'm using while has(image) as soon as the image goes away? I want it to keep searching for the image until it comes up again to click it agian. -- 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Description changed to: I'm trying to make something simple for a game macro. sometimes a button randomly appears in intervals between 5 and 500 seconds. I want it to detect and click the button within 10 seconds, but to not click if the button doesn't exist. Yet if I try something like: while has(randomButtonImage): click(randomButtonImage) If the button isn't already up, the program closes saying findfailed. if the button is up and I run the program, it goes to the button, clicks it a few times(even after it has disappeared), and then when the button is gone from being clicked the program terminates because it says findfailed. I'm confused because sikuli says it doesn't throw a findfailed for has() in version 1.1.4. All I want it to do is click the button once when it exists (and then the button in the game goes away for 5-500 seconds), and then to keep searching for the button until it comes up again (but not clicking unless it exists, and to stop terminating if the image doesn't exist). Thanks for any 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Description changed to: I'm trying to make something simple for a game macro. sometimes a button randomly appears in intervals between 5 and 500 seconds. I want it to detect and click the button within 10 seconds, but to not click if the button doesn't exist. Yet if I try something like: while has(randomButtonImage): click(randomButtonImage) If the button isn't already up, the program closes saying findfailed. if the button is up and I run the program, it goes to the button, clicks it a few times(even after it has disappeared), and then when the button is gone from being clicked the program terminates because it says findfailed. I'm confused because sikuli says it doesn't throw a findfailed for has(). All I want it to do is click the button once when it exists (and then the button in the game goes away for 5-500 seconds), and then to keep searching for the button until it comes up again (but not clicking unless it exists, and to stop terminating if the image doesn't exist). Thanks for any 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Description changed to: I'm trying to make something simple for a game macro. sometimes a button randomly appears in intervals between 5 and 500 seconds. I want it to detect and click the button within 10 seconds, but to not click if the button doesn't exist. Yet if I try something like: while has(randomButtonImage): click(randomButtonImage) If the button isn't already up, the program closes saying findfailed. if the button is up and I run the program, it goes to the button, clicks it a few times(even after it has disappeared), and then when the button is gone from being clicked the program terminates because it says findfailed. I'm confused because sikuli says it doesn't throw a findfailed for has() in version 1.1.4. All I want it to do is click the button once when it exists (and then the button in the game goes away for 5-500 seconds), and then to keep searching for the button until it comes up again (but not clicking unless it exists, and to stop terminating from findfailed if the image doesn't exist). Thanks for any 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 #678325]: If it Can't Find, Closes Early
Question #678325 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678325 Description changed to: I'm trying to make something simple for a game. sometimes a button randomly appears in intervals between 5 and 500 seconds. I want it to detect and click the button within 10 seconds, but to not click if the button doesn't exist. Yet if I try something like: while has(randomButtonImage): click(randomButtonImage) If the button isn't already up, the program closes saying findfailed. if the button is up and I open the program, it goes to the button, clicks it a few times(even after it has disappeared), and then when the button is gone from being clicked the program terminates because it says findfailed. I'm confused because sikuli says it doesn't throw a findfailed for has(). All I want it to do is click the button once when it exists (and then the button goes away), and then to keep searching for the button until it comes up again (but not clicking unless it exists, and to stop terminating if the image doesn't exist). Thanks for any 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
[Sikuli-driver] [Question #678325]: If it Can't Find, Closes Early
New question #678325 on Sikuli: https://answers.launchpad.net/sikuli/+question/678325 I'm trying to make something simple for a game. sometimes a button randomly appears in intervals between 5 and 500 seconds. I want it to detect and click the button within 10 seconds, but to not click if the button doesn't exist. Yet if I try something like: while has(randomButtonImage): click(randomButtonImage) If the button isn't already up, the program closes saying findfailed. if the button is up and I open the program, it goes to the button, clicks it a few times(even after it has disappeared), and then when the button is gone from being clicked the program terminates because it says findfailed. All I want it to do is click the button once when it exists (and then the button goes away), and then to keep searching for the button until it comes up again (but not clicking unless it exists, and to stop terminating if the image doesn't exist). Thanks for any 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