Ending macro: Subroutine Cast wasn't found
Here is the macro, and following it, the spellcast.mac include which is also in my macros folder. For some reason though, it's like MQ doesn't know the file is there.
This isnt the first time I've had trouble with #include name.mac
Is it just me, or is include currently broken?
Code: Select all
| repeatcast.mac
|
| Casts a spell on the target in an endless loop until mana runs out, then
| sits and exits. This is used to achieve skill ups in your spell skills.
|
| Usage:
| repeatcast.mac "Spell Name"
|
| This macro requires that the named spell be already memorized, due to
| current limitations of /click and the new UI.
#include spellcast.mac
Sub Main
| If no command line, print out a help message
/if n $strlen("$p0")==0 {
/echo repeatcast.mac
/echo
/echo Casts a spell on the target in an endless loop until mana runs out, then
/echo sits and exits. This is used to achieve skill ups in your spell skills.
/echo
/echo Usage:
/echo repeatcast.mac "Spell Name"
/echo
/echo This macro requires that the named spell be already memorized, due to
/echo current limitations of /click and the new UI.
/return
}
| Check if you can cast the spell
/if n $spell("$p0",level)>$char(level) {
/echo You cannot cast $p0.
/return
}
/stand
/echo Repeatedly casting $p0 until mana runs out... use /endmacro to stop earlier.
:SpellLoop
/call Cast "$p0"
/if n $return!=CAST_SUCCESS /goto :Done
/delay 1
/goto :SpellLoop
:Done
/if n $return==CAST_UNKNOWNSPELL {
/echo You do not have $p0 memorized.
/goto :Exit
}
/if n $return==CAST_OUTOFMANA {
/if n $char(mana,pct)<1 {
/sit off
/sit on
:ManaLoop
/if n $char(mana,pct)>90 /goto :SpellLoop
/delay 7s
/goto :ManaLoop
}
}
/echo There was an error attempting to cast $p0. Please try again.
:Exit
/sit
/endmac
/return Code: Select all
|Plazmic + 1 line change by Imperfect
|** SpellCast.mac
** This will cast a spell reliably for you...
** Usage:
** /call Cast "spellname"
** It will return the following values:
** CAST_SUCCESS
** CAST_UNKNOWNSPELL
** CAST_OUTOFMANA
** CAST_OUTOFRANGE
** CAST_CANNOTSEE
** CAST_STUNNED
** CAST_RESISTED
**|
#event Fizzle "Your spell fizzles!"
#event Interrupt "Your casting has been interrupted!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Recover "Spell recovery time not yet met."
#event Resisted "You target resisted the "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event NoLOS "You cannot see your target."
#event Stunned "You cannot cast while stunned"
#event Standing "You must be standing to cast a spell"
#event Collapse "Your gate is too unstable, and collapses."
#define CastStatus v59
#define CastTimer t7
#define CAST_SUCCESS 0
#define CAST_UNKNOWNSPELL 1
#define CAST_RESTART 2
#define CAST_OUTOFMANA 3
#define CAST_OUTOFRANGE 4
#define CAST_CANNOTSEE 5
#define CAST_STUNNED 6
#define CAST_RESISTED 7
Sub Cast
/if n $char(gem,"$p0")==0 /return CAST_UNKNOWNSPELL
:StartCast
/if n $char(gem,"$p0")<0 /call WaitForRefresh "$p0"
/cast "$p0"
/varset CastTimer $int($spell("$p0",casttime)*10+$spell("$p0",recoverytime)*10)
/varset CastStatus CAST_SUCCESS
:WaitCast
/doevents Fizzle
/doevents Interrupt
/doevents Recover
/doevents Standing
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted
/if n $CastStatus==CAST_RESTART /goto :StartCast
/if n $CastStatus>=CAST_RESTART /return $CastStatus
/if n $CastTimer>0 /goto :WaitCast
/varset CastTimer 0
/return CAST_SUCCESS
Sub WaitForRefresh
:LoopWaitForRefresh
/delay 0
/if n $char(gem,"$p0")<0 /goto :LoopWaitForRefresh
/return
Sub Event_Fizzle
/varset CastStatus CAST_RESTART
/return
Sub Event_Interrupt
/varset CastStatus CAST_RESTART
/return
Sub Event_Recover
/varset CastStatus CAST_RESTART
/delay 5
/return
Sub Event_Standing
/varset CastStatus CAST_RESTART
/stand
/return
Sub Event_Collapse
/varset CastStatus CAST_RESTART
/return
Sub Event_OutOfMana
/varset CastStatus CAST_OUTOFMANA
/return
Sub Event_OutOfRange
/varset CastStatus CAST_OUTOFRANGE
/return
Sub Event_NoLOS
/varset CastStatus CAST_CANNOTSEE
/return
Sub Event_Stunned
/varset CastStatus CAST_STUNNED
/return
Sub Event_Resisted
/varset CastStatus CAST_RESISTED
/return 