Page 1 of 2

A skill-up macro and spell component caster

Posted: Thu Apr 29, 2004 9:02 pm
by bob_the_builder
A skill-up macro and spell component caster

Code: Select all

| castgem.mac 
| /macro castgem <gem #> 
| For instance:
| /macro castgem 8
| Use for skill up 
| Use for making items 
| Bob_the_builder 
| 4/29/04 

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

Sub Main 
   /declare SpellName 
   /varset SpellName ${Me.Gem[${Param0}]} 
   /if (${Me.State.Equal[SIT]}) /stand 

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

   :CheckCursor 
   /if (${Cursor.ID}) { 
      /autoinv 
      /goto :CheckCursor 
   } 

   :CastSpell 
   /call cast "${SpellName}" 
   /doevents 
   /goto :CheckMana 

   :SitDown 
   /if (${Me.State.Equal[STAND]}) /sit on 

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

Sub Event_NoComponents 
   /popup No More Items to Make 
   /endmacro 
/return 
/mac castgem <gem_number>

Good for spell skil increases and making enchant item things. Will stop when all out of components for that spell gem.

Bob

Am I wrong?

Posted: Fri Apr 30, 2004 2:22 am
by Bardmad
hi bob, I tried ur problem but it seems like it's not working... nothing actually happen. i have <Sense The Dead> on my first Spell Gem and i typed /mac castgem.mac <gem 1>, /mac castgem <gem 1> and etc but there're not reaction, but only stood up. can u tell me what's wrong with it? :)

Posted: Fri Apr 30, 2004 3:17 am
by elkcit
try

/macro castgem.mac 1

Posted: Sat May 01, 2004 8:42 am
by newstarter
Subroutine cast wasnt found
castgem.mac@28 (Main):/call cast"${SpellName}"
The current macro has ended

Thats what it tells me after doing /mac castgem 1

Anyone that can help, its prolly just a small mistake from my side, pretty new to this. thx in advanced

Posted: Sat May 01, 2004 9:01 am
by Mixy
You need spellcast.inc which is in the snippits section. Put that file in your macro dir.

-Mixy!

Posted: Sun May 02, 2004 2:28 am
by McClicky
I'm getting an error message when trying to run this macro:

SubRoutine Main not found.

I know this is a noob problem I'm having, but I'm a hopeless noob. I did a search for the error and got back nothing. I've RTFM, kicked it around for 3 days now trying different stuff and have gotten nowhere. Anyone know what I'm doing wrong? I have spellcast.inc in there, everything else in MQ2 seems to run fine, except macro. Please help.

Posted: Sun May 02, 2004 1:03 pm
by magictiger
....
Copy and paste it again, because something's screwed up your macro.

SubRoutine Main not found is usually caused by not capitalizing the M... or a bad copy/paste job.

Posted: Mon May 03, 2004 1:10 am
by McClicky
Thanks magictiger. I tried it, and still no luck, though. The macro looks exactly the same as it does in the text of the post. I've realized now, after some testing, that most of my macros are doing the same thing, even the preset macros (i.e. Follow, Randfollow). I haven't tested them all, but the only one I can get past the SubRoutine Main not found error is Hero.mac. I've reinstalled studio.net, reinstalled MQ2, recompiled...I've done everything I can think of. I'm getting no compiling errors, and like I said, everything else runs without fault. I'm stumped.

Posted: Mon May 03, 2004 1:17 am
by magictiger
Have you done a batch rebuild all?
Or a batch clean then batch build?
sounds like something's fubar in your MQ2

Posted: Wed May 12, 2004 9:39 pm
by The_Cuban
Hello, all long time lurker here this is the first time I have run into an
issue so I thought I would ask. I am wondering if the custom event change broke this macro. I have used it many times in the past but this is what it is doing now. It will run fine until I run out of mana like it should then it will sit to meditate but when I am full mana it will attempt to cast the spell while I am still sitting. It used to stand me up then cast. Thinking I did something wrong. I rebuilt the current release and it is still
happening. Do any of you long time user think you can help me out. Also
thanks to all the people who have devoted time to this great project.

Posted: Wed May 12, 2004 10:07 pm
by The_Cuban
I jumped the gun on this one. If I had waited and thought about it some more I would have gone to the snippets section and seen that spellcast.inc had been modified.

Posted: Sat May 15, 2004 3:06 pm
by Oid

Code: Select all

#include spellcast.inc
#event NoComponents "You are missing some required components."
Sub Main
	/declare SpellName int local
        /varset SpellName ${Me.Gem[${Param0}]}
	:castloop
	/stand
	/call cast ${SpellName}
	/doevents
	:CheckCursor
	/if (${Cursor.ID}) {
		/autoinv
		/goto :CheckCursor
	}
	:CheckMana
	/if (${Me.PctMana}>20) {
		/goto :castloop
	}
	/sit
	:medup
	/delay 60s ${Me.PctMana}>80
	/if (${Me.PctMana}>80) /goto :castloop
	/goto :medup	
/return

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

Posted: Sun May 16, 2004 1:35 am
by Jones
One small bug if you are doing mass enchant spells and you fall below 20% it will spam the spell till you have the mana for it so raise the min % mana to med if you need to and it will work fine

Code: Select all

#include spellcast.inc
#event NoComponents "You are missing some required components."
Sub Main
      /declare SpellName
   /varset SpellName ${Me.Gem[${Param0}]}
   :castloop
   /stand
   /call cast "${SpellName}"
   /doevents
   :CheckCursor
   /if (${Cursor.ID}) {
      /autoinv
      /goto :CheckCursor
   }
   :CheckMana
   /if (${Me.PctMana}>20) {
      /goto :castloop
   }
   /sit
   :medup
   /delay 60s ${Me.PctMana}>98
   /if (${Me.PctMana}>98) /goto :castloop
   /goto :medup   
/return

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

Posted: Sun May 16, 2004 2:27 am
by DumbStruck
MrClicky said :
I'm getting an error message when trying to run this macro:

SubRoutine Main not found.
This happend to me make sure u are saveing macro right!
: under ansi and saving it as blahblahblah.mac

Posted: Sun Sep 19, 2004 12:00 pm
by Bardmad
hmm.. after the OOW patch, it doesnt seem working... anyone can tell me why pls?