Help with my Skillup.mac - Spell Trainer

For questions regarding conversion of scripts from the old, parm style to the new MQ2Data format. Conversion questions only!

Moderator: MacroQuest Developers

Mixy
a lesser mummy
a lesser mummy
Posts: 46
Joined: Tue Jul 09, 2002 5:00 pm

Help with my Skillup.mac - Spell Trainer

Post by Mixy » Sat May 01, 2004 9:45 am

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!

xander
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Apr 22, 2004 11:40 pm

Post by xander » Sat May 01, 2004 11:08 am

Try it without the quotes.
Xander

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat May 01, 2004 11:51 am

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.

Mixy
a lesser mummy
a lesser mummy
Posts: 46
Joined: Tue Jul 09, 2002 5:00 pm

Post by Mixy » Sat May 01, 2004 2:24 pm

It dosn't cast the spell, with, or without the quotes.

-Mixy!

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat May 01, 2004 3:30 pm

Hrm let me look over this.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat May 01, 2004 3:37 pm

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 
Last edited by ml2517 on Sat May 01, 2004 5:50 pm, edited 2 times in total.

Mixy
a lesser mummy
a lesser mummy
Posts: 46
Joined: Tue Jul 09, 2002 5:00 pm

Post by Mixy » Sat May 01, 2004 4:09 pm

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!

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat May 01, 2004 5:39 pm

Blah.. you are gonna make me test it? heh Ok.. I guess.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat May 01, 2004 5:44 pm

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.

Mixy
a lesser mummy
a lesser mummy
Posts: 46
Joined: Tue Jul 09, 2002 5:00 pm

Post by Mixy » Sat May 01, 2004 5:53 pm

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!