autofire request

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

ubernoober91
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Oct 07, 2012 10:00 pm

autofire request

Post by ubernoober91 » Sun Oct 07, 2012 10:07 pm

LF a simple macro that will assist set target n turn toward mob n autofire. dont need to move, dont need to cast just assist,turn and fire. please help

ubernoober91
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Oct 07, 2012 10:00 pm

Re: autofire request

Post by ubernoober91 » Sun Oct 07, 2012 10:16 pm

i have this macro here, but i dont want it melee just ranged but i like the idea of being able to type /assist soandso 98 in game so i dont have to go in and set peoples names in the .mac itself

|Simple Assist Macro v2.0
|Ripped from Various Macro's
|By HardOne
|Edited by Liaohowie 2009.07.28

#event ImDead "#*#You have been slain by#*#"
#event ImDead "Returning to home point, please wait..."
#event ImDead "#*#Returning to Bind Location#*#"

Sub Main
|SYSTEM VARS - DO NOT MODIFY.
/declare maintank string outer ${Param0}
/declare attackat int outer ${Param1}
/declare attackid int outer
/declare RT_MyXLOC int outer ${Me.X}
/declare RT_MyyLOC int outer ${Me.Y}
/declare MyHeading int outer ${Me.Heading.DegreesCCW}
/declare Camp_Zone int outer ${Zone.ID}

/if (!${Param0.Length} && !${Param1.Length}) {
/echo You must start the macro including the main assist's name and the percent to attack after.
/echo i.e.:
/echo /mac assist Ubertank 90
/end
}

/echo AFK AssistTank Running. Assisting ${Param0} at ${Param1}%
/echo Camp Set to: ${Me.X} ${Me.Y}, Facing: ${Me.Heading.DegreesCCW} in ${Zone}
/echo Ensuring MQ2Melee is loaded
/plugin mq2melee
/delay 2s
/squelch /target clear
/squelch /assist off


:mainloop
/if (!${SpawnCount[${maintank}]}) {
/echo Maintank Dead/Missing. Delaying 30 seconds and restarting.
/delay 30s
/goto :mainloop
}
/assist ${maintank}
/delay 5
/if (!${Target.ID} || !${Target.Type.Equal[NPC]}) /goto :mainloop
/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}<${attackat}) /call Attacking
/doevents
/goto :mainloop
/end

Sub Attacking
/echo Attacking ${Target.CleanName}!
/varset attackid ${Target.ID}

:attackloop
/if (!${Target.ID}) /goto :endcombat
/if (${Target.ID}!=${attackid}) /goto :newtarget
/if (!${Me.Combat}) /attack on
/doevents
/goto :attackloop


:newtarget
/echo Somehow got new target. Re-assisting maintank.
/squelch /target clear
:endcombat
/varset attackid 0
/delay 2s
/if (${Camp_Zone} == ${Zone.ID} && !${Me.CombatState.Equal[COMBAT]}) /call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
/face fast heading ${MyHeading}
/return

Sub MoveToLoc(MoveToY, MoveToX)
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/declare distanceTimer timer 15
/varset running 0
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/echo Moving to Location: ${MoveToY}, ${MoveToX}.
/echo Distance: ${distanceBefore}
:moveToLocation
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/call HitObstacle
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) {
/varset running 0
/keypress forward
}
}
/goto :moveToLocation
/return

Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return

Sub Event_ImDead
/doevents
/if (${Stick.Status.Equal[ON]}) /squelch /stick off
/keypress forward
/keypress back
/keypress Left
/keypress Right
/delay 2s
/echo I've been Killed! Going into Sleep Mode...
/beep
/beep
:DeathSleep
/doevents
/delay 5s
/if (${Me.State.Equal[HOVER]} || ${Zone.ID} != ${Camp_Zone}) /goto :DeathSleep
/return

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: autofire request

Post by dewey2461 » Sun Oct 07, 2012 11:01 pm

Should use the "code" block to keep your formatting when you post

ubernoober91
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Oct 07, 2012 10:00 pm

Re: autofire request

Post by ubernoober91 » Mon Oct 08, 2012 3:36 pm

what happened to the dewey4321 site?

vsab
a hill giant
a hill giant
Posts: 151
Joined: Fri Nov 04, 2005 7:40 am

Re: autofire request

Post by vsab » Tue Oct 09, 2012 5:33 am

That code basically does what you want, but uses mq2melee (and mq2moveutils) to do the movement, which you don't require (or at least as much if you pin your mobs well) for ranged dps. Below should basically work but it's not tested. What it won't deal with is if the mob moves significantly in terms of range or direction. To be honest with such simple requirements, I'd just alt tab and do it with a legit "social" hotkey.

Code: Select all

/assist Bob
/pause 10
/autofire on
If you want more functionality I'd suggest getting VIP access and using MQ2Melee... personally I don't think I'd play EQ without it! Then you could play with modbot/autobot or any of the other VIP macro's that would allow you to do debuffs, nukes, dots and so on.

Code: Select all

|Simple Assist Macro v2.1
|Ripped from Various Macro's
|By HardOne 
|Edited by Liaohowie 2009.07.28
|Edited by vsab 09/10/2012 *UNTESTED*

#event ImDead "#*#You have been slain by#*#"
#event ImDead "Returning to home point, please wait..."
#event ImDead "#*#Returning to Bind Location#*#"

Sub Main
 |SYSTEM VARS - DO NOT MODIFY.
 |vsab-oops I modified it
 /declare maintank string outer ${Param0}
 /declare attackat int outer ${Param1}
 /declare attackid int outer
 /declare Camp_Zone int outer ${Zone.ID}

 /if (!${Param0.Length} && !${Param1.Length}) {
 /echo You must start the macro including the main assist's name and the percent to attack after.
 /echo i.e.:
 /echo /mac assist Ubertank 90
 /end
 }
 
 /echo AFK AssistTank Running. Assisting ${Param0} at ${Param1}%
 /delay 2s
 /squelch /target clear
 /squelch /assist off

 :mainloop
 /if (!${SpawnCount[${maintank}]}) {
 /echo Maintank Dead/Missing. Delaying 30 seconds and restarting.
 /delay 30s
 /goto :mainloop
 }
 /assist ${maintank}
 /delay 1s
 /if (!${Target.ID} || !${Target.Type.Equal[NPC]}) /goto :mainloop
 /if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}<${attackat}) /call Attacking
 /doevents
 /goto :mainloop
 /end

Sub Attacking
 /echo Attacking ${Target.CleanName}!
 /varset attackid ${Target.ID}

 :attackloop
 /if (!${Target.ID}) /goto :endcombat
 /if (${Target.ID}!=${attackid}) /goto :newtarget
 /if (!${Me.Combat}) { 
        /face fast
        /delay 5 
        /autofire on
}
 /doevents
 /goto :attackloop

 :newtarget
 /echo Somehow got new target. Re-assisting maintank.
 /squelch /target clear
 :endcombat
 /varset attackid 0
 /delay 2s

/return

Sub Event_ImDead
 /doevents
 /keypress forward
 /keypress back
 /keypress Left
 /keypress Right
 /delay 2s
 /echo I've been Killed! Going into Sleep Mode...
 /beep
 /beep
:deathSleep
 /doevents
 /delay 5s
 /if (${Me.State.Equal[HOVER]} || ${Zone.ID} != ${Camp_Zone}) /goto :deathSleep
/return

Maskoi

Re: autofire request

Post by Maskoi » Tue Oct 09, 2012 10:05 am

There is no

Code: Select all

/autofire on
/autofire off
its a toggle and just

Code: Select all

/autofire
If you had auto fire off /autofire off would turn it on because EQ doesn't recognize on or off