Moderator: MacroQuest Developers

Code: Select all
#event XPTRACKER "#*#You gain experience!!#*#"
#event XPTRACKER "#*# You gain party experience#*#"
#event XPREPORT "#*# report xp#*#"
Sub Main
/Declare LevelsGained outer
/Declare ExpGained outer
/Declare AAGained outer
/Declare AAExpGained outer
/Declare StartLevel outer
/Declare StartAA outer
/Declare StartExp outer
/Declare StartAAExp outer
/varset StartLevel ${Me.Level}
/varset StartAA ${Me.AAExp}
/varset StartExp ${Me.Exp}
/varset StartAAExp ${Me.AAPoints}
:XPTrackLoop
/doevents
/goto :XPTrackLoop
/return
Sub Event_XPTRACKER
/if (${Me.Level}>${StartLevel}) {
/varset LevelsGained (${Me.Level}-${StartLevel})
}
/if (${Me.AAPoints}>${StartAA}) {
/varset AAGained (${Me.AAPoints}-${StartAA})
}
/return
Sub Event_XPREPORT
/echo ${LevelsGained}
/echo ${AAGained}
/return
Code: Select all
Sub Event_Exp
/declare RunTime int local
/varcalc RunTime ${Macro.RunTime}/60
/varcalc AAExp ${Me.PctAAExp}-${AAExp}
/varcalc Exper ${Me.PctExp}-${Exper}
/varcalc PrctExp ${Me.PctExp}-${Expstart}
/varcalc PrctAAExp ${Me.PctAAExp}-${AAstart}
/echo [EXP]: ${Exper} [AAXP]: ${AAExp} [${PrctExp}% EXP] [${PrctAAExp}% AAXP] in [${RunTime}] Minutes...
/returnCode: Select all
#event Exp "You gain#*#Experience#*#"
Sub Main
/declare PrctExp float outer
/declare Exper float outer
/declare Exper1 float outer
/declare Exper2 float outer
/declare Expstart float outer
/varset PrctExp 0
/varset Exper ${Me.PctExp}
/varset Exper1 0
/varset Exper2 0
/varset Expstart ${Me.Exp}
:Loop
/doevents
/goto :Loop
Sub Event_Exp
/declare RunTime int local
/declare RunTime1 float local
/varset RunTime1 0
/varcalc RunTime ${Macro.RunTime}/60
| Exper = XP from last Kill
/varcalc Exper ${Me.Exp}-${Exper}
| Exper2 is running total of XP gained since start
/varcalc Exper2 ${Exper2}+${Exper}
| PrctExp is the Percent left to level
/varcalc PrctExp 100-${Me.PctExp}
/varcalc RunTime1 ${RunTime}/60
/if (${RunTime1}<1) /varset RunTime1 1
|Exper1 is Approx XP per hour
/varcalc Exper1 ${Exper2}/${RunTime1}
/echo [Last Kill]: ${Exper} [Total EXP]: ${Exper2} in [${RunTime}] Minutes...
/echo [%EXP to level]: ${PrctExp}% [Exp per hr]: ${Exper1}
/return

Code: Select all
#include spell_routines.inc
#event BuffMe "#*#Your #1# spell has worn off of #2#."
Sub Main
:MainLoop
/doevents
/goto :MainLoop
/return
Sub Event_BuffMe(Line,SpellName,ToonName)
/echo Re-Casting ${SpellName} on ${ToonName}
:Buff_Loop
/target ${ToonName}
/call cast "${SpellName}" 3s
/delay 10s !${Me.Casting.ID}
/if (!${Macro.Return.Equal["CAST_SUCCESS"]}) /goto :Buff_Loop
/return

Code: Select all
Sub FindMob
/target ${NearestSpawn[npc radius ${Radius} zradius 30]}
/delay 10
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${Radius}) /call Attack
/return
Sub Attack
:GetClose
/if (${Target.Distance}>20 && ${Target.Type.Equal[NPC]}) {
/delay 2
/face fast nolook
/keypress up hold
/delay 2
/keypress up
/call Checks
/goto :GetClose
}
/popup Killing (${Target})!
/if (${Stick.Status.Equal[ON]}) /stick off
:AttackLoop
/if (${Target.Type.Equal[NPC]}) {
/if (${Stick.Status.Equal[OFF]} && !${Stick.Status.Equal[PAUSED]}) /stick hold 50%
/killthis
/Delay 5
/call Checks
/goto :AttackLoop
}
/return
Code: Select all
/target MyMob npc radius ${x} zradius ${z} los
Hehe then the line below should do it all. NearestSpawn will try any non variable as a name from what I read.spartikus wrote:Don't know if this will help you or not Droid but I've added in the line of sight flag to my /target lines to ensure my pets dont all go rambling off into various rooms of a dungeon and pulling 50 mob trains back on the group :)
I am pretty sure you just tag 'los' without quotes on the end of the /target line.
example:Upped my survivability on my farming macro substantially.Code: Select all
/target MyMob npc radius ${x} zradius ${z} los
Code: Select all
/target ${NearestSpawn[npc radius ${Radius} zradius 30 los ${MyMobName}]}