Page 1 of 1

Help with my Skillup.mac - Spell Trainer

Posted: Sat May 01, 2004 9:45 am
by Mixy
This is a spell trainer im trying to get to work.. it has been ripped together from Bob_The_Builder's castgem.mac & Giblet's old Skillupmagic.mac.

The variables seem to be working properly, because in all of the /echo's they display correctly. The problem happens at the:

Code: Select all

 /call Cast "${SpellName}" 
It dosn't cast anything, the macro just loops on as if it did cast.

If anyone can help I'd appreciate it, this is my first macro with the new system, and I'm trying to get used to it.

Code: Select all

| skillup.mac
| Work in progress ripped from Bob_the_builder's castgem.mac & Giblet's old Skillupmagic.mac
| CURRENTLY DOES NOT WORK
| Use for skill up


#include spellcast.inc
#event NoComponents "You are missing some required components."

Sub Main
   /declare SkillName
   /declare LevelName
   /declare SpellName
   
   
   /call RaiseSkill "Abjuration" 120 "Minor Sheilding"
   /call RaiseSkill "Alteration" 120 "Shallow Breath"
   /call RaiseSkill "Conjuration" 120 "Mesmerize"
   /call RaiseSkill "Divination" 120 "True North"
   /call RaiseSkill "Evocation" 120 "Chaotic Feedback"
   /call RaiseSkill "Channeling" 120 "True North"
   /call RaiseSkill "Meditate" 120 "Alacrity"
   /call RaiseSkill "Specialize Alteration" 50 "Shallow Breath"
   /endmacro 
   
Sub RaiseSkill(SkillName,LevelName,SpellName)   
   /echo - Raising ${SkillName} to ${LevelName} with ${SpellName}
   |/echo Standing if im sitting
   /if (${Me.State.Equal[SIT]}) /stand

   :CheckMana
   |/echo checking mana
   /if (${Me.PctMana}<20) /goto :SitDown

   :CheckCursor
   |/echo checking for sumoned items in cursor
   /if (${Cursor.ID}) {
      /autoinv
      /goto :CheckCursor
   }

   :CastSpell
   /echo current skill in ${SkillName} is ${Me.Skill[${SkillName}]}
   /if (${Me.Skill[${SkillName}]}>${LevelName}) /goto :NextSkill
   /echo attempting to cast spell ${SpellName}
   /call Cast "${SpellName}"
   /doevents
      /goto :CheckMana
   
   :SitDown
   /if (${Me.State.Equal[STAND]}) /sit on

   :HowMuchMana
   /if (${Me.PctMana}<98) /goto :HowMuchMana
   /goto :CheckMana
   :NextSkill
/return

Sub Event_NoComponents
   /popup No More Items to Make
   /endmacro
   
/return 

I do have spellcast.inc in my macro folder.
Thank you.

-Mixy!

Posted: Sat May 01, 2004 11:08 am
by xander
Try it without the quotes.

Posted: Sat May 01, 2004 11:51 am
by ml2517
Nope, calling functions with quotes is still valid, it strips them off. /varset with quotes is a no-no, it leaves them in the string.

Posted: Sat May 01, 2004 2:24 pm
by Mixy
It dosn't cast the spell, with, or without the quotes.

-Mixy!

Posted: Sat May 01, 2004 3:30 pm
by ml2517
Hrm let me look over this.

Posted: Sat May 01, 2004 3:37 pm
by ml2517
Ok give this a shot:

Code: Select all

| skillup.mac 
| Work in progress ripped from Bob_the_builder's castgem.mac & Giblet's old Skillupmagic.mac 
| CURRENTLY DOES NOT WORK 
| Use for skill up 


#include spellcast.inc 
#event NoComponents "You are missing some required components." 

Sub Main 
   /call RaiseSkill "Abjuration" 120 "Minor Shielding" 
   /call RaiseSkill "Alteration" 120 "Shallow Breath" 
   /call RaiseSkill "Conjuration" 120 "Mesmerize" 
   /call RaiseSkill "Divination" 120 "True North" 
   /call RaiseSkill "Evocation" 120 "Chaotic Feedback" 
   /call RaiseSkill "Channeling" 120 "True North" 
   /call RaiseSkill "Meditate" 120 "Alacrity" 
   /call RaiseSkill "Specialize Alteration" 50 "Shallow Breath" 
   /endmacro 
/return    

Sub RaiseSkill(SkillName,LevelName,SpellName)    
   /echo - Raising ${SkillName} to ${LevelName} with ${SpellName} 
   |/echo Standing if im sitting 
   /if (!${Me.Standing}) /stand 

   :CheckMana 
   |/echo checking mana 
   /if (${Me.PctMana}<20) /goto :SitDown 

   :CheckCursor 
   |/echo checking for sumoned items in cursor 
   /if (${Cursor.ID}) { 
      /autoinv 
      /goto :CheckCursor 
   } 

   :CastSpell 
   /echo current skill in ${SkillName} is ${Me.Skill[${SkillName}]} 
   /if (${Me.Skill[${SkillName}]}>=${Int[${LevelName}]}) /goto :NextSkill 
   /echo attempting to cast spell ${SpellName} 
   /call Cast "${SpellName}" 
   /doevents 
   /goto :CheckMana 
    
   :SitDown 
   /if (!${Me.Sitting}) /sit on 

   :HowMuchMana 
   /if (${Me.PctMana}<98) /goto :HowMuchMana 
   /goto :CheckMana 
   :NextSkill 
/return 

Sub Event_NoComponents 
   /popup No More Items to Make 
   /endmacro 
/return 

Posted: Sat May 01, 2004 4:09 pm
by Mixy
I see the improvements you've made, and I appreciate it. Unfortunately the macro still does not cast the spell.

This has to be something simple that I'm missing. Does this work for anyone else? I'm wondering if my spellcast.inc is messed up.

-Mixy!

Posted: Sat May 01, 2004 5:39 pm
by ml2517
Blah.. you are gonna make me test it? heh Ok.. I guess.

Posted: Sat May 01, 2004 5:44 pm
by ml2517
LOL you spelled "Minor Sheilding" wrong. It is "Minor Shielding". Ok fixed in my post above.

Also made a small change for it to switch to the next skill after it equals or exceeds the number you'd specified above. It was set only to switch when it exceeded it before.

Posted: Sat May 01, 2004 5:53 pm
by Mixy
Hah!

:wink:

Works like a champ now... I'm going to add a little more fluff to it and then post it in the Depot.

-Mixy!