taultunleashed
http://www.taultunleashed.com/phpbb3/

Hotkey Macro Tutorial
http://www.taultunleashed.com/guild-wars-submissions/hotkey-macro-tutorial-t49945.html
Page 1 of 1

Author:  dlm_bittersweet [ June 23rd, 2007, 6:32 pm ]
Post subject:  Hotkey Macro Tutorial

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;

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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


(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
   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?


(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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.



(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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:


(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
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!

Author:  Tault_admin [ June 24th, 2007, 1:35 pm ]
Post subject: 

Can premium members say yay or nay to this being moved to a confirmed section.

Author:  cain66641 [ July 22nd, 2007, 6:44 am ]
Post subject: 

Found this to be a well written and helpful guide, I think this deserves a yay

Author:  Tault_admin [ July 23rd, 2007, 6:48 am ]
Post subject: 

1 yays 2 more to move to confirmed
0 nays 3 more to lock this topic

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/