TrainSpell Help Please
Posted: Sun May 09, 2004 12:53 pm
I have written a Spell Training macro and as it stands will cast OVER and OVER all spells in gem slots BUT i need someone to help me out with the logic code to stop once all spells in the slots have reached their respective "ArcaneMax" also if anyone has any ideas on tidying up if it needs it or any Constructive critism would be welcome.
*** You MUST Include SpellCast.inc***
The stuff in red is waiting for the logic code for max skills.
As usual Many Thanks to whoever can help.
*** You MUST Include SpellCast.inc***
Code: Select all
| trainspell.mac
| Made by Fuergrissa V1.0
#Define ArcaneMax 235
#include spellcast.inc
Sub Main
/declare ArcaneLevel int outer
/declare SpellName string outer
/declare GemNumber int outer
/declare WhatSkill string outer
/varcalc ArcaneLevel ${Me.Level}*5+5
/echo Your Max Spell Cap is ${ArcaneLevel}
/if (${ArcaneLevel}<${ArcaneMax}) /varset ArcaneLevel ArcaneMax
/echo Your Current Spell Cap is ${ArcaneLevel}
/varset GemNumber 0
/varset SpellName ""
/varset WhatSkill ""
:TrainingLoop
/if (${Me.PctMana}<20) /goto :SitDown
/if (${Cursor.ID}) /autoinv
/goto :CastSpell
/return
:SitDown
/echo Mana at ${Me.PctMana}% Medding till over 98%
:MedLoop
/if (${Me.State.Equal[STAND]}) /sit
/if (${Me.PctMana}>98) /goto :FullMana
/goto :MedLoop
/return
:FullMana
/echo Mana at ${Me.PctMana}% Starting Casting Again.
/if (${Me.State.Equal[SIT]}) /stand
:CastSpell
/Varcalc GemNumber ${GemNumber}+1
/if (${GemNumber}>8) /varset GemNumber 1
/varset SpellName ${Me.Gem[${GemNumber}]}
/if (!${Me.Gem[${SpellName}]}) /goto :TrainingLoop
/call TestSkill
/target myself
/echo Casting ${SpellName} from GemSlot ${GemNumber} of Type ${Spell[${SpellName}].Skill} (${Me.Skill[${Spell[${SpellName}].Skill}]})
/call cast "${SpellName}"
/goto :TrainingLoop
/return
Sub TestSkill
/if (${Me.Skill[${Spell[${SpellName}].Skill}]}==${ArcaneLevel}) /goto :TooHigh
/return
:TooHigh
/echo You cannot Increase ${WhatSkill} anymore.
/return
[color=red]:Finished
/echo Ending
/endmacro[/color]
As usual Many Thanks to whoever can help.