How-To: Build A Custom Macro.

06/02/2006 21:52 N3W8Y#1
Ok this guide is for all the newbs that wanna learn some basic macroing. Maybe help you to contribute to the ePvP community. Enjoy :)

First go here: [Only registered and activated users can see links. Click Here To Register...] and download and install AutoHotKey.

To create a script, just use notepad to enter the code and save it as *.ahk.

To compile a script, just right click on it and 'Compile Script", this will turn your script into an Application.

There is also a command line option (Start-->Run) which allows you to embed an icon. It goes like this: ahk2exe.exe /in CObuddy.ahk /out CObuddy.exe /icon buddy.ico Make sure Ahk2e.exe, upx.exe, and AutoHotkeySC.bin are in the same directory the script is in.

To embed files within the EXE, use this command at the start of the script, they will extract when the application is run. FileInstall, SmokinAli3N.jpg, SmokinAli3N.jpg, 1 Again it's best to copy the files to the same directory the script is in. Or include the full path.

************************************************** ***************

Here's some common commands you'll use all the time:

***Mouse Click***

MouseClick [, WhichButton , X, Y, ClickCount, Speed, D|U, R]



Parameters

WhichButton The button to click: Left, Right, Middle (or just the first letter of each of these); or the fourth or fifth mouse button (X1 or X2), which is supported on Windows 2000/XP or later. For example: MouseClick, X1. In v1.0.30+, this parameter may be omitted, in which case it defaults to Left.

Rotate the mouse wheel: On Windows NT/2000/XP or later, specify WheelUp or WU to turn the wheel upward (away from you); specify WheelDown or WD to turn the wheel downward (toward you). In this case, ClickCount is the number of notches to turn the wheel.

X, Y The x/y coordinates to move the mouse to, prior to clicking, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that. If omitted, the cursor's current position is used.
ClickCount The number of times to click the mouse, which can be an expression. If omitted, the button is clicked once.
Speed The speed to move the mouse in the range 0 (fastest) to 100 (slowest), which can be an expression. Note: a speed of 0 will move the mouse instantly. If omitted, the default speed (as set by SetDefaultMouseSpeed or 2 otherwise) will be used.
D|U If this parameter is omitted, each click will consist of a "down" event followed by an "up" event. Alternatively:
D = Press the mouse button down but do not release it (i.e. generate a down-event).
U = Release the mouse button (i.e. generate an up-event).

R If this parameter is the letter R, the X and Y coordinates will be treated as offsets from the current mouse position. In other words, the cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative).

************************************************** ***************

***Loop***

Loop [, Count]



Parameters

Count How many times (iterations) to perform the loop. If omitted or blank, the Loop is infinite (i.e. until a break or return is encountered). Unlike Repeat...EndRepeat, if Count is 0, zero iterations will be performed rather than an infinite number.

Due to the need to support file-pattern loops, Count must not be an expression. However, it can be a variable reference such as %ItemCount%.

************************************************** ***************

***Sleep***

Sleep, Delay



Parameters

Delay The amount of time to pause (in milliseconds) between 0 and 2147483647 (24 days), which can be an expression.

************************************************** ***************

Those 3 commands will allow you to build a custom macro for lvling ANY skill.

AutoHotKey includes an excellent Help File:

[Only registered and activated users can see links. Click Here To Register...]

Well that should be enuff to get you started. If you have any questions about how to perform certain tasks or how to run commands, please post here and don't PM me.

************************************************** ***************

Example Script:

This will hold Ctrl down and right click continuosly. It will pause if "s" is pressed and exit if "x" is pressed.

Loop
{

GetKeyState, state, s
if state = D ; The key has been released, so break out of the loop.
MsgBox Basi AutoClicker Paused! Click OK to resume...

GetKeyState, state, x
if state = D ; The key has been released, so break out of the loop.
break

Send, {CTRLDOWN}
MouseClick, right
MouseClick, right
MouseClick, right
MouseClick, right
Send, {CTRLUP}


}


Enjoy :)
06/02/2006 22:31 hemp#2
this is very helpfull man thanks +karma
06/02/2006 23:02 Birchy87#3
With guides in mind; is there a guide or anything that will help me create my own Speedhacks? ie. Chris' free trial is good, but keyword here, trial.

I would like to know where to find these applications you use to create these such programs, if I may.
06/02/2006 23:20 N3W8Y#4
Quote:
Originally posted by Birchy87@Jun 2 2006, 17:02
With guides in mind; is there a guide or anything that will help me create my own Speedhacks? ie. Chris' free trial is good, but keyword here, trial.

I would like to know where to find these applications you use to create these such programs, if I may.
You would use C+, Delphi, VB, etc...these are NOT basic. You can find HUGE amounts of guides, etc on the net for any of these languages. They are too advanced for someone to just write a tutorial on them.

Coder62 has this: [Only registered and activated users can see links. Click Here To Register...] it may help ya.

Hope this helps :)
06/02/2006 23:33 n00by#5
thanks for this. time to start not being a noob :P
06/02/2006 23:39 fuct#6
man i should try to make a copartner, i spent 3 years in school using visual basics.... i think i could do it
06/03/2006 06:44 N3W8Y#7
Quote:
Originally posted by fuct@Jun 2 2006, 17:39
man i should try to make a copartner, i spent 3 years in school using visual basics.... i think i could do it
lol nice
06/03/2006 08:05 pegazzos#8
yo !! make a macro... ppl are dying to lvvl on CO !! plz PVPERS !!
06/04/2006 05:14 spurginwinn#9
Wow, very cool. Thank you for all your help. I believe this will allow pretty much anyone to create their own macro and set them off to create just about any program. Thanks again. Maybe I won't be a total noob anymore.

EDIT: WHOA!!! Don't know how this happend, made my macro right click, sit, than meditate in a constant loop and in like 10 seconds each time my xp bar was full! I have no idea if I screwed with the server or if it was client sided or if I'm just a total noob. Either way it freaked me out. If anyone can shed light please tell me!
06/04/2006 08:52 N3W8Y#10
Quote:
Originally posted by spurginwinn@Jun 3 2006, 23:14
Wow, very cool. Thank you for all your help. I believe this will allow pretty much anyone to create their own macro and set them off to create just about any program. Thanks again. Maybe I won't be a total noob anymore.

EDIT: WHOA!!! Don't know how this happend, made my macro right click, sit, than meditate in a constant loop and in like 10 seconds each time my xp bar was full! I have no idea if I screwed with the server or if it was client sided or if I'm just a total noob. Either way it freaked me out. If anyone can shed light please tell me!
Have you been able to reproduce these results again? Prolly just client sided...
06/08/2006 06:29 Phate99#11
wow thanks for that stuff! I just made a bot to log me back in when I get disconnected, now I can use it in conjunction with mad's miner and I'm set thanks man!

:D

EDIT: oh, cool I was able to +k you wasnt sure I could :D
06/08/2006 06:51 N3W8Y#12
Quote:
Originally posted by Phate99@Jun 8 2006, 00:29
wow thanks for that stuff! I just made a bot to log me back in when I get disconnected, now I can use it in conjunction with mad's miner and I'm set thanks man!

:D

EDIT: oh, cool I was able to +k you wasnt sure I could :D
lol thanks
06/08/2006 08:03 soemaal#13
yes awsome i can start creating some macro's now :D

+1 k for yo
06/08/2006 18:01 hax0rzz#14
very nice +karma
06/08/2006 20:15 Susi>_>#15
i love N3W8Y =o))