Draps! Thank you very much for these really great SikuliX tutorials.... I hope you decide to do some more advanced training videos for SikuliX.... It would be really great to see some videos showing how a person could combine the power of SikuliX with the Python GUI tool SWAPY! SWAPY looks incredible and if combined with SikuliX could give you the most incredible and efficient way to test / automate pretty much ANYTHING!(but even if you don't do any more....thanks again for what you've done it allowed me to get a good start!)
u could make it While exists(image of button) press that, this way u would be clicking it as long as its available, there could be also a 1s break after each click to let everything be procedured right
Hmm I still don't get the timeToDead thing, like what is it for? And also what should you do when ur playing a game that have long delay animation (like showing the brand names and things like that)
Love your video, but I got a question, what if I want to bind the script to a event? for example, everytime a new message arrives, copy the message into a empty noteblock? I tried doing something like: state1 state2 state1 = Region("region of display where messages arrive") click("button to scroll down the chat") i=0 while i == 0: state2 = Region("region of display where messages arrive") if state2 != state1: region1 = region2 and that should be it, the script runs and stops when there's no new message, but for some reason it goes in a loop pasting the last messagge over and over. "Also, i checked for things like reactions to the comment changing, how much time ago was it sent ecc, it's not the problem" How can I solve this?
Hey there, I'm trying to build a script to do some work for me at the office that is very standard and always the same route. Can you maybe send me a link with most used terms or actions in coding language? Great tutorials btw you should make more of SikuliX
+Stephan Timmers The official doc's are pretty good for almost everything you could need. Is this what you're asking for? sikulix-2014.readthedocs.org/en/latest/#sikulix-api-for-scripting-and-java-programming
Hi Draps, right now I'm using these lines to auto run a game, but somehow errors keep occuring and after a few hours my PC gets stuck alias blue screen pops up. Settings.MoveMouseDelay = 0.1 running = True def runHotkey(event): global running running = False Env.addHotkey(Key.F1, KeyModifier.CTRL, runHotkey) while running: if Screen(1).exists(Pattern("1516809781721.png").similar(0.90)): Screen(1).click(Pattern("1516809781721.png").similar(0.90)) if Screen(1).exists("1516823633104.png"): Screen(1).click(Pattern("1516823633104.png").targetOffset(125,220)) if Screen(1).exists(Pattern("1516811016741.png").similar(0.96)): Screen(1).click(Pattern("1516811016741.png").similar(0.96)) if Screen(1).exists("1516994251665.png"): Screen(1).click(Pattern("1516994251665.png").targetOffset(210,393)) Screen(1).wait(Pattern("1516812605236.png").similar(0.86), 60) Screen(1).click(Pattern("1516812605236.png").similar(0.90)) Screen(1).wait("1516812737846.png", 60) Screen(1).click(Pattern("1516812737846.png").targetOffset(320,134)) if Screen(1).exists("1516823633104.png"): Screen(1).click(Pattern("1516823633104.png").targetOffset(-70,230)) if Screen(1).exists(Pattern("1516995380292.png").similar(0.90).targetOffset(329,519)): Screen(1).click(Pattern("1516995380292.png").similar(0.90).targetOffset(329,519)) Screen(1).wait(Pattern("1516820524383.png").exact(), 60) Screen(1).click(Pattern("1516820524383.png").exact())
I am searching an option to convert a number in the screen into a number for sikuli to use in the logic. What should i use to do so? My weak googling hints to something called "sikuli tesseract" is that correct?
Hi. Thank you for the tutorial. I have a question. I got my script running as expected and lets say I have my script from Line 1 - 10. Once it hits line 10, start Line 1 again so I can just have this script constantly running. The app that will be automating is a chrome browser app. Thanks.
You could move them from line 1-10 to line 2-11. And on line 1 type this while exists(YOUR IMAGE): So long as the image on line 1 stays visible, all the lines under line 1 will run in infinite loop,
Hello, I just found out about this wonderful software. I am following your tutorial and for some reason I cannot get it to focus on Clicker Heroes when I launch Sikuli. It just sits there and nothing happens. Any idea why it is doing that?
Hey can you please upload a video for ... 1- For Generating sikuli test result or log 2- Interface with TestNG and HTMLTestRunner. 3- How to run multiple test files and based on that how to generate its logs or results whether it is pass or fail Thanks.. And if you cant then... if possible help me in some way .. plzz And Thanks for Sikuli tutorials ... itz really helpfull.. (y)
How do you create a region if you want to check an item withing the confines of a region? eg. If I want to check an item that there is more than one of but I want to check a specific one in the specific area? I know about the region button but i do not know how to code it
Are you going to make more python sikuli tut? I'm using it right now but I am stuck at nested loops. It's giving me lots of headaches and googling doesn't help much cause all the loop breaks end with print which is something I never use in sikuli.
I see, I'll be waiting for the day you do em. I don't think I am doing nested loops properly in the sense that the IF commands aren't really working as I wanted it to. i.e big loop (want to loop everything inside the "[ ]") [perform an action > if this happens, do A and restart loop > if this happens instead, do B and restart loop] I'm also not using variables much so everything is typed out repetitively and looks more complicated than it actually is. The only loop I am using is the while true loop due to the nature of the task I am trying to automate so the problem might have come from that argument.
apologies for the late reply. Yeah, I'll pm you a pastebin link. I have it working now but I took out 80% of the contents so it's not as sophisticated as I wanted to but it's a good placeholder for now as I try to figure out the problem.
sure can. Settings.OcrTextRead = True #set the OcrTextRead setting to True text = myRegion.text() #recognize the text whithin the region and save it to a variable
Do i have to enter a font or something, it just pops out with " [error] text: text recognition is now switched off --- no text --- " My code. " Settings.OcrTextRead = True while True: myRegion = Region(240,473,68,18) text = myRegion.text() print(text) "
I know this is an older video, but with your help I have slowly been muddling my way through Sikuli. Is there any way in Sikuli to create a hot key that can toggle the script on and of from the application you are using it from? I.e. Pausing the script so I can type in a chat box or what not? If I am not being clear enough please let me know. I have looked through the Sikuli docs and can only find the generic how to create a hot key. Any help is appreciated. Thanks in advance.
in this video we do stopping with a keybind, but you could change this to toggle the running variable instead. However you will be restarting from the idle state of your script. Another possible route is to have your script running inside a thread and use threading events to wait while it's paused and resume & clear when it's resumed.
+DrapsTV Thanks for the reply. Most of what you just said is Greek to me, but I have a place I can start to research now. I appreciate the help and the videos, I keep coming back to them often for some explanation of a function or syntax. Again thanks for the info and the reply!
No problem, let me know how you go. I could give a more detailed answer, but it will take me more time and there is the possibility you will miss out on the learning experience.
+DrapsTV Hey, Ive been watching your SikuliX videos, very well done, but I find most of it going over my head and Its hard for me to apply the concepts to the specific things I want to do. I am trying to make a script for a game. Basically what I want to do is have my game character move in a specific pattern, Left, Up, Right, Down (using either a,w,d,s or the arrow keys. An on screen keyboard can be used if that makes it easier) and have that loop until something on the screen pops up. Once the in game pop up happens It will recognize there has been a change and then click on specific buttons, looping until the pop up closes. It will then go back to the move loop, and continue to loop like that, recognizing whenever a pop up happens. I've been able to make my character move for one cycle and and i've been able to script it to click on the pop up buttons, again only for one cycle but I don't know how to connect the two (so It'll walk and then recognize the pop up) And i'm having trouble looping the actions. I'd love if you could help me out with the code for that or give me advice on how I'd do it. Thanks!
put the whole thing in a while loop, you could use a similar system to this video with a button to stop. or you can just while True: and loop forever. Then at the start of the while check if the popup exists, if it does click it or what ever, then go back to the rest of the loop where you input type(Key.LEFT) wait(0.5) type(Key.UP) etc
5 years later and still very relevant! Thank you for the content
Best Sikuli Tutorials hands down.
Completed 5 videos in one shot. YOU'RE AMAZING. Thank you so much for this tutorial. Very clear and very pracical. Keep it up!
Draps! Thank you very much for these really great SikuliX tutorials.... I hope you decide to do some more advanced training videos for SikuliX.... It would be really great to see some videos showing how a person could combine the power of SikuliX with the Python GUI tool SWAPY! SWAPY looks incredible and if combined with SikuliX could give you the most incredible and efficient way to test / automate pretty much ANYTHING!(but even if you don't do any more....thanks again for what you've done it allowed me to get a good start!)
u could make it While exists(image of button) press that, this way u would be clicking it as long as its available, there could be also a 1s break after each click to let everything be procedured right
Awesome brother
Better than sentdex as well
Can we do game automation testing with sikuli?
Awesome good work
How we can share the sikuli script to another machine ? Can we make a jar file and share ? Is it mandatory to have IDE in other machine ?
Hmm I still don't get the timeToDead thing, like what is it for? And also what should you do when ur playing a game that have long delay animation (like showing the brand names and things like that)
Great tutorial. Thank you!
Great tutorials, thanks bro
+DrapsTV how to write while loop with countdown timer? I mean to continue loop for the 'x' amount of time
Love your video, but I got a question, what if I want to bind the script to a event? for example, everytime a new message arrives, copy the message into a empty noteblock?
I tried doing something like:
state1
state2
state1 = Region("region of display where messages arrive")
click("button to scroll down the chat")
i=0
while i == 0:
state2 = Region("region of display where messages arrive")
if state2 != state1:
region1 = region2
and that should be it, the script runs and stops when there's no new message, but for some reason it goes in a loop pasting the last messagge over and over.
"Also, i checked for things like reactions to the comment changing, how much time ago was it sent ecc, it's not the problem"
How can I solve this?
Please advise how to automate skl file in windows & run on schedule.
can you add more advanced tutorials?
Thanks bro!
thank you for the tutorials !
Hey there, I'm trying to build a script to do some work for me at the office that is very standard and always the same route. Can you maybe send me a link with most used terms or actions in coding language?
Great tutorials btw you should make more of SikuliX
+Stephan Timmers The official doc's are pretty good for almost everything you could need. Is this what you're asking for? sikulix-2014.readthedocs.org/en/latest/#sikulix-api-for-scripting-and-java-programming
+DrapsTV Thanks! I will do my best to make it work by these doc's.
Hi Draps, right now I'm using these lines to auto run a game, but somehow errors keep occuring and after a few hours my PC gets stuck alias blue screen pops up.
Settings.MoveMouseDelay = 0.1
running = True
def runHotkey(event):
global running
running = False
Env.addHotkey(Key.F1, KeyModifier.CTRL, runHotkey)
while running:
if Screen(1).exists(Pattern("1516809781721.png").similar(0.90)):
Screen(1).click(Pattern("1516809781721.png").similar(0.90))
if Screen(1).exists("1516823633104.png"):
Screen(1).click(Pattern("1516823633104.png").targetOffset(125,220))
if Screen(1).exists(Pattern("1516811016741.png").similar(0.96)):
Screen(1).click(Pattern("1516811016741.png").similar(0.96))
if Screen(1).exists("1516994251665.png"):
Screen(1).click(Pattern("1516994251665.png").targetOffset(210,393))
Screen(1).wait(Pattern("1516812605236.png").similar(0.86), 60)
Screen(1).click(Pattern("1516812605236.png").similar(0.90))
Screen(1).wait("1516812737846.png", 60)
Screen(1).click(Pattern("1516812737846.png").targetOffset(320,134))
if Screen(1).exists("1516823633104.png"):
Screen(1).click(Pattern("1516823633104.png").targetOffset(-70,230))
if Screen(1).exists(Pattern("1516995380292.png").similar(0.90).targetOffset(329,519)):
Screen(1).click(Pattern("1516995380292.png").similar(0.90).targetOffset(329,519))
Screen(1).wait(Pattern("1516820524383.png").exact(), 60)
Screen(1).click(Pattern("1516820524383.png").exact())
How can I make an executable of my script so that if I run it, the script executes?
I am searching an option to convert a number in the screen into a number for sikuli to use in the logic.
What should i use to do so? My weak googling hints to something called "sikuli tesseract" is that correct?
Hi..is it possible to automate Unix box through Sikuli ?
Hi. Thank you for the tutorial. I have a question.
I got my script running as expected and lets say I have my script from Line 1 - 10. Once it hits line 10, start Line 1 again so I can just have this script constantly running.
The app that will be automating is a chrome browser app.
Thanks.
You could move them from line 1-10 to line 2-11. And on line 1 type this while exists(YOUR IMAGE):
So long as the image on line 1 stays visible, all the lines under line 1 will run in infinite loop,
Hello, I just found out about this wonderful software. I am following your tutorial and for some reason I cannot get it to focus on Clicker Heroes when I launch Sikuli. It just sits there and nothing happens. Any idea why it is doing that?
Hey can you please upload a video for ...
1- For Generating sikuli test result or log
2- Interface with TestNG and HTMLTestRunner.
3- How to run multiple test files and based on that how to generate its logs or results whether it is pass or fail
Thanks..
And if you cant then... if possible help me in some way .. plzz
And Thanks for Sikuli tutorials ... itz really helpfull.. (y)
+HaRDik Chotaliya
Hi did you get some answer? i have same problems with SikuliX
Same question : anyone know how to generate sikuli test results?
How do you create a region if you want to check an item withing the confines of a region?
eg. If I want to check an item that there is more than one of but I want to check a specific one in the specific area?
I know about the region button but i do not know how to code it
if code you can create a region with the region object. eg.
myRegion = Region(0,0,400,800)
Are you going to make more python sikuli tut? I'm using it right now but I am stuck at nested loops. It's giving me lots of headaches and googling doesn't help much cause all the loop breaks end with print which is something I never use in sikuli.
None are planned at the moment. What specifically are you struggling to do with nested loops?
I see, I'll be waiting for the day you do em. I don't think I am doing nested loops properly in the sense that the IF commands aren't really working as I wanted it to.
i.e big loop (want to loop everything inside the "[ ]") [perform an action > if this happens, do A and restart loop > if this happens instead, do B and restart loop]
I'm also not using variables much so everything is typed out repetitively and looks more complicated than it actually is.
The only loop I am using is the while true loop due to the nature of the task I am trying to automate so the problem might have come from that argument.
Did you want to send me a pastebin of your code for me to have a look at to see if I can spot what might be going wrong?
apologies for the late reply. Yeah, I'll pm you a pastebin link.
I have it working now but I took out 80% of the contents so it's not as sophisticated as I wanted to but it's a good placeholder for now as I try to figure out the problem.
hi.. i'm getting "AttributeError ( type object 'Env' has no attribute 'addHotKey' )" ... what am i doing wrong?
No capital K in addHotkey.
oh geez. lol thanks!
it's possible press any key (example: F) with sikuli?
+Die You sure can simulate any keypresses!
+DrapsTV how? sorry for stupid question
+Die The doc's ill help you out. :) doc.sikuli.org/region.html#Region.keyDown There is also a list of key names somewhere on there. :)
Is it possible to convert image to text, if there is text can i make sikulix turn it into text?
sure can.
Settings.OcrTextRead = True #set the OcrTextRead setting to True
text = myRegion.text() #recognize the text whithin the region and save it to a variable
Oh my god dude, thanks :D
Do i have to enter a font or something, it just pops out with
"
[error] text: text recognition is now switched off
--- no text ---
"
My code.
"
Settings.OcrTextRead = True
while True:
myRegion = Region(240,473,68,18)
text = myRegion.text()
print(text)
"
Sorry for bad code i'm quite new.
Hmm it looks like possibly the OCR library was left un-ticked in the installer. try installing again and make sure the OCR libraries are selected.
so cool !
Please help. What is the command tha skips errors.
try:
code to try
except:
code to do if it fails (Yous can just put a *pass* here)
DrapsTV Thanks that helped me alot
I know this is an older video, but with your help I have slowly been muddling my way through Sikuli. Is there any way in Sikuli to create a hot key that can toggle the script on and of from the application you are using it from? I.e. Pausing the script so I can type in a chat box or what not? If I am not being clear enough please let me know. I have looked through the Sikuli docs and can only find the generic how to create a hot key. Any help is appreciated. Thanks in advance.
in this video we do stopping with a keybind, but you could change this to toggle the running variable instead. However you will be restarting from the idle state of your script. Another possible route is to have your script running inside a thread and use threading events to wait while it's paused and resume & clear when it's resumed.
+DrapsTV Thanks for the reply. Most of what you just said is Greek to me, but I have a place I can start to research now. I appreciate the help and the videos, I keep coming back to them often for some explanation of a function or syntax. Again thanks for the info and the reply!
No problem, let me know how you go. I could give a more detailed answer, but it will take me more time and there is the possibility you will miss out on the learning experience.
Great tutorial. but how to start without IDE?
just add -r file/folder to java command line
can you make a Ruby tutorials like the Python one ,please?
+G Adam I don't use Ruby very often. But I'll add it to the bottom of the todo list :)
+DrapsTV that's fine, I mainly use python but ruby is for my pentest course, metasploit to be exact .
+DrapsTV Hey, Ive been watching your SikuliX videos, very well done, but I find most of it going over my head and Its hard for me to apply the concepts to the specific things I want to do. I am trying to make a script for a game.
Basically what I want to do is have my game character move in a specific pattern, Left, Up, Right, Down (using either a,w,d,s or the arrow keys. An on screen keyboard can be used if that makes it easier) and have that loop until something on the screen pops up. Once the in game pop up happens It will recognize there has been a change and then click on specific buttons, looping until the pop up closes. It will then go back to the move loop, and continue to loop like that, recognizing whenever a pop up happens.
I've been able to make my character move for one cycle and and i've been able to script it to click on the pop up buttons, again only for one cycle but I don't know how to connect the two (so It'll walk and then recognize the pop up) And i'm having trouble looping the actions. I'd love if you could help me out with the code for that or give me advice on how I'd do it. Thanks!
put the whole thing in a while loop, you could use a similar system to this video with a button to stop. or you can just while True: and loop forever. Then at the start of the while check if the popup exists, if it does click it or what ever, then go back to the rest of the loop where you input type(Key.LEFT) wait(0.5) type(Key.UP) etc
So cool~
Thanks! I'm glad you enjoyed it! :)
Help me make one for star wars game, please!
Could you make summoners war script
Could you send me codes for games
this is needlessly complicated. trash.