Page 1 of 1

Imbue macro won't quit

Posted: Fri Dec 24, 2004 5:22 am
by fallon
My first macro... a nice simple little one I hacked up from a couple others. It works good, except for I can't get it to kick off when it's out of imbue coponents. Any suggestions?

Code: Select all

|Simple imbue/enchant Macro
|imbue.mac
|Author: Fallon (my first macro, yay!)
|Credits: I mostly just hacked up YAST by Lorad
|Source: http://www.macroquest2.com/phpBB2/viewtopic.php?t=8863&postdays=0&postorder=asc&start=0
|Requires: SpellCast.inc
|Usage: Mem the imbue/enchant spell you want in slot 1, then: /macro imbue
|Example: /macro ts.mac "Metal Bits" "Camp=1 EndOnTrivial=1 KeepItem=0 Spam=0 Delay=3"
|Setting Options: Change "/varset camp 0" to "/varset camp 1" to auto-camp when your out of stuff to imbue
|

#chat tell
#event lang "tells you"
#event NOCOMPONENT "You are missing some required spell components."

#include SpellCast.inc

Sub Main

    /declare currentSpell
    /declare camp
    /declare spellName
    /varset currentSpell 1
    /varset camp 0

    /target myself
   
        /echo currentspell=${currentSpell}
        /echo casting=${Me.Gem[${currentSpell}]}
       
            :castSpell
                /doevents
                /if ( ${Me.PctMana}<20) {
                    /sit on
                    /call MedBreak
                }
                /call CheckGM
                /call cast "${Me.Gem[${currentSpell}]}"
               
                :checkCursor
                /if (${Cursor.ID}) {
                    /autoinv
                    /goto :checkCursor
                }
            /doevents 
            /goto :castSpell
        }
   
    /sit
    /call MedBreak
    /camp
/return

Sub CheckGM
    :GMCheck
    /if (${Bool[${Spawn[gm].ID}]}) {
       /echo 'Cast Macro' A GM or Guide has been detected in the zone,  the macro will resume  when the zone is clear of GM/Guides
       /delay 600s
       /goto :GMCheck
    }
/return

Sub Event_Chat
  /echo Got a tell, pausing for 10 minutes
  /delay 600s
/return

Sub Event_Lang
  /echo Got a tell, pausing for 10 minutes
  /delay 600s
/return

Sub Event_NOCOMPONENT
  /echo Out of stuff to work on
  /call End_Macro
/return

/return

Sub MedBreak
    /stand
    /sit
    :MedMore
        /delay 2s
        /if (${Me.CurrentMana}<${Me.MaxMana}) /goto :MedMore
/return 

Sub End_Macro
    /if (${Camp}==1) {
        /sit
        /camp desktop
    }
    /endmacro
/return

Posted: Fri Dec 24, 2004 5:58 am
by Fuergrissa
When i want to find out where a macro is failing i will put alot of "Echos" in with sequented numbers, use a few pauses and watch for the numbers, you will be able to isolate the failing sub routine and then solve the problem yourself, i assure you its within your capabilities and you will learn a lot more than asking for other peoples help, if you still cant find it then post the offending sub and state you have isolated it to this routine and require help, alot more people will help you if you show a willingness to help yourself.


Merry Christmas to all here

Posted: Fri Dec 24, 2004 7:06 am
by A_Druid_00
Yes, /echoes are your friend. I use them to excess when I'm tweaking my own macro.

Also, don't use the Quote buttons for posting code, use Code. Quote, just like a regular post, strips out all indentation. I guess if you don't indent as a rule, then it won't bother you, but the easiest way to follow /if statements through is via indentation.

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:03 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:04 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:05 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:07 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:09 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:10 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:11 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:12 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:13 pm
by xyilla

Re: Imbue macro won't quit

Posted: Sat Jan 03, 2026 1:15 pm
by xyilla