Post Reply Home » Forums » Guild Wars » GW Submissions

Hotkey Macro Tutorial : GW Submissions

Posted: June 23rd, 2007
dlm_bittersweet
Note: you need Autoit v3 to run this

This is an example of how to set hotkeys for skill chaining in Autoit; It can be applied to just about anything you need,
and it's easy to set up.
Tutorial Created by DLM_Bittersweet

Setting a hotkey is easy with Autoit, simply use this function;

Code: Select all

HotKeySet("{NUMPAD1}", "Skillchain1")
HotKeySet("{NUMPAD2}", "Skillchain2")
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet(" key", "function to run")

As you can see with the top three, I used the numpad to define my hotkeys, since I rarely use it otherwise, and I used escape and pause for two other functions I'll cover.

This is a basic "pause" function, it's included in the help, and can be very useful if you plan on minimizing your game and need to use the reserved hot keys

Code: Select all

Global $Paused
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc
This is the basic "kill" function in the help file

Code: Select all

Func Terminate()
    Exit 0
EndFunc


Why don't we pretend we have a skill chain that includes 2 skills, that need to be activated about a 1/2 second apart.
First, define the function

Code: Select all

Func Skillchain1()
Now, add in the buttons you press to activate those skills using the
send" command. Between the two send commands, add in a "sleep" command for 500

Code: Select all

	Send("{2}")
	Sleep(500)
	Send("{6}")
EndFunc

Now, yours probably won't look the same as mine, but this is just an example. To make things even better, we can put a function in a function. it's pretty easy to see the exact 1/2 second pause each time, so why don't we mix things up a bit?

Code: Select all

Func Skillchain1()
	Send("{2}")
	Sleep(Random(400,600))
	Send("{6}")
EndFunc


See, that adds in a Random() function, so it will choose a random number between 4/10 of a second and 6/10 of a second to sleep before it sends the next key. Making it less likely that they will see you as a "botter", even though they probably wouldn't kill you for this. ;-)

Lets say that our next skill combo requires you to use three skills, the principle is the same. use the Send() function and Sleep() to create the best timing for your skills, and it'll be perfect every time.


Code: Select all

Func Skillchain2()
	Send("{5}")
	Sleep(Random(2100,2300))
	Send("{2}")
	Sleep(Random(1500,1750))
	Send("{1}")
EndFunc


Remember that when using Sleep, it's measured in 1/1000 of a second, thus 1000 is 1 second, 500 is 1/2 of a second, so on and so forth.
So really, fairly simple so far.
Now, just one more thing, this function needs something to run while it's waiting for the hotkeys, otherwise it'll just close. So use this function:

Code: Select all

While 1
	Sleep(100)
WEnd
That activates an infinite loop, that will just sit there and wait until you close it yourself with the handy "terminate" function and hotkey we have. Take, and rewrite the function to reflect your own skill-chaining needs, then run the script and use your new hotkeys to pwn your enemies with perfect timing!


Last edited by Guest on July 15th, 2007, 10:33 am, edited 2 times in total.
Posted: June 24th, 2007
User avatar
administrator
Total Posts:29918 Joined:2002
Can premium members say yay or nay to this being moved to a confirmed section.
Posted: July 22nd, 2007
User avatar
Total Posts:81 Joined:2007
Found this to be a well written and helpful guide, I think this deserves a yay
Posted: July 23rd, 2007
User avatar
administrator
Total Posts:29918 Joined:2002
1 yays 2 more to move to confirmed
0 nays 3 more to lock this topic
Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 17 guests
Post Reply