testingautohotkey
Joined: 28 May 2008 Posts: 4
|
Posted: Sat Jul 19, 2008 5:05 am Post subject: Age of Conan Auto Combo Tutorial |
|
|
Ok.... I have been playing AoC a bit and stuffing about with auto combo macros.... if you are interested please read this thread. I make no promises that you will not get banned... so using them is up to you.. but as g13 keyboard macros are allowed I personally do not see how it would affect you.
Software you will need
Now I suck at writing FAQs so I hope i can get this to make sense. I will post some example code that works and then describe what is going on and then you will need to edit it to your own setups.
| Code: | #IfWinActive, Age of Conan ;only active script when Age of Conan is active window
;-----------------------------Cooldown Timers-------------------------------------------------------
;
; Use only simple key names. Avoid characters not valid in variable names.
SendButNotTooOften(key, frequency)
{
global
; If key has not been sent before
if (last_%key% = ""
; or has not been sent in the last %frequency% milliseconds...
|| A_TickCount-last_%key% > frequency)
{
Send %key%
last_%key% := A_TickCount
return true
}
return false
}
;----------------------------------End Cooldown Timers---------------------------------------------------
;
;------------------------------- START Hotkey Press Versions---------------------------------------------
;
~5:: ;Life Leech VI (Hotkey Click)
sleep 1200
send [
sleep 1100
send 3
sleep 900
send 2
return
~7:: ;Unhallowed Blight III (Hotkey Click + Cool Down Timers)
if (SendButNotTooOften("q", 35000)) ;cast touch of death
sleep 2000
sleep 1200
send 2
sleep 1100
send 1
sleep 900
send [
sleep 1500
send 3
sleep 100
if (SendButNotTooOften("z", 15000)) ;cast Rite of Blood
return
return
;-------------------------------END Hotkey Press Timers--------------------------------------------------
;
;-------------------------------START Mouse click Macros-------------------------------------------------
~LButton:: ;Life Leech VI (mouse click)
MouseGetPos, xpos, ypos
if (xpos>936 and xpos<961 and ypos>1015 and ypos<1040)
{
sleep 1200
send [
sleep 1100
send 3
sleep 900
send 2
}
Else If (xpos>1010 and xpos<1033 and ypos>1015 and ypos<1040) ;Unhallowed Blight III (Mouse Click)
{
if (SendButNotTooOften("q", 35000)) ;cast touch of death
sleep 2000
sleep 1200
send 2
sleep 1100
send 1
sleep 900
send [
sleep 1500
send 3
sleep 100
if (SendButNotTooOften("z", 15000)) ;cast Rite of Blood
return
return
}
;-------------------------------END Mouse Click Macros---------------------------------------------------------
; |
Yea i know it looks pretty complex spesh if you are not a coder... but you "should" just need to edit this to yur own needs and everything will work... I'll run you though all the code lines to explain what it is and how to edit it.....
Genral Code stuff you need to know and NOT change
1) Everything in a line after a ; is ignored, use it to add comment lines to make the code more readable.
2) #IfWinActive, Age of Conan - This line will make teh macro only run when the active window is Age of Conan... do not remove this line.
3) Cooldown Timers down to End Cooldown Timers - This bit of code handles the timing for all cooldowns you set up... so leave this code as it is.
Ok lets look at "HOTKEY PRESS Macros"
Ok Lets look at a specific Combo. In this cave LIFE LEECH V
The code reads as
| Code: | ~5:: ;Life Leech VI (Hotkey Click)
sleep 1200
send [
sleep 1100
send 3
sleep 900
send 2
return |
Now it works like this.... your abilities buttons are on your button bar... and in Age of Conan you press 5 to activate the Ability. This macro means that when you press 5 it will also follow with all the weapon strokes needed to finish the combo. (in my case i use [ and ] to activate the 2 weapons swings you get at lev 60 or what ever it was. So in my case the weapons swings are 1,2,3,[,]
The SLEEP command will pause the macro until for a certain period of time until the next command is sent. You may need to adjust these values to get your combos to work. So this code works like this..... The timing in AHK is in miliseconds.. so 1000 = 1 second.
Ok Lets look at a specific Combo witch is more complex. In this case Unhallowed Blight III
| Code: | ~7:: ;Unhallowed Blight III (Hotkey Click + Cool Down Timers)
if (SendButNotTooOften("q", 35000)) ;cast touch of death
sleep 2000
sleep 1200
send 2
sleep 1100
send 1
sleep 900
send [
sleep 1500
send 3
sleep 100
if (SendButNotTooOften("z", 15000)) ;cast Rite of Blood
return
return |
Now this combo works the same as the Life Leech Combo we have already looked at... BUT it has some extra tricky crap in it. Basically it utilises the TIMING code at the top of the script (the one i told you not to edit) So it works lexactly like the other version BUT this line of code needs to be set up for your own UI config in AoC.
if (SendButNotTooOften("q", 35000)) ;cast touch of death
sleep 2000
What this will do is send the "q" button at the start of teh macro (in mycase it is a +DMG buff to increase teh dmg of the combo) I have mapped the "q" button in the control options to this ability with is on my button bar. The code means that once "q" is sent by AHK, this line of code will be skipped for 35 seconds... so... if i pressed this combo a heap of times.. only "q" will be sent every 35 seconds (the leangth of the cooldown of this spell)
The Sleep 2000 after it will ALSO only send if teh "q" is sent... So adjust this timing to match the time it takes for the animation of the buff spell.
At the end of the combo it has another simular command that in my case triggers "Rite of Blood" witch will regen my stanima.... again it will only send every 15 seconds.
By setting this crap up it means that you cna run your combos as normal.. but when your cooldowns are ready it will auto cast them... for dmg increase, adding hots.. w/e
OK now the hard part - Left click combo activation
Now this is a bit more of a headache to set up but once again I have done the code for you and you just need to edit it ot your own needs.... lets look at the code for leftmouse click.
| Code: | ~LButton:: ;Life Leech VI (mouse click)
MouseGetPos, xpos, ypos
if (xpos>936 and xpos<961 and ypos>1015 and ypos<1040)
{
sleep 1200
send [
sleep 1100
send 3
sleep 900
send 2
}
Else If (xpos>1010 and xpos<1033 and ypos>1015 and ypos<1040) ;Unhallowed Blight III (Mouse Click)
{
if (SendButNotTooOften("q", 35000)) ;cast touch of death
sleep 2000
sleep 1200
send 2
sleep 1100
send 1
sleep 900
send [
sleep 1500
send 3
sleep 100
if (SendButNotTooOften("z", 15000)) ;cast Rite of Blood
return
return
} |
Basicaly it is exactly the same as the hotkey press version but the macro will trigger by uising the LEFTMOUSE click on your screen, instead of the button 5, or 7, (as per the above examples)
The key to this code is this line here
If (xpos>1010 and xpos<1033 and ypos>1015 and ypos<1040)
What this line is doing is saying that if the user clicks the mouse at a certian x.y positon on the screen to activate the combo.. alla the other examples. All you need to do is change the x,y cords to match your button positions on your screen
How do i do that? Well you do it like this....
When you install AHK a little app will also be in the startmenu under autohotkey called "autoit3 Window Spy" run this app. It will look something like this...
Now the bit we need to look at is the "ON SCREEN MOUSE POSITION" data. Once you have the game running and the SPY running moving teh mouse about will change these values.
What you need to do is find the cords for the TOP LEFT of the icon and the BOTTOM RIGHT of the icon. This means that the macro recognises a area of the screen to activate the macro... so clickign anywhere on your button will activate it.
If (xpos>1010 and xpos<1033 and ypos>1015 and ypos<1040)
So.. when getting the cords... put the x,y of the TOP LEFT in the RED area and the BOTTOM RIGHT in the BLUE area.
That is it you should be done... you add more LEFT CLICK positions for other areans (eg other buttons) by adding the ELSE function.
eg:-
| Code: | ~LButton:: ;Life Leech VI (mouse click)
MouseGetPos, xpos, ypos
if (xpos>936 and xpos<961 and ypos>1015 and ypos<1040)
{
sleep 1200
send [
sleep 1100
send 3
sleep 900
send 2
}
Else If (xpos>[different] and xpos<[different] and ypos>[different] and ypos<[different])
{
Sleep
send
;etc..
}
Else If (xpos>[different] and xpos<[different] and ypos>[different] and ypos<[different])
{
Sleep
send
;etc..
}
return |
Hope this help... like i siad it is a bit complex at first look but it really isn't..... you should be able to just edit the code i posted at the start and everythign will work
Have fun Guys....
Thanks to INFOGULCH and LEXIKOS and COMBER for there help...... |
|