Imbue macro won't quit

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

Moderator: MacroQuest Developers

fallon
a lesser mummy
a lesser mummy
Posts: 59
Joined: Sat Dec 18, 2004 7:37 pm
Location: Kuwait
Contact:

Imbue macro won't quit

Post by fallon » Fri Dec 24, 2004 5:22 am

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
Last edited by fallon on Sat Dec 25, 2004 5:59 pm, edited 1 time in total.

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

Post by Fuergrissa » Fri Dec 24, 2004 5:58 am

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
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Dec 24, 2004 7:06 am

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.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]










xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Imbue macro won't quit

Post by xyilla » Sat Jan 03, 2026 1:15 pm