Help with my FIRST Spelltrain Macro Please

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Help with my FIRST Spelltrain Macro Please

Post by Fuergrissa » Tue May 04, 2004 6:36 pm

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.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue May 04, 2004 7:08 pm

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==||

Code: Select all

/Varcalc ${GemNumber}+1
Should be

Code: Select all

/Varcalc GemNumber ${GemNumber}+1

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Wed May 05, 2004 4:30 am

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]

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Wed May 05, 2004 1:28 pm

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 :wink:

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.

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Wed May 05, 2004 1:57 pm

thank you , you have enabled me to move forward a good ways with this macro.

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Thu May 06, 2004 5:18 am

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.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu May 06, 2004 6:07 am

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.