Page 1 of 1
Help with my FIRST Spelltrain Macro Please
Posted: Tue May 04, 2004 6:36 pm
by Fuergrissa
i have butchered many macros but never made one from scratch thisis my first and im sure its FULL of errors but hey i gotta learn somewhere.
Please be gentle with me and all advice and help is appreciated.
Code: Select all
| spelltrain.mac
#Define ArcaneMax 235
#include spellcast.inc
Sub Main
/declare ArcaneLevel int outer
/declare SpellName string outer
/declare GemNumber int outer
/varcalc ArcaneLevel ${Me.Level}*5+5
/echo ${ArcaneLevel}
/if (${n} ${ArcaneLevel}>${ArcaneMax}) /varset ArcaneLevel ArcaneMax
/echo ${ArcaneLevel}
/varset GemNumber 0
/varset SpellName ""
:TrainingLoop
/if (${Me.PctMana}<20) /goto :SitDown
:CheckCursor
/if (${Cursor.ID}) /autoinv
/goto :CastSpell
/return
:SitDown
/if (${Me.State.Equal[STAND]}) /sit
/if (${Me.PctMana}>98) /goto :CastSpell
/goto :Sitdown
/return
:CastSpell
/Varcalc ${GemNumber}+1
/if (${n} ${GemNumber}>8) /varset GemNumber 1
/varset ${SpellName} ${Me.Gem[${GemNumber}]}
/call cast "${SpellName}"
/goto :TrainingLoop
/return
I need to add a check for each spell arcanelevel but want to get the first bit working and casting each spell gem in succession.
Thanks in advance for any help.
Posted: Tue May 04, 2004 7:08 pm
by Preocts
How am I suppose to help when I can't stop staring at your avatar.
Code: Select all
/if ([color=red]${n}[/color] ${ArcaneLevel}>${ArcaneMax}) /varset ArcaneLevel ArcaneMax
What's the ${n} for? Is it /if this AND this? or if this OR this?
Code: Select all
/if (${n} && ${ArcaneLevel}>${ArcaneMax}) /varset ArcaneLevel ArcaneMax
and==&& or==||
Should be
Posted: Wed May 05, 2004 4:30 am
by Fuergrissa
Thank you for your help So far Preocts.
Yes im a bit partial to that avatar, ok it was late last night for me when i started it, im not sure what i wanted to do with the $(n) either and i dont think i need it, so i removed them.
Ok i need a line that checks to see if the spell skill is higher or equal to the ${ArcaneLevel} and if it is /goto :DontCast. I am editing this at work so i can hopefully test it at lunch time.
Also in my :DontCast routine is there a way to forget a gem once its maxed ?
Any and all help is appreciated, Thank you.
Code: Select all
| spelltrain.mac
#Define ArcaneMax 235
#include spellcast.inc
Sub Main
/declare ArcaneLevel int outer
/declare SpellName string outer
/declare GemNumber int outer
/varcalc ArcaneLevel ${Me.Level}*5+5
/echo ${ArcaneLevel}
/if (${ArcaneLevel}>${ArcaneMax}) /varset ArcaneLevel ArcaneMax
/echo ${ArcaneLevel}
/varset GemNumber 0
/varset SpellName ""
:TrainingLoop
/if (${Me.PctMana}<20) /goto :SitDown
:CheckCursor
/if (${Cursor.ID}) /autoinv
/goto :CastSpell
/return
:SitDown
/if (${Me.State.Equal[STAND]}) /sit
/if (${Me.PctMana}>98) /goto :CastSpell
/goto :Sitdown
/return
:CastSpell
/Varcalc GemNumber ${GemNumber}+1
/if (${GemNumber}>8) /varset GemNumber 1
/varset ${SpellName} ${Me.Gem[${GemNumber}]}
[color=red]| Arcane Level Check here|[/color]
/call cast "${SpellName}"
/goto :TrainingLoop
/return
[color=red]:Dont Cast
/echo You cannot Increase the Skill "Skill" anymore.
/goto :TrainingLoop
/return[/color]
Posted: Wed May 05, 2004 1:28 pm
by Preocts
I'm... kinda jealous.... but anyway, yeah, the macro.
Gonna use this:
...int Skill[name]: Skill level of skill with this name
With the only problem I see being that I don't think we have a way to tell the type of spell being cast in skill terms. Alterations, Conjure, or whatever. Might be something to bug Lax about but not on a patch day
Code: Select all
/if (${Me.Skill[Alteration]}>=${ArcaneLevel}) /goto :DontCast
For now this only solves half the problem. Need a way to pull what skill that gem is being cast off of.
Posted: Wed May 05, 2004 1:57 pm
by Fuergrissa
thank you , you have enabled me to move forward a good ways with this macro.
Posted: Thu May 06, 2004 5:18 am
by Fuergrissa
ok now i need to find the actuall skill associated with the spellname.
this is what i have to find out the skill number
i would like the syntax to set the actuall skillname from the spell
Am i making sence here ?
i think i need to use ...string Skill: Skill name
Code: Select all
/if (${Me.Skill[${Spell[${SpellName}].Skill}]}==${arcaneLevel})
[color=red] /varset WhatSkill ${Spellname.Skill}[/color]
/echo ${WhatSkill} has maxed out.
Posted: Thu May 06, 2004 6:07 am
by Preocts
Close. If you aren't already you should be always referring back to this link for help on how to use the Top Level Objects.
http://macroquest2.com/phpBB2/viewtopic.php?t=6022
Code: Select all
/if (${Me.Skill[${Spell[${SpellName}].Skill}]}==${arcaneLevel}) {
/varset WhatSkill ${Spell[${Spellname}].Skill}
/echo ${WhatSkill} has maxed out.