Code:
#define MaxArcaneSkill 235
#chat tell
#event lang "tells you"
#include SpellCast.inc
Sub Main
/declare currentSpell
/declare maxSkill
/declare skillName
/declare spellName
/varset currentSpell 1
/varset maxSkill ${Math.Calc[${Me.Level}*5+5]}
/echo maxSkill=${maxSkill}
/if ( ${maxSkill} > 235 ) /varset maxSkill 235
/target myself
:nextSpell
/echo currentspell=${currentSpell}
/echo casting=${Me.Gem[${currentSpell}]}
/if ( ${Bool[${Me.Gem[${currentSpell}]}]} ) {
/varset skillName ${Me.Gem[${currentSpell}].Skill}
:castSpell
/doevents
/if ( ${Me.PctMana}<20) {
/sit on
/call MedBreak
}
/echo ${skillName}=${Me.Skill[${skillName}]}
/if ( ${Me.Skill[${skillName}]} >= ${maxSkill} ) {
/varset currentSpell ${Math.Calc[${currentSpell}+1]}
/goto :nextSpell
}
/call CheckGM
/call cast "${Me.Gem[${currentSpell}]}"
:checkCursor
/if (${Cursor.ID}) {
/autoinv
/goto :checkCursor
}
/goto :castSpell
}
/sit
/call MedBreak
/camp
/return
Sub CheckGM
:GMCheck
/if (${Bool[${Spawn[gm].ID}]}) {
/echo 'Cast Macro' A GM or Guide has been detected in the zone, the macro will resume when the zone is clear of GM/Guides
/delay 600s
/goto :GMCheck
}
/return
Sub Event_Chat
/echo Got a tell, pausing for 10 minutes
/delay 600s
/return
Sub Event_Lang
/echo Got a tell, pausing for 10 minutes
/delay 600s
/return
Sub MedBreak
/stand
/sit
:MedMore
/delay 2s
/if (${Me.CurrentMana}<${Me.MaxMana}) /goto :MedMore
/return