ok what im trying to do is take a part out of a macro that someone made already, i'm using chant.mac. when it kills a mob, it checks for agroed mobs to target next.
what happens alot of time, is if i have a bunch of junk on me, it will sometimes turn towards the mobs on tail and target something, and cuase me to get hit, then i have to fade and start over. OR sometimes i will have a few mobs on me and it won't target anything even though i have stuff in trail.
so what i want to do is, just take all the code out for trying to figure out what to target next, and just use this snippet for targeting instead, since i know what is on me already, and don't need to turn around to see what it is, i want to prevent having to fade when it decides to turn back on itself.
here is the section of the code (i think) that i want to replace with this snippet....
Code: Select all
/if (${Target.ID}) {
/varset CirX ${AnchorY}
/varset CirY ${AnchorX}
} else {
/if (${TargetUpNext}!=0) {
/varset CirX ${AnchorY}
/varset CirY ${AnchorX}
/if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) {
/if (${Target.ID}) {
/if (${Target.ID}!=${TargetUpNext}) {
/target id ${TargetUpNext}
}
} else {
/target id ${TargetUpNext}
}
/varset TargetUpNext 0
}
}
}
/if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) {
/face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]}
} else {
/face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]}]}
}
/return
Sub SongFailed
/if (!${PrevSong}) {
/varset SongTimer 1
/return
}
/varset CurSong ${PrevSong}
/varset SongTimer 1
/return
Sub Event_NeedTarget
/if (${TargetUpNext}<=0) /call GetTarget
/return
Sub Event_Died
/delay 20
/sit
/delay 20
/camp desktop
/return
Sub Event_Exp
/varset AAExp ${Math.Calc[${Me.AAExp}-${AAExp}]}
/varset Exper ${Math.Calc[${Me.Exp}-${Exper}]}
/echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.AAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes
/varset Exper ${Me.Exp}
/varset AAExp ${Me.AAExp}
/if (${TargetUpNext}==0) /if (${Target.ID}==0) /call GetTarget
/return
Sub GetTarget
/declare LastMobID int local 0
/declare FirstMobID int local 0
/declare MobID int local 0
/declare SRadius int local
/varset MobID ${Spawn[npc radius ${Math.Calc[${CirR}*2]}].ID}
/varset FirstMobID ${MobID}
/echo MobID ${MobID}
:CheckAggrodMobs
/if (${MobID}!=0) {
/if (${Spawn[ID ${MobID}].Speed}>100) {
/call AvoidTargets ${MobID}
/if (${Macro.Return}==1) {
/target id ${MobID}
/echo Kiting aggro'd mob: ${Target.CleanName}
/return
}
}
/varset LastMobID ${MobID}
/varset MobID ${Spawn[npc id ${LastMobID} radius ${Math.Calc[${CirR}*2]} next].ID}
/if (${FirstMobID}==${MobID}) {
/goto :NoAggrodMobs
}
/goto :CheckAggrodMobs
:NoAggrodMobs
}
/echo no aggro'd mobs found
/varset MobID 0
/varset FirstMobID 0
/varset LastMobID 0
/alert clear 1
| a clear alert and noalert don't mix
/alert add 1 npc this_is_bogus
/for SRadius 100 to 10000 step 100
/if (${MobID}==0) {
/varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius ${SRadius}].ID}
/varset FirstMobID ${MobID}
} else {
/varset LastMobID ${MobID}
/varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius ${SRadius}].ID}
/if (${FirstMobID}==${MobID}) {
/next SRadius
}
}
/if (${MobID}!=0) {
/call AvoidTargets ${MobID}
/if (${Macro.Return}==1) {
/echo not avoiding ${Spawn[ID ${MobID}].CleanName}
/goto :Done
} else {
/alert add 1 npc ${Spawn[ID ${MobID}].CleanName}
}
}
/next SRadius
/varset MobID ${Spawn[npc]}
/echo No mobs found, action required!
/beep
/beep
/beep
/beep
:Done
/varset TargetUpNext ${MobID}
/echo Next: ${Spawn[ID ${MobID}].Level} ${Spawn[ID ${MobID}].CleanName} - Distance: ${Spawn[ID ${MobID}].Distance}
/return
im not sure how to call the proccess to get it to just target something inside of a certain radius, and then have it start casting the chants again when it has a target.