Jump to content

Automation Help


Recommended Posts

Im working on an Automation "Bot" that preforms simple task within a game while i am away from the keyboard. Is it possible for AutoIt to detect In-Game Windows/Buttons and can you assign variables to them. If there is a way to make the buttons detectable on pop-u, and there is a way to detect them any information you can share with me will be of great help.

If it is possible to detect these buttons is there a way to completely pause the script until they are detected?

I AutoIt has color/pixel detection which i have no experience with myself, and to my understanding it is not very reliable.

I can post my script if needed, however it is basically just a bunch of mouse moves/ clicks that are constantly following a cycle...even when the buttons do not exist the mouse still does its thing and i am looking for a more reliable...Easier to use solution.

Many more questions to come, lets see if this one can be answered for now though. :)

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

A way autoit can detect things is with a pixel search so you could define the pixel search to happen in a certain area and make whatever your looking for become a variable to use once its spotted

Pixelsearch() use in help file it will bring up specifics.

could you post entire script so i can work with it and what game are you using it for that will help alot???

Edited by TnTProductions

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Link to comment
Share on other sites

It is for World of Warcraft :) The script...is as follows it Queues for Battlegrounds and Enters, and will keep queuing. I was just toying with autoit and thought this would be a fun challenge. Ill look in the help file and see what i can come up with.

The "buttons" if your familiar with the game at all are the right click on the NPC, the "Join Battleground" Button and then once the queue is up, the "Enter Battle Ground Button". In the end i would also like the "Exit BattleGround" Button.

I have no GUI and im just using hotkeys for now to keep it simple.

HotKeySet("{F9}", "start")

HotKeySet("{F10}", "stop")

AutoItSetOption("WinTitleMatchMode", 4)

While 1

Sleep(1000)

WEnd

Func start()
   Global $Show = 0
   Global $handle = WinGetHandle("classname=GxWindowClassD3d")
   WinSetState($handle, "", @SW_SHOW)
   WinSetState($handle, "", @SW_SHOWMAXIMIZED)
   If @error Then
      MsgBox(0, "error", "couldnt find WoW")
   Else
      While 1
            WinSetState($handle, "", @SW_SHOW)
            WinSetState($handle, "", @SW_SHOWMAXIMIZED)
            ControlSend($handle, "", "", "{1}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{2}")
            MouseClick("Right", 652, 421, 1, 0)
            Sleep(5000 + Random(1, 50, 1))
            MouseClick("Left", 314, 532, 1, 0)
            Sleep(10000 + Random(1, 50, 1))
            MouseClick("Left", 557, 206, 1, 0)
            Sleep(5000 + Random(1, 50, 1))
            Sleep(30000 + Random(1, 30, 1))
            MouseClick("Left", 642, 196, 1, 0)
            SLeep(5000 + Random(1, 50, 1))
            Mouseclick("Left", 680, 561, 0)
            Sleep(20000 + Random(5000, 1500, 1))
         If $Show > 0 Then ExitLoop
      WEnd
   EndIf
EndFunc   

Func stop()
   Global $Show = 1
   WinSetState("World of Warcraft", "", @SW_SHOW)
   WinSetState("World of Warcraft", "", @SW_MAXIMIZE)
   WinActivate($handle, "")
EndFunc

It is very simple and as before stated, just follows the click sequence until the "Stop" Function is activated, thank you for any help you can supply.

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

It can not detect in game buttons. Pixelsearch would be your best bet.

do
            $i = 0
      $vary2 = inputbox("Color", "What is the color?","","")
      
      $i = $i + 1
       
    Until $i = 1


              Sleep("3000")
              $coord = PixelSearch(0, 0, 1279, 1023, $vary2)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, $vary2)
              EndIf
          Until Not @error
          $arr[0][$i] = $coord[0]
          $arr[1][$i] = $coord[1]
          Sleep("70")
          MouseMove($coord[0], $coord[1])
          Sleep("20")
          MouseDown("left")
          Sleep("100")
          MouseUp("left")

that's a very basic autofighter, I don't know if that would work on Wow necessarily though, but it's a base you can use at least.

Edited by Muchuchu
Link to comment
Share on other sites

Can

PixelChecksum
be used to search for changes in a specified area, and on finding a change, can you tell it to do X action?

This is what i understand it as from the help file point of view, but im not exactly sure nor am i sure how to tell it what to do.

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

It indeed can search to see if a change has occurred in a specified area that you can choose, BUT:

Remarks

A checksum only allows you to see if "something" has changed in a region - it does not tell you exactly what has changed.

So no it can't find the change, which is why pixelsearch is more useful.

Link to comment
Share on other sites

Thanks again :)

For Pixel Search, if it finds the pixel is there a command to "click" the pixel?

Something like this i presume:

$Button = PixelSearch(180, 510, 328, 550, 0x6a0706, 10)
    If Not @error Then
    MouseClick("Left", $Button[0], $Button[1])

Your being of great help :) thanks for everything.

Edited by Rydextillxixdiex

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...