SikuliX Tutorial #5 - Game Example

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025

Комментарии •

  • @jKonradcz
    @jKonradcz 4 года назад +7

    5 years later and still very relevant! Thank you for the content

  • @zacharykirby1361
    @zacharykirby1361 9 лет назад +11

    Best Sikuli Tutorials hands down.

  • @millimind
    @millimind 4 года назад

    Completed 5 videos in one shot. YOU'RE AMAZING. Thank you so much for this tutorial. Very clear and very pracical. Keep it up!

  • @sondrax
    @sondrax 8 лет назад

    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!)

  • @kamilmarszakowski8694
    @kamilmarszakowski8694 Год назад

    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

  • @amanpingle1497
    @amanpingle1497 5 лет назад +1

    Awesome brother
    Better than sentdex as well

  • @shaliniverma9233
    @shaliniverma9233 2 года назад

    Can we do game automation testing with sikuli?

  • @Monsizr
    @Monsizr 9 лет назад

    Awesome good work

  • @itsmejinto92
    @itsmejinto92 3 года назад

    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 ?

  • @mrweather5961
    @mrweather5961 8 лет назад +1

    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)

  • @steveo.7061
    @steveo.7061 8 лет назад

    Great tutorial. Thank you!

  • @Homiloko2
    @Homiloko2 9 лет назад

    Great tutorials, thanks bro

  • @khilji2k5
    @khilji2k5 4 года назад

    +DrapsTV how to write while loop with countdown timer? I mean to continue loop for the 'x' amount of time

  • @artemiefedoruc3663
    @artemiefedoruc3663 Год назад

    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?

  • @himcahalifamily
    @himcahalifamily 7 лет назад

    Please advise how to automate skl file in windows & run on schedule.

  • @ben3ng933
    @ben3ng933 4 года назад

    can you add more advanced tutorials?

  • @AndriiBilous
    @AndriiBilous 3 года назад

    Thanks bro!

  • @Mototijorola
    @Mototijorola 8 лет назад

    thank you for the tutorials !

  • @stephantimmers9843
    @stephantimmers9843 9 лет назад +2

    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

    • @DrapsTV
      @DrapsTV  9 лет назад +1

      +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

    • @stephantimmers9843
      @stephantimmers9843 9 лет назад

      +DrapsTV Thanks! I will do my best to make it work by these doc's.

  • @DaveedBachschmeed
    @DaveedBachschmeed 7 лет назад

    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())

  • @abdulmoizsheikh8031
    @abdulmoizsheikh8031 7 лет назад

    How can I make an executable of my script so that if I run it, the script executes?

  • @Koroistro
    @Koroistro 7 лет назад

    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?

  • @sonalaparajitanand6186
    @sonalaparajitanand6186 7 лет назад

    Hi..is it possible to automate Unix box through Sikuli ?

  • @marvingonzales6266
    @marvingonzales6266 2 года назад

    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.

    • @Rippeee
      @Rippeee Месяц назад

      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,

  • @forensicsman320
    @forensicsman320 5 лет назад

    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?

  • @hardikchotaliya5708
    @hardikchotaliya5708 9 лет назад +2

    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)

    • @PeterSurovec
      @PeterSurovec 9 лет назад

      +HaRDik Chotaliya
      Hi did you get some answer? i have same problems with SikuliX

    • @lgzombie
      @lgzombie 5 лет назад

      Same question : anyone know how to generate sikuli test results?

  • @DokterWerner
    @DokterWerner 7 лет назад

    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

    • @DrapsTV
      @DrapsTV  7 лет назад

      if code you can create a region with the region object. eg.
      myRegion = Region(0,0,400,800)

  • @simplyboredable
    @simplyboredable 8 лет назад

    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.

    • @DrapsTV
      @DrapsTV  8 лет назад

      None are planned at the moment. What specifically are you struggling to do with nested loops?

    • @simplyboredable
      @simplyboredable 8 лет назад

      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.

    • @DrapsTV
      @DrapsTV  8 лет назад

      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?

    • @simplyboredable
      @simplyboredable 8 лет назад +1

      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.

  • @cherieann
    @cherieann 8 лет назад

    hi.. i'm getting "AttributeError ( type object 'Env' has no attribute 'addHotKey' )" ... what am i doing wrong?

    • @DrapsTV
      @DrapsTV  8 лет назад +1

      No capital K in addHotkey.

    • @cherieann
      @cherieann 8 лет назад

      oh geez. lol thanks!

  • @dieanshin1568
    @dieanshin1568 8 лет назад

    it's possible press any key (example: F) with sikuli?

    • @DrapsTV
      @DrapsTV  8 лет назад

      +Die You sure can simulate any keypresses!

    • @dieanshin1568
      @dieanshin1568 8 лет назад

      +DrapsTV how? sorry for stupid question

    • @DrapsTV
      @DrapsTV  8 лет назад

      +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. :)

  • @labsupri6681
    @labsupri6681 7 лет назад

    Is it possible to convert image to text, if there is text can i make sikulix turn it into text?

    • @DrapsTV
      @DrapsTV  7 лет назад +1

      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

    • @labsupri6681
      @labsupri6681 7 лет назад +1

      Oh my god dude, thanks :D

    • @labsupri6681
      @labsupri6681 7 лет назад

      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)
      "

    • @labsupri6681
      @labsupri6681 7 лет назад

      Sorry for bad code i'm quite new.

    • @DrapsTV
      @DrapsTV  7 лет назад

      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.

  • @karlhe-t5u
    @karlhe-t5u 9 лет назад +1

    so cool !

  • @sigel2685
    @sigel2685 8 лет назад

    Please help. What is the command tha skips errors.

    • @DrapsTV
      @DrapsTV  8 лет назад

      try:
      code to try
      except:
      code to do if it fails (Yous can just put a *pass* here)

    • @sigel2685
      @sigel2685 8 лет назад +1

      DrapsTV Thanks that helped me alot

  • @texatcj
    @texatcj 8 лет назад

    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.

    • @DrapsTV
      @DrapsTV  8 лет назад

      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.

    • @texatcj
      @texatcj 8 лет назад

      +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!

    • @DrapsTV
      @DrapsTV  8 лет назад

      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.

  • @FilipHasa
    @FilipHasa 7 лет назад

    Great tutorial. but how to start without IDE?

    • @FilipHasa
      @FilipHasa 7 лет назад

      just add -r file/folder to java command line

  • @gadam8494
    @gadam8494 9 лет назад

    can you make a Ruby tutorials like the Python one ,please?

    • @DrapsTV
      @DrapsTV  9 лет назад

      +G Adam I don't use Ruby very often. But I'll add it to the bottom of the todo list :)

    • @gadam8494
      @gadam8494 9 лет назад

      +DrapsTV that's fine, I mainly use python but ruby is for my pentest course, metasploit to be exact .

  • @sarahmargaret7181
    @sarahmargaret7181 8 лет назад

    +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!

    • @DrapsTV
      @DrapsTV  8 лет назад +1

      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

  • @MinghuiZhang1015
    @MinghuiZhang1015 9 лет назад +1

    So cool~

    • @DrapsTV
      @DrapsTV  9 лет назад

      Thanks! I'm glad you enjoyed it! :)

  • @FrozenShadoW918
    @FrozenShadoW918 7 лет назад

    Help me make one for star wars game, please!

  • @jinwoo3666
    @jinwoo3666 7 лет назад

    Could you make summoners war script

  • @jinwoo3666
    @jinwoo3666 7 лет назад

    Could you send me codes for games

  • @666og
    @666og 4 года назад

    this is needlessly complicated. trash.