Here is the version that was working right before datavars:
Code: Select all
| healwatch.mac
| Original by the UBER GrimJack, Updated by Rainmaker
|
| When running will watch whatever you target and if it drops below whatever percent
| Is specified it will cast whatever spell is specified.
|
| Usage: /mac healwatch percent spellname
| Example /mac healwatch 41 Complete Heal
|
|
| Date: 4/23/2004
#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"
Sub Main
/declare HealSpell global
/declare HealPct global
/declare Fail global
/declare DoAgain global
/declare StartCast global
/declare Remem global
/declare CastTime global
/declare SpellSlot global
/declare SpellName global
/declare CTimer timer
/declare OOMtimer timer
/if (!${Defined[Param1]}) {
/echo Usage: /mac healwatch Percent Healspell
/echo Example: /mac healwatch 41 Complete Heal
/end
}
/if (!${Defined[Param2]}) {
/varset HealSpell "@Param1"
} else /if (!${Defined[Param3]}) {
/varset HealSpell "@Param1 @Param2"
} else /if (!${Defined[Param4]}) {
/varset HealSpell "@Param1 @Param2 @Param3"
} else {
/varset HealSpell "@Param1 @Param2 @Param3 @Param4"
}
/varset HealPct @Param0
:HealWatchLoop
/delay 1
/if (${Bool[${Target}]}==TRUE) {
/if (${Target.PctHPs}<=@HealPct) {
/call SpellSub "@HealSpell"
}
}
/goto :HealWatchLoop
/return
Sub SpellSub
/stand
/varset Remem 0
/varset Fail 0
/varset SpellName "@Param0"
:MemWait
/doevents
/if (${Int[@Fail]}==1) {
/varset Fail 0
/if (${Int[@Remem]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/varset SpellSlot ${Me.Gem[@SpellName]}
/if (${Int[@SpellSlot]}<0) {
/delay 1s
/goto :MemWait
}
/if (${Int[@SpellSlot]}==0) {
/memspell 2 "@Param0"
/varset SpellSlot 2
/varset Remem 1
:refreshwait
/doevents
/if (${Int[@Fail]}==1) {
/varset Fail 0
/if (${Int[@Remem]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/delay 5
/if (${Int[${Me.Gem[@SpellName]}]}<=0) /goto :refreshwait
}
/varset CastTime ${Spell[@SpellName].MyCastTime}
/varadd CastTime 1
:BeginCast
/varset Fail 0
/varset DoAgain 0
/varset StartCast 0
/call WaitForStart
:TimerLoop
/doevents
/if (${Int[@DoAgain]}==1) /goto :BeginCast
/if (${Int[@Fail]}==1) {
/varset Fail 0
/if(${Int[@Remem]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/if (${Int[@CTimer]}>0) /goto :TimerLoop
/delay 2
/doevents
/if (${Int[@DoAgain]}==1) /goto :BeginCast
/if (${Int[@Remem]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
Sub WaitForStart
/cast @SpellSlot
:StartLoop
/doevents
/if (${Int[@Fail]}==1) /return
/if (${Int[@DoAgain]}==1) /return
/if (${Int[@StartCast]}==0) {
/goto :StartLoop
}
/varset CTimer "@CastTime"s
/return
Sub Event_CastStart
/varset StartCast 1
/return
Sub Event_CastFizzle
/delay 2
/varset DoAgain 1
/return
Sub Event_CastInterrupt
/delay 2
/if (${Int[@fail]}==1) /return
/varset DoAgain 1
/return
Sub Event_FollowOff
/tell ${Target.Name} Auto Follow Off.
/return
Sub Event_Sitting
/stand
/delay 2
/varset DoAgain 1
/return
Sub Event_CastTooFar
/varset Fail 1
/tell ${Target.Name} Too far away.
/varset CTimer 0
/return
Sub Event_Distracted
/tell ${Target.Name} I can't cast. I'm too distracted.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoTarget
/varset Fail 1
/tell ${Target.Name} I have no target to cast on.
/varset CTimer 0
/return
Sub Event_NoMem
/tell ${Target.Name} That spell is not memed.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_RootOff
/tell ${Target.Name} Root has worn off.
/return
Sub Event_CastNoMana
/if (${Int[@OOMtimer]}<=0) {
/tell ${Target.Name} I am OOM!
/varset OOMtimer 100
/return
}
/tell ${Target.Name} OOM. Medding 13 seconds and trying again.
/varset DoAgain 1
/sit off
/sit on
/varset OOMtimer 130
:medingwait
/delay 1
/doevents
/if (${Int[@OOMtimer]}>0) /goto :medingwait
/sit off
/return
Sub Event_Stunned
/tell ${Target.Name} Stunned waiting 3 seconds to try again.
/delay 3s
/varset DoAgain 1
/return
Sub Event_Recovered
/delay 2s
/varset DoAgain 1
/return
Sub Event_CastResist
/tell ${Target.Name} Resisted. Trying again.
/varset DoAgain 1
/return
Sub Event_Collapse
/varset DoAgain 1
/return
Sub Event_NoLOS
/tell ${Target.Name} I can't see my target.
/varset Fail 1
/varset CTimer 0
/return
Code: Select all
/if (${Me.Casting.ID}) {
/delay 1
/goto :WaitCast
}
/if (${Target.PctHPs}>=${HealPct}) /return
Code: Select all
| healwatch.mac
| Original by the UBER GrimJack - wish he were here now =)
|
| When running will watch whatever you target and if it drops below whatever percent
| Is specified it will cast whatever spell is specified.
|
| Usage: /mac healwatch percent spellname
| Example /mac healwatch 41 Complete Heal
|
|
| Date: 05/01/2004
#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"
Sub Main
/declare HealSpell outer
/declare HealPct outer
/declare Fail outer
/declare DoAgain outer
/declare StartCast outer
/declare Remem outer
/declare CastTime outer
/declare SpellSlot outer
/declare SpellName outer
/declare CTimer timer outer
/declare OOMtimer timer
/if (!${Defined[Param1]}) {
/echo Usage: /mac healwatch Percent Healspell
/echo Example: /mac healwatch 41 Complete Heal
/end
}
/if (!${Defined[Param2]}) {
/varset HealSpell "${Param1}"
} else /if (!${Defined[Param3]}) {
/varset HealSpell "${Param1} ${Param2}"
} else /if (!${Defined[Param4]}) {
/varset HealSpell "${Param1} ${Param2} ${Param3}"
} else {
/varset HealSpell "${Param1} ${Param2} ${Param3} ${Param4}"
}
/varset HealPct ${Param0}
:HealWatchLoop
/delay 1
/if (${Bool[${Target}]}==TRUE) {
/if (${Target.PctHPs}<=${HealPct}) {
/call SpellSub "${HealSpell}"
}
}
/goto :HealWatchLoop
/return
Sub SpellSub
/stand
/varset Remem 0
/varset Fail 0
/varset SpellName "${Param0}"
:MemWait
/doevents
/if (${Int[${Fail}]}==1) {
/varset Fail 0
/if (${Int[${Remem}]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/varset SpellSlot ${Me.Gem[${SpellName}]}
/if (${Int[${SpellSlot}]}<0) {
/delay 1s
/goto :MemWait
}
/if (${Int[${SpellSlot}]}==0) {
/memspell 2 "${Param0}"
/varset SpellSlot 2
/varset Remem 1
:refreshwait
/doevents
/if (${Int[${Fail}]}==1) {
/varset Fail 0
/if (${Int[${Remem}]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/delay 5
/if (${Int[${Me.Gem[${SpellName}]}]}<=0) /goto :refreshwait
}
/varset CastTime ${Spell[${SpellName}].MyCastTime}
/varcalc CastTime ${CastTime}+1
:BeginCast
/varset Fail 0
/varset DoAgain 0
/varset StartCast 0
/call WaitForStart
:TimerLoop
/doevents
/if (${Int[${DoAgain}]}==1) /goto :BeginCast
/if (${Int[${Fail}]}==1) {
/varset Fail 0
/if(${Int[${Remem}]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
}
/if (${Int[${CTimer}]}>0) /goto :TimerLoop
/delay 2
/doevents
/if (${Int[${DoAgain}]}==1) /goto :BeginCast
/if (${Int[${Remem}]}==1) {
/memspellset default
:loadsploop
/delay 5
/if (${Window[SpellBookWnd].Open}) /goto :loadsploop
}
/return
Sub WaitForStart
:WaitCast
/if (${Me.Casting.ID}) {
/delay 1
/goto :WaitCast
}
/if (${Target.PctHPs}>=${HealPct}) /return
/cast ${SpellSlot}
:StartLoop
/doevents
/if (${Int[${Fail}]}==1) /return
/if (${Int[${DoAgain}]}==1) /return
/if (${Int[${StartCast}]}==0) {
/goto :StartLoop
}
/varset CTimer "${CastTime}"s
/return
Sub Event_CastStart
/varset StartCast 1
/return
Sub Event_CastFizzle
/delay 2
/varset DoAgain 1
/return
Sub Event_CastInterrupt
/delay 2
/if (${Int[${fail}]}==1) /return
/varset DoAgain 1
/return
Sub Event_FollowOff
/tell ${Target.Name} Auto Follow Off.
/return
Sub Event_Sitting
/stand
/delay 2
/varset DoAgain 1
/return
Sub Event_CastTooFar
/varset Fail 1
/tell ${Target.Name} Too far away.
/varset CTimer 0
/return
Sub Event_Distracted
/tell ${Target.Name} I can't cast. I'm too distracted.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoTarget
/varset Fail 1
/tell ${Target.Name} I have no target to cast on.
/varset CTimer 0
/return
Sub Event_NoMem
/tell ${Target.Name} That spell is not memed.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_RootOff
/tell ${Target.Name} Root has worn off.
/return
Sub Event_CastNoMana
/if (${Int[${OOMtimer}]}<=0) {
/tell ${Target.Name} I am OOM!
/varset OOMtimer 100
/return
}
/tell ${Target.Name} OOM. Medding 13 seconds and trying again.
/varset DoAgain 1
/sit off
/sit on
/varset OOMtimer 130
:medingwait
/delay 1
/doevents
/if (${Int[${OOMtimer}]}>0) /goto :medingwait
/sit off
/return
Sub Event_Stunned
/tell ${Target.Name} Stunned waiting 3 seconds to try again.
/delay 3s
/varset DoAgain 1
/return
Sub Event_Recovered
/delay 2s
/varset DoAgain 1
/return
Sub Event_CastResist
/tell ${Target.Name} Resisted. Trying again.
/varset DoAgain 1
/return
Sub Event_Collapse
/varset DoAgain 1
/return
Sub Event_NoLOS
/tell ${Target.Name} I can't see my target.
/varset Fail 1
/varset CTimer 0
/return
I'm very green at this, and prolly deserve a "RTFM". But hopefully someone can point me to the errors I've made in conversion and I can learn something.
Thanks for reading
