Ranger archery macro

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Cybmax
a lesser mummy
a lesser mummy
Posts: 54
Joined: Wed Jul 28, 2004 1:55 pm

Ranger archery macro

Post by Cybmax » Wed Jul 28, 2004 2:08 pm

I found a couple of ranger macro's, but they seemed very complicated to me tho.. I dont want to autostart archery when i assist, nor do i want to automate snare or whatnot..

Reason i would like to use a macro for ranged attack is that i do not have to run a joystick autofire or proggy to do it, wich i need to adjust each time i switch bows/haste to adapt to the bow delay..

So.. I found a couple of snippets i am currently using..

This is for autokicking while attacking :

--
Sub Main
/echo Auto-Kicking while Attacking
/declare fsTimer timer local 0s

:WaitLoop
/if (!${Me.Combat}) {
/echo Waiting for another fight...
/delay 60s ${Me.Combat}
/goto :WaitLoop
}

/echo Fighting -- ${Target.CleanName}
:CombatLoop
/if (${Me.Combat}) {
/delay 10s ${Me.AbilityReady["Kick"]}
/if (${Me.AbilityReady["Kick"]} && !${Me.Casting.ID} && !${Me.Stunned} && ${Target.ID}) {
/doability "Kick"
}
}
/if (${Me.Combat}) /goto :CombatLoop
/goto :WaitLoop
/return

--
I modified this to stop spamming if i am stunned..

So.. if i somehow could combine this with a archery macro.. i experimented with something like this :

--
/if (${Me.RangedReady} && !${Me.Casting.ID} && ${Target.Type.NotEqual[PC]} && !${Target.Type.Equal[Corpse]})
{
/Ranged
}
--

But needless to say.. im a total noobie when it comes to progging this, so if someone have any ideas how to combine the auto-kick macro with a working archery.. id be forever grateful..
I would want this to happen :

If i melee and turn on auto-attack (the regular way), it should autokick as the first macro does..
If i decide to do archery, i want to start and stop the archery bit by pressing a key.. Eg. If i press the key "P" on my keyboard, this turns off melee attack, and turn on archery. If mob dies, archery turn off automatically. If i press "P" again, archery is turned off. If i turn on melee attack, archery is turned off.

Dont want automated movement or forage/snare++.. just want the nifty features of archery fired whenever Me.RangedReady occurr.. (Thus no need to fiddle with different delays on my joystick autofire)

Ideas?

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Wed Jul 28, 2004 2:35 pm

Why didn't you just post help in the topic that you got my simple code from?

Cybmax
a lesser mummy
a lesser mummy
Posts: 54
Joined: Wed Jul 28, 2004 1:55 pm

Post by Cybmax » Wed Jul 28, 2004 4:29 pm

Why didn't you just post help in the topic that you got my simple code from?
Sorry if i posted wrong. Just thought this would be a "new" function, and not a modification to the kick function.

Cybmax
a lesser mummy
a lesser mummy
Posts: 54
Joined: Wed Jul 28, 2004 1:55 pm

Post by Cybmax » Thu Jul 29, 2004 4:27 pm

Oki.. so far ive come up with this ..

--
#turbo
#event eToggleArchery "#*#Auto-Archery#*#"

Sub Main
/declare vArcheryToggle outer 0
/declare fsTimer timer local 0s
/varset vArcheryToggle 0
/echo Ranger Assistant Started

:MainLoop
/if (${vArcheryToggle}==1) {
/if (${Me.Combat}) /attack off
/if (${Me.RangedReady} && !${Me.Casting.ID} && ${Target.Type.Equal[NPC]}) /ranged
}

:CombatLoop
/if (${Me.Combat}) {
/delay 10s ${Me.AbilityReady["Kick"]}
/if (${Me.AbilityReady["Kick"]} && !${Me.Casting.ID} && !${Me.Stunned} && ${Target.Type.Equal[NPC]}) {
/doability "Kick"
/varset vArcheryToggle 0
}
}
/doevents
/if (${Me.Combat}) /goto :CombatLoop
/goto :MainLoop
/return

Sub Event_eToggleArchery
/if (${vArcheryToggle}!=1) {
/varset vArcheryToggle 1
/echo ON
} else {
/varset vArcheryToggle 0
/echo OFF
}
/return

--

I am thinking of figuring out how to somehow pause the ranged attack if i am too close, too far away or cannot see the target.. hmm