Fully tested and works well.
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 {
/echo You have run out of mana. Goodbye!
/goto :Exit
}
/echo There was an error attempting to cast $p0. Please try again.
:Exit
/sit
/return




