Jump to content
Sign in to follow this  
Reskal

3 commands needed

Recommended Posts

Reskal

Hello all,

yesterday i downloaded AutoIt 3 for use in a online-game named Wurm Online. Mining there is pretty boring but necessary. I've done the "corpse" so far, here it is:

MouseMove(300, 400, 10);moving mouse to position

MouseClick("right"); opening little menu

MouseMove(315, 400, 10); moving mouse to position in menu

MouseMove(315, 465, 10); moving mouse to position in menu

MouseMove(390, 465, 10); moving mouse to position in menu

MouseClick("left"); starting to mine, takes 31 seconds.

Sleep(32000); waiting for mining to finish

I have searched in the help-window for a sort of repeat-command, just found _RepeatString, but im not sure if its right, it seems its only for words, not for commands. Not sure indeed. Looking for the right command to repeat the whole above.

2. How can i set up a hotkey(or hotkeys) for beginning and stopping the macro then ?

If possible and if not too much work, would be great if someone could enter the missing commandlines im not able to. I wouldnt care also what hotkeys i get for start and stop of the macro, main thing is i dont have to stare all the time on the mining-event until finished :D

Share this post


Link to post
Share on other sites
Hawkwing

Look at While...Wend loop and hotkeyset in the help file.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites
AlmarM

Mayby this is what you are looking for? :D

HotKeySet("{ESC}", "_Exit") ; Make a hotkey to exit the script
; Very important when u are using MouseMove, MouseClick etc. in a loop

HotKeySet("{YourKeyHere}", "_Mine") ; Look at the Send command in the help file for keys

Global $Mine = False ; Here we say $Mine = false, so the bot has stopped as default

While 1
    Sleep(1000) ; Use a sleep in the main loop for not getting a high CPU
WEnd

Func _Mine()
    $Mine = Not $Mine   ; It's basicly something like: If $Mine = False Then $Mine = True
                ; Also visa versa

    While $Mine
        MouseMove(300, 400, 10);moving mouse to position
        MouseClick("right"); opening little menu
        MouseMove(315, 400, 10); moving mouse to position in menu
        MouseMove(315, 465, 10); moving mouse to position in menu
        MouseMove(390, 465, 10); moving mouse to position in menu
        MouseClick("left"); starting to mine, takes 31 seconds.
        Sleep(32000); waiting for mining to finish
    WEnd
EndFunc

Func _Exit()
    Exit
EndFunc
Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
Reskal

Mayby this is what you are looking for? :D

Well i typed into the editor what you suggested here, nearly understanding nothing but i was in good hope :D

And it works properly and wonderful. Nearly a whole night i was searching for a macro program helping me in this but all the recorders i did not understand or they didn't work. I knew AutoIt is great, because we used it in Atitd(Tales of egyptian nights) before and there i were surprised how intelligent those macros can be(in the opposite to me when it comes to scripts and programming : )

So a big thanks for the small program AlmarM, you wrote :huggles:

and a big thanks to AutoIt also to provide such a wonderful piece of software !

Share this post


Link to post
Share on other sites
AlmarM

Well i typed into the editor what you suggested here, nearly understanding nothing but i was in good hope :D

And it works properly and wonderful. Nearly a whole night i was searching for a macro program helping me in this but all the recorders i did not understand or they didn't work. I knew AutoIt is great, because we used it in Atitd(Tales of egyptian nights) before and there i were surprised how intelligent those macros can be(in the opposite to me when it comes to scripts and programming :huggles: )

So a big thanks for the small program AlmarM, you wrote :D

and a big thanks to AutoIt also to provide such a wonderful piece of software !

Nooo problem at aalll~ :

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
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
Sign in to follow this  

×