Errors Vista causing macros to "Flow ran into another subrouti
Reply
Vista causing macros to "Flow ran into another subrouti
Strange thing seems to be happening with one of my boxes.

I run a laptop(XP) with 2 toons on it that I usually play on out in the living room to appease the wife. In my office I have two other comps that I run the other 4 boxes on.

Story-
Original box in office is XP with a 3.0P4 and has some laggin issues with 4 boxes running at the same time. Not bad but I wanted better.

Work had a half dead (equipment wise) computer that I got and put in new graphics card, power supply, and 4 gig ram. So lag isnt an issue and everything game wise seems to run just fine. What i am finding though is that the toons on the Vista box will run in "Flow ran into another subroutine" errors or they wont respond to the /g or /bc commands at all but the macro is still active.

If I take those same toons and power them up on either of the XP boxes and run the exact copied over macro they work fine and are stable.

Attempted fixes-
Reinstalled Macroquest
checked plugins and made sure exact same type and amounts were running on all boxes
selected for programs to run as admin by default
rightclicked and seleceted "run as admin" when starting

So I am left to think that it is most likely just some quirk with Vista since that is the only stand out dif between the setups. I was just hoping to not have to take the time to wipe it out and reinstall XP or move to Win7.

On that note if it is XP I know I need a clean install from scratch but can Win7 "upgrade" over Vista cleanly? Or is that a new install also?

Thanks much for all the support again between work and play I have almost got my macros fully functional and will post them ASAP.

Maud- your snipet for looting with some minor tweaks is a perfect fit for my situation. I can look at the loot with my main on the laptop then call the toons to loot each item they need and not worry about running back and forth to the office. Which draws strange looks from the wife for sure.

Ty again...!!
Thu May 03, 2012 10:39 am
Vista has many problems so it might be impossible to determine the exact cause. Make sure you install EQ in a "non-protected" directory. Same with MQ. Turn off or configure Vista Defender or whatever that infernal POS is called.

You didn't mention hardware specs of the Vista box. If they aren't a good bit higher than the XP box, then you will have the lag issues of the XP box. You can try disabling Aero and all the other resource hogging eye candy.

Make sure your config files are also copied between boxes. An exact macro might behave differently if the MQ or plugin config file differs.

It's never a good idea to "upgrade" an OS over another one. Tabula Rasa. Start with a clean slate.

"Flow ran into another subroutine" - There are a couple different causes of this:

1. If you are running a macro and issue a MQ command that is sorta recognized but not fully recognized, this error message can trigger. For example, /echo ${EQBS.Setting[TellWatch]} is a valid command fully recognized (if you run MQ2EQBC plugn). Issuing this command results in no errors. However, the command /echo ${EQBS.Option[TellWatch]} isn't fully recognized but EQBC is a valid TLO object so it's sorta recognized. Issuing the second command while no macro is running will cause MQ2 to echo false, since the Option keyword has no meaning and isn't defined. Issuing the second command while a macro is running and MQ2 will spit out the "Flow ran into another subroutine" error. I'm not sure why, but it does. Again, make sure your EQ, MQ2, and plugin config files are synched between the two computers.

2. If you run a macro and the macro has a subroutine called DoStuff, you can trigger the "Flow ran into another subroutine" error by typing /call DoStuff into the command line. Don't do this! A big macro like modbot will use config files and aliases. The aliases are a convenient way to issue the /call DoStuff commands without error. Make sure the Vista box has those config files and alises or else it won't properly understand the command, which might lead to issue #1.

3. Sometimes a macro will randomly spit out the error when it has worked fine thousands of times before and after the error.
Thu May 03, 2012 1:21 pm
Senior Project Member
"Vista has many problems so it might be impossible to determine the exact cause. Make sure you install EQ in a "non-protected" directory. Same with MQ. Turn off or configure Vista Defender or whatever that infernal POS is called."


I think I got "all" of the Vista crap turned off so that my screen and everything looks almost like a stock XP box but I will recheck the background crap. Agree this is the worst damn OS ever....I think i still have a clean XP install at the house so I will prob do that.


"You didn't mention hardware specs of the Vista box. If they aren't a good bit higher than the XP box, then you will have the lag issues of the XP box. You can try disabling Aero and all the other resource hogging eye candy."


It is fairly basic and I cant remember exact specs but it is for sure an upgrade since i think i built the p4 comp 8 years ago. was still using a 8x agp card so i know the upgrade was atleast good there.

"Make sure your config files are also copied between boxes. An exact macro might behave differently if the MQ or plugin config file differs."


100% direct copies from box a to box b, and box a to box c.


"It's never a good idea to "upgrade" an OS over another one. Tabula Rasa. Start with a clean slate."


Agreed was a stupid question to even ask haha.

""Flow ran into another subroutine" - There are a couple different causes of this:

1. If you are running a macro and issue a MQ command that is sorta recognized but not fully recognized, this error message can trigger. For example, /echo ${EQBS.Setting[TellWatch]} is a valid command fully recognized (if you run MQ2EQBC plugn). Issuing this command results in no errors. However, the command /echo ${EQBS.Option[TellWatch]} isn't fully recognized but EQBC is a valid TLO object so it's sorta recognized. Issuing the second command while no macro is running will cause MQ2 to echo false, since the Option keyword has no meaning and isn't defined. Issuing the second command while a macro is running and MQ2 will spit out the "Flow ran into another subroutine" error. I'm not sure why, but it does. Again, make sure your EQ, MQ2, and plugin config files are synched between the two computers.

2. If you run a macro and the macro has a subroutine called DoStuff, you can trigger the "Flow ran into another subroutine" error by typing /call DoStuff into the command line. Don't do this! A big macro like modbot will use config files and aliases. The aliases are a convenient way to issue the /call DoStuff commands without error. Make sure the Vista box has those config files and alises or else it won't properly understand the command, which might lead to issue #1.

3. Sometimes a macro will randomly spit out the error when it has worked fine thousands of times before and after the error."


Yah with this one I will prob just have to post my macro to see if I have the terminology wrong. The macro works but will hang on that error or sometimes it will error multiple times while trying to get started.

Here is the macro I modified (Thanks Evan for the work), the only changes were I added my spells and my self buff items.

The macro seems to always hang at the "Sub Upkeepbuffs" and the Sub Main.... honestly have no idea what that means since the error points to the titles and not "line 144 has a error you idiot, fix it this way".

Is there a list of proper terms....like ${Me.ID} or ${Me.Pet.ID} or
${Me.CombatState.Equal[COMBAT]} && ${Combat} == 0 ......ect? Just seems like there should be a list hah.

Startup- /mac mage

Effect- sometimes it goes into upkeepbuffs....sometimes the first buff starts to cast and the macro dies right after that and i have to retype /mac mage...then it will finally hold for awhile.

Now on the laptop with XP i dont think i have encountered 1 error unless i tweaked the code and screwed something up.

I issues commands by /bc "bots assist" "bots follow" "bots stop" and everything seems pretty good but every once and awhile the bot will stop following since the macro died from a previous command.

This one has the spell_routines attached to the bottom and I wasnt sure if i should just add a #include to the top and use the one that is on this site.

Macro
More +
|===========================================================
|+|EmuMag v .4
|+|Macro for Mages on the emu server
|+|Still under heavy revision
|+|Target the Main Assist on Start up
|+|Common Commands:
|+|"bots follow" - The bot will target and follow
|+|"bots assist ${Target.ID}" - The bot will kill the target with the ID number you sent in the command
|+|Other commands can be found in the chat section and a few in the events.


#chat tell
#chat group



#event EQBC              "<#1#> #2#"
#event SayZone         "#*#sayzone #1#"
#event Invite          "#*#invites you to join a group#*#"
#event GateClick                "#*#click gate item#*#"
#event DoBuffs                  "#*#bots buff#*#"
#event Burn                             "#*#bots burn#*#"
#event AE                               "#*#bots AE#*#"
#event Assist                   "#*#bots assist #1#"
#event Shawl                    "<#1#> shawl me#*#"
#event Dead                             "#*#You have been slain by#*#"
#event Dead                             "Returning to Guild Lobby#*#"
#event Find                             "#*#finditem #1#"

|||||||||||||Spell Routines Events|||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event BeginCast "You begin casting#*#"
#event Collapse "Your gate is too unstable, and collapses.#*#"
#event FDFail "#1# has fallen to the ground.#*#"
#event Fizzle "Your spell fizzles#*#"
#event Immune "Your target is immune to changes in its attack speed#*#"
#event Immune "Your target is immune to changes in its run speed#*#"
#event Immune "Your target cannot be mesmerized#*#"
#event Interrupt "Your casting has been interrupted#*#"
#event Interrupt "Your spell is interrupted#*#"
#event NoHold "Your spell did not take hold#*#"
#event NoHold "Your spell would not have taken hold#*#"
#event NoHold "You must first target a group member#*#"
#event NoHold "Your spell is too powerful for your intended target#*#"
#event NoLOS "You cannot see your target.#*#"
#event NoTarget "You must first select a target for this spell!#*#"
#event NotReady "Spell recast time not yet met.#*#"
#event OutOfMana "Insufficient Mana to cast this spell!#*#"
#event OutOfRange "Your target is out of range, get closer!#*#"
#event Recover "You haven't recovered yet...#*#"
#event Recover "Spell recovery time not yet met#*#"
#event Resisted "Your target resisted the #1# spell#*#"
#event Resisted2 "You resist the #1# spell#*#"
#event Standing "You must be standing to cast a spell#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Sub Main

|||||||Buffs|||||||||||
/declare Buff1 string outer
/declare Buff2 string outer Phantasmal Warden
/declare BuffItem1 string outer Cloak of Endless Dreams
/declare BuffItem2 string outer Cord of Dark Bindings
/declare BuffItem3 string outer Thaumaturgist's Prismweave Gloves
/declare BuffItem4 string outer Woven Veil of Eternal Dreams
/declare buffgem int outer 7
/declare GroupHealItem string outer Immaculate Orb of Dreadspire


||||||||||||||Items|||||||||||||||||||
|+|All Recast timers in seconds. This is the Reuse timer listed on the item in game.
/declare BurnItem1 string outer Skull Visor of the Fallen Mage
/declare BurnItem2 string outer Thaumaturgist's Prismweave Robe
/declare GateItem string outer Contributor Charm of Magic Mastery
/declare NukeItem1 string outer Thaumaturgist's Prismweave Slippers
/declare NukeItemRecast1 int outer 23
/declare SealItem string outer Dark Seal of the Elementalist
/declare MaloItem string outer XXXXXXXXXXXXXXXXX
|/declare PetItemSpell2 string outer Summon Muzzle of Mowcha
/declare EpicClick string outer Blazing Staff of Elemental Mastery


||||||||||||||Spells||||||||||||||||||
/declare AESpell string outer Rain of Thunderbolts
/declare Nuke1 string outer Fickle Inferno
/declare Nuke2 string outer Bolt of Molten Slag
/declare MaloSpell string outer Malosinese

|||||||||||||Timers||||||||||||||||
/declare NukeItemTimer1 timer outer
/declare SealTimer timer outer

|||||||||||||Pet Stuff|||||||||
/declare UsePetFocus string outer FALSE
/declare PetSpell string outer Tomb of Draconic Summoning
/declare PetSpellItem string outer TRUE
/declare PetItemSpell1 string outer Discordant Conjurer Velvet Wristband
/declare PetGem int outer 5
/declare PetFocus string outer
/declare PetFocusSlot string outer

|||||||||||||Editable Variables|||||||||
/declare MySpellSet string outer 1
/declare UseNukeClicks string outer TRUE
/declare AutoSit string outer TRUE
/declare Nuke string outer TRUE
/declare EngageRad int outer 110
/declare UseMaloSpell string outer TRUE
/declare UseMaloItem string outer FALSE
/declare TotalNukeNumber int outer 2
/declare UseSeal string outer TRUE

/declare Follow int outer 0
/declare Combat int outer 0
/declare ZoneName string outer ${Zone.ShortName}
/declare UseRods int outer 0  |Use mage rods. 0=no, 1=yes
/declare MainAssist string outer ${Target.CleanName}
/declare Nuked string local TRUE
/makecamp off
/netbots on send on grab on
/makecamp radius 70

/echo Starting EmuMag


:Mainloop
/doevents
/if (!${Me.Gem[1].ID}) {
        /echo memming spell set
        /memspellset ${MySpellSet}
        /delay 5s
        /delay 1m !${Window[SpellBookWnd].Open}
        }
/if (${Me.Class.ShortName.Equal[Mag]} && !${Me.Pet.ID} && ${Follow} == 0 && !${Me.CombatState.Equal[COMBAT]} && ${Combat} == 0) {
        /if (${UsePetFocus}) {
                /echo Using pet focus item
                /declare OldFocusItem string local "${InvSlot[${PetFocusSlot}].Item.Name}" ${PetFocusSlot}
                /exchange "${PetFocus}" ${PetFocusSlot}
                /delay 1s
        }
        /if (!${PetSpellItem}) {
                /call Cast "${PetSpell}" gem${PetGem} 20s
                        } else {
                                /casting "${PetSpell}"|item
                                /delay 3s
                                /delay 20s !${Me.Casting.ID}
                                }
        /if (${UsePetFocus}) /exchange ${OldFocusItem}
        /if (${Defined[BuffT]}) /varset BuffT 0
        }
/if ((${Spawn[${Me.Pet}].Class.Name.Equal[Warrior]} || ${Spawn[${Me.Pet}].Class.Name.Equal[Rogue]} || ${Spawn[${Me.Pet}].Class.Name.Equal[Monk]}) && !${BuffT} && ${Follow} == 0 && !${Me.Combat}) /call UpkeepBuffs
/doevents
/if (${AutoSit} && (${Follow} != 1) && ${Me.PctMana} < 90 && ${Me.State.Equal[STAND]} && !${Me.Casting.ID}) /sit
/if (${Window[TradeWnd].HisTradeReady}) /notify TradeWnd TRDW_Trade_Button leftmouseup
/if (${Window[ConfirmationDialogBox].Open} && (!${Me.Gem[1].ID} || (${Me.Buff[1].ID} || ${Me.Buff[3].ID} || ${Me.Buff[6].ID} || ${Me.Buff[2].ID}))) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
/goto :Mainloop
/return

|===========================================================
Sub Event_Chat(ChatType,Sender,ChatText)
|/echo Sub Chat with Sender = ${Sender}. ChatType= ${ChatType}. ChatText= ${ChatText}
/if (${ChatText.Find[bots follow]}) {
/if (${Me.Casting.ID}) {
                /keypress duck
                delay 2
                /keypress duck
                }
        /keypress esc
        /pet hold
        /pet back
        /stand
        /varset Follow 1
        /tar ${Sender}
        /if (${MakeCamp.Status.Equal[ON]}) /makecamp off
        /delay 5
        /moveto ID
        /delay 5
        /stick 10 uw
        /bc Following [+y+]${Sender}
        /if (${Defined[Combat]}) /varset Combat 0
        }
/if (${ChatText.Find[bots stop]}) {
        /varset Follow 0
        /varset Combat 0
        /stick off
        /pet hold
        /pet back
        /keypress esc
        }
/if (${ChatText.Find[bots make camp]}) {
        /stick off
        /varset Follow 0
        /delay 5
        /makecamp on
        /makecamp leash 50
        /if (!${MakeCamp.Leash}) /makecamp leash
        /makecamp radius 50
        }
/if (${ChatText.Find[bots sit]}) {
        /stick off
        /sit
        }
/if (${ChatText.Find[coth me]} && ${Follow} != 1 &&  ) {
        /stick off
        /delay 5
        /tar ${Sender}
        /delay 1s
        /tt GET OVER HERE!
        /bc Cothing ${Target.CleanName}
        /call Cast "Call of the Hero" gem7 20s
        }
/if (${ChatText.Find[give pet weps]} && ${Follow} != 1) {
        /stick off
        /tar ${Sender}
        /delay 1s
        /echo ${Sender} wants me to give weps to ${Me.TargetOfTarget.CleanName}
        /target id ${Me.TargetOfTarget.ID}
        /delay 5
        /face
        /delay 5
        /moveto ID
        /delay 2s
        /bc Summoning pet weapons and giving to ${Target.CleanName}
        /call SumWeapons
        }
/return
|===========================================================
Sub Event_Assist(string Sender, int TID)
        /varset Combat 1
        /if (${Follow} == 1) {
                /varset ${Follow} 0
                /stick off
                /keypress esc
                }
        /if (${Me.Casting.ID}) {
                /keypress duck
                /delay 4
                /keypress duck
                }
        /if (${Me.Pet.ID}) {
                /pet hold
                /pet back
                }
        /target ID ${TID}
        /if (!${Defined[AssistID]}) /declare AssistID int outer
        /varset AssistID ${TID}

        /call Assist ${Sender}
/return

|===========================================================
Sub Assist(string Send,string MainAssist)
|/echo ${MainAssist} = MainAssist value. String = ${string}
/if (${Combat} != 1) /return
/delay 10
/if (${Target.Type.Equal[corpse]}) {
                /varset Combat 0
                /return
        }
/if (${Target.Distance} > ${EngageRad}) {
        /bc <<%T>> Out of camp range! Waiting 1m for it to enter CampRadius
                :waitloop
                /doevents
                /if (${Target.Distance} > ${EngageRad}) /goto :waitloop
        }
/if (${Target.ID} != ${AssistID}) {
                /varset Combat 0
                /bc Target and AssistID are different! Im not attacking ${Target.CleanName}
                /return
                }
/bc Attacking <<[+p+]${Target.CleanName}[+x+]>>
/call Combat
/return
|===========================================================
Sub Combat
/stand
/pet attack
/if (${UseMaloSpell}) /call Cast "${MaloSpell}" CheckT
/if (${UseMaloItem}) /call Cast "${MaloItem}" CheckT
/if (${SealTimer} == 0 && ${Target.Named} && ${UseSeal}) {
        /call Cast "${SealItem}" item
        /varset SealTimer 603s
        }
/face
/moveto ID
/delay 10s ${Target.MaxRangeTo} < ${Target.Distance}
/attack on
:loop
/if (!${Defined[i]})    /declare i int local
        /for i 0 to ${Group.GroupSize}
                /if (${Group.Member[${i}].Spawn.PctHPs} < 51) {
                        /if (!${Defined[GrpHeal]}) /declare GrpHeal int outer 0
                        /varset GrpHeal ${GrpHeal} + 1
                        }
                /next i
/if (${GrpHeal} >= 3 && !${GrpHealT}) {
        /g Mage casting group heal!!
        /call Cast "${GrpHealItem}" item
        /if (!${Defined[GrpHealT]}) /declare GrpHealT timer outer
        /varset GrpHealT 6m
        }
/if (!${Defined[Nuked]}) /declare Nuked string local FALSE
/if (${Target.ID} != ${AssistID}) {
                /if (${Target.ID} == ${Me.Pet.ID}) {
                        /target ID ${AssistID}
                        } else {
                /varset Combat 0
                /bc Target and AssistID are different! Im not attacking ${Target.CleanName}
                /pet hold
                /pet back
                /doevents Assist flush
                /if (${Burned}) {
                /say stop
                /varset Burned FALSE
                }
                /return
                }
        }
/doevents
/if (${Target.Type.Equal[corpse]} || !${Target.ID}) {
        /varset Combat 0
        /echo Leaving Combat
        /doevents chat flush
        /pet hold
        /pet back
        /if (${Burned}) {
                /say stop
                /varset Burned FALSE
                }
        /return
        }
/if (${Follow} == 1) /return
/if (${Target.CleanName.Equal[${MainAssist}]}) {
        /varset Combat 0
        /echo I don't want to attack my MainAssist!
        /doevents chat flush
        /stick off
        /if (${Burned}) {
                /say stop
                /pet hold
                /pet back
                /varset Burned FALSE
                }
        /return
        }
/if (!${Me.Combat}) /attack on
/if (${Me.Feigning}) /stand
/doevents
/if (${TotalNukeNumber} <= 2) /call Nuke1
/doevents
/if (${TotalNukeNumber} <= 3) /call Nuke2
/goto :loop
/return

|===========================================================
Sub Nuke1
/if (${Me.Feigning}) /stand
/if (${Nuke} && ${Me.SpellReady[${Nuke1}]} && (${Me.PctMana} > 10) && !${Me.Casting.ID} && ${Combat} == 1) {
        /tar id ${AssistID}
        /delay 1s ${Target.ID} == ${AssistID}
        /call Cast "${Nuke1}" CheckT
        }
/if (${UseNukeClicks} && ${NukeItemTimer1} == 0) {
        /call Cast "${NukeItem1}" item CheckT
        /varset NukeItemTimer1 ${NukeItemRecast1}s
        }
/delay 15 ${Me.SpellReady[${Nuke2}]}
/return
|===========================================================
Sub Nuke2
/if (${Me.Feigning}) /stand
/if (${Nuke} && ${Me.SpellReady[${Nuke2}]} && (${Me.PctMana} > 10) && !${Me.Casting.ID} && ${Combat} == 1) {
        /tar id ${AssistID}
        /delay 1s ${Target.ID} == ${AssistID}
        /call Cast "${Nuke2}" CheckT
        }
/if (${UseNukeClicks} && ${NukeItemTimer1} == 0) {
        /call Cast "${NukeItem1}" item CheckT
        /varset NukeItemTimer1 ${NukeItemRecast1}s
        }
/delay 15 ${Me.SpellReady[${Nuke1}]}
/return
|===========================================================
Sub Event_Burn
/bc Burning [+g+]${Target.CleanName}!!!
/if (!${Defined[Burned]}) /declare Burned string outer
/if (${Me.Feigning}) /stand
/say elemental rage
/alt activate 59
/delay 18
/casting "${BurnItem2}"|item
/delay 20s !${Me.Casting.ID}
/call Cast "Blazing Stance" gem5 15s
/delay 5
/casting "${BurnItem1}"|item
/delay 20s !${Me.Casting.ID}
/tar ${AssistID}
/varset Burned TRUE
/return
|===========================================================
Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
    /call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
/return

|===========================================================
Sub Event_SayZone(string Sender,string ZoneText)
  /if (${Stick.Status.Equal[ON]}) /squelch /stick off
|  /squelch /assist ${Sender}
/assist ${MainAssist}
/delay 15
  /squelch /face fast nolook
  /delay 10
  /if (${Target.ID}) /stick 7
  /delay 1s
  /if (${ZoneText.Equal[hail]}) {
        /h
  } else {
    /say ${ZoneText}
  }
  /makecamp off
/return

|===========================================================
Sub Event_Invite
/invite
/return
|===========================================================
Sub Event_GateClick
/stand
/echo Made it to gateclick
/call Cast "${GateItem}" item 5s
/delay 4s
/return

|===========================================================
Sub Event_DoBuffs
        /stand
        /bc Buffing
        /declare OldItem string local "${InvSlot[shoulder].Item.Name}" shoulder
        /exchange "Aenda's Woven Shawl" shoulder
        /tar ${MainAssist}
        /delay 1s
        /call Cast "${Buff1}" gem${buffgem} 5s
        /casting "${BuffItem1}|item
        /delay 20s !${Me.Casting.ID}
        /casting "${BuffItem2}|item
        /delay 20s !${Me.Casting.ID}
        /casting "${BuffItem3}|item
        /delay 20s !${Me.Casting.ID}
        /casting "${BuffItem4}|item
        /delay 20s !${Me.Casting.ID}
        /call Cast "${Buff2}" gem${buffgem}
        /tar ${Me.Pet.CleanName}
        /delay 3
        /call Cast "${EpicClick}" item
        /exchange ${OldItem}
/return

|===========================================================
Sub Event_Sit
/dismount
/sit
/return
|===========================================================
Sub UpkeepBuffs
/stand
/bc Im in UpKeepbuffs
/declare OldItem string local "${InvSlot[shoulder].Item.Name}" shoulder
/bc ${OldItem}
/exchange "Aenda's Woven Shawl" shoulder
/if ((${Spawn[${Me.Pet}].Class.Name.Equal[Warrior]} || ${Spawn[${Me.Pet}].Class.Name.Equal[Rogue]} || ${Spawn[${Me.Pet}].Class.Name.Equal[Monk]}) && !${BuffT}) {
        /if (!${Defined[BuffT]}) /declare BuffT timer outer
        /tar ${Me.Pet}
        /call Cast "Burnout VII" gem8 10s
        /call Cast "Elemental Simulcram" gem8 10s
        /delay 2
        /casting "${EpicClick}"|item
        /delay 20s !${Me.Casting.ID}
        /varset BuffT 80m
        }
/call Cast "${BuffItem1}" item
/exchange ${OldItem}
/bc Done with UpKeep
/return
|===========================================================
Sub CheckT
/doevents chat
/if (${Combat} == 0) {
        /keypress duck
        /delay 2
        /keypress duck
        /keypress esc
        /return
        }
/if (!${Target} || ${Target.Type.Equal[corpse]}) {
        /keypress duck
        /delay 2
        /keypress duck
        /keypress esc
        /return
        }
/return
|===========================================================



|===========================================================
Sub Event_AE
/assist ${MainAssist}
/delay 4
/bc AEING ${Target.CleanName} !!! Heal my ass!
/call Cast "${AESpell}" gem7 5s
/return
|===========================================================

|===========================================================
Sub SumWeapons

/if (!${Target.Type.Equal[pet]}) /return
/declare targ int local ${Target.ID}
/declare i int local
/for i 1 to 2
        /if (${PetItemSpell${i}.Equal[Thaumaturgist's Prismweave Wristband]} || ${PetItemSpell${i}.Equal[Discordant Conjurer Velvet Wristband]}) {
                        /call Cast "${PetItemSpell${i}}" item 10s
                        /call GiveToPet
                        /call Cast "${PetItemSpell${i}}" item 10s
                        /call GiveToPet
                        } else {
        /call Cast "${PetItemSpell${i}}" gem5 25s
|       /if (${PetItemSpell${i}.Equal[Summon Muzzle of Mowcha]}) {
|               /delay 5
|               /autoinventory
|
|               /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} rightmouseup
|               /delay 5
|               /echo ${FindItem[Glowing].InvSlot.ID}
|               /itemnotify ${FindItem[Summoned: Muzzle of Mowcha].InvSlot.ID} leftmouseup
|               /target id ${targ}
|               /call GiveToPet
|}     
        /if (${PetItemSpell${i}.Equal[Summon Plate of the Prime]}) {
                /delay 5
                /autoinventory

                /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} rightmouseup
                /delay 5

                /itemnotify ${FindItem[Summoned: Prime Belt].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Helm].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Vambraces].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Gauntlets].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Boots].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Bracers].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Breastplate].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

                /itemnotify ${FindItem[Prime Plate Greaves].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet
       
                /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet

        } else /if (${PetItemSpell${i}.Equal[Summon Elemental Armaments]}) {
                /delay 5
                /autoinventory

                /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} rightmouseup
                /delay 5

                /if (${Target.Class.Name.Equal[Rogue]} || ${Target.Race.Name.Equal[Spectre]} ) {
                        /itemnotify ${FindItem[Summoned: Icefall Icicle].InvSlot.ID} leftmouseup
                        /target id ${targ}
                        /call GiveToPet
                        /delay 5
                        /itemnotify ${FindItem[Summoned: Windwoven Dreamcatcher].InvSlot.ID} leftmouseup
                        /target id ${targ}
                        /call GiveToPet
                        /delay 5
                        /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} leftmouseup
                        /delay 5
                        /destroy
                }
                { else {
                        /itemnotify ${FindItem[Summoned: Windwoven Dreamcatcher].InvSlot.ID} leftmouseup
                        /target id ${targ}
                        /call GiveToPet
                        /delay 5
                        /itemnotify ${FindItem[Summoned: Windwoven Dreamcatcher].InvSlot.ID} leftmouseup
                        /target id ${targ}
                        /call GiveToPet
                        /delay 5
                        /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} leftmouseup
                        /delay 2s
                        /destroy
                }
                         
        } else /if (${PetItemSpell${i}.Equal[Summon Nastel's Heirlooms]}) {
                /delay 5
                /autoinventory
               
                /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} rightmouseup
                /delay 5

                /itemnotify ${FindItem[Nastel's Jade Bracelet].InvSlot.ID} leftmouseup
                /target id ${targ}
                /call GiveToPet
                /itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} leftmouseup
                /delay 2s
                /destroy
                       
        } else {
        /target id ${targ}
        /call GiveToPet
        }
}
}
/next i
/return
|===========================================================
Sub GiveToPet
/declare i int local
:give_item
/delay 5 ${Cursor.ID}
/if (${Cursor.ID} && !${InvSlot[trade4].Item.ID}) {
        /if (${Cursor.Name.Find[summoned:]} || ${Cursor.Name.Find[prime]} || ${Cursor.Name.Find[phantom satchel]} || ${Cursor.Name.Find[Nastel's Jade Bracelet]}) {
                /click left target
                /delay 1s ${InvSlot[trade${i}].Item.ID}
        } else {
                /call ClearCursor
        }
        /goto :give_item
}
/for i 1 to 4
|       /if ( ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[prime]} ) && ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[Phantom Satchel]}) && ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[summoned:]}) ) /nomodkey /notify GiveWnd GVW_Cancel_Button leftmouseup
        /if ( ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[prime]} ) && ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[Phantom Satchel]}) && ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[summoned:]}) && ( ${InvSlot[trade${i}].Item.ID} && !${InvSlot[trade${i}].Item.Name.Find[Nastel's Jade Bracelet]} ) ) /nomodkey /notify GiveWnd GVW_Cancel_Button leftmouseup
/next i
/if (${Window[GiveWnd].Open}) /nomodkey /notify GiveWnd GVW_Give_Button leftmouseup
/delay 5s !${Window[GiveWnd].Open}
/return
|===========================================================
Sub Event_Shawl(string Sender, string ShawlID)
/target ${ShawlID}
/delay 1s
/if (${Target.Body.Name.NotEqual[Humanoid]}) {
        /bc ${Taget.CleanName} is not a pc. Leaving
        /return
        }
/call Cast "Summon Aenda's Trinkets" gem5 25s
/delay 5
/autoinventory
/delay 5
/itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} rightmouseup
/delay 5
/itemnotify ${FindItem[Aenda's Woven Shawl].InvSlot.ID} leftmouseup
/delay 5
/target ${ShawlID}
/delay 5
/face fast
/moveto ID
/delay 7s (${Target.Distance} < 15)
/click left target
/delay 1s ${Window[TradeWnd].Open}
/if (${Window[GiveWnd].Open}) /nomodkey /notify GiveWnd GVW_Give_Button leftmouseup
/if (${Window[TradeWnd].Open}) /nomodkey /notify TradeWnd TRDW_Trade_Button leftmouseup
/delay 2s !${Window[TradeWnd].Open}
/itemnotify ${FindItem[Phantom Satchel].InvSlot.ID} leftmouseup
                /delay 2s
                /destroy
/return
|===========================================================
Sub Event_Dead
/declare CZone string local ${Me.ZoneName}
/declare i int local
/varset Combat 0
/varset Follow 0
/for i 0 to ${Group.GroupSize}
        /consent ${Group.Member[${i}]}
        /delay 20
        /next i
/BC rezz me
/g I'm dead! waiting for rez indefinitely
/memspellset ${MySpellSet}
/delay 1m !${Window[SpellBookWnd].Open}
/if (${Me.Class.ShortName.Equal[Mag]} && !${Me.Pet.ID} && ${Follow} == 0 && !${Me.CombatState.Equal[COMBAT]} && ${Combat} == 0) {
        /if (${UsePetFocus}) {
                /echo Using pet focus item
                /declare OldFocusItem string local "${InvSlot[${PetFocusSlot}].Item.Name}" ${PetFocusSlot}
                /exchange "${PetFocus}" ${PetFocusSlot}
                /delay 1s
        }
        /if (!${PetSpellItem}) {
                /call Cast "${PetSpell}" gem${PetGem} 20s
                        } else {
                                /casting "${PetSpell}"|item
                                /delay 3s
                                /delay 20s !${Me.Casting.ID}
                                }
        /if (${UsePetFocus}) /exchange ${OldFocusItem}
        /if (${Defined[BuffT]}) /varset BuffT 0
        }
/tar ${Me.Pet.CleanName}
/call Cast "${EpicClick}" item
/call Cast "Burnout VII" gem8 10s
:loop
/if (${Window[ConfirmationDialogBox].Open}) {
        /doevents flush
        /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
        /delay 2m !${Me.ZoneName.NotEqual[${CZone}]}
        /return
        }
/goto :loop
/return
|=================================================
Sub Event_Find(string Nothing, string Text)
/bc [+r+]BANK:[+x+]${FindItemBank[${Text}]} in ${FindItemBank[${Text}].InvSlot.Pack} in ${FindItemBank[${Text}].InvSlot.Slot} with ${FindItemBank[${Text}].Stack} in the stack
/bc [+g+]ON ME:[+x+]${FindItem[${Text}]} in ${FindItem[${Text}].InvSlot.Pack} in ${FindItem[${Text}].InvSlot.Slot} with ${FindItem[${Text}].Stack} in the stack
/return

































|Spell routines inc file

Sub Cast(spellName,spellType,giveUpValue,mySub,int ResistTotal)
/declare castTime float local
/if (!${Defined[castReturn]}) /declare castReturn string outer CAST_CANCELLED
/if (${Me.Invis} && ${noInvis}) /return
/if (${spellType.Equal[item]}) {
/if (${FindItem[${spellName}].InvSlot} != 0) {
  /if (!${FindItem[${spellName}].InvSlot}) /return CAST_UNKNOWNSPELL
}
  /varset castTime ${FindItem[${spellName}].CastTime}
} else /if (${spellType.Equal[alt]}) {
  /if (!${Me.AltAbilityReady[${spellName}]}) /return CAST_NOTREADY
  /varset castTime ${Me.AltAbility[${spellName}].Spell.MyCastTime}
} else {
  /if (!${Me.Book[${spellName}]}) /return CAST_UNKNOWNSPELL
  /declare spellID int local ${Me.Book[${Me.Book[${spellName}]}].ID}
  /varset castTime ${Spell[${spellName}].MyCastTime}
  /if (${Me.CurrentMana}<${Spell[${spellID}].Mana}) /return CAST_OUTOFMANA
}
/if (${castTime}>0.1) {
  /if (${Stick.Status.Equal[ON]}) /stick pause
  /if (${FollowFlag}) /call PauseFunction
  /if (${Me.Moving}) /keypress back
}
/if (!${Defined[spellType]}) /declare spellType string local spell
/if (!${Defined[spellRecastTime1]}) {
  /if (!${Defined[noInterrupt]}) /declare noInterrupt int outer 0
  /declare ResistCounter int outer
  /declare moveBack bool outer false
  /declare selfResist int outer
  /declare selfResistSpell string outer
  /declare giveUpTimer timer outer
  /declare castEndTime timer outer
  /declare refreshTime timer outer
  /declare itemRefreshTime float outer
  /declare i int local
  /declare spellNotHold int outer
  /delay 5
  /for i 1 to 9
  /declare spellRecastTime${i} timer outer
  /if (${Me.SpellReady[${i}]}) {
    /varset spellRecastTime${i} 0
  } else {
    /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
  }
  /next i
}
/if (${Defined[giveUpValue]}) /varset giveUpTimer ${giveUpValue}
/if (${Defined[ResistTotal]}) /varset ResistCounter ${ResistTotal}
/varset spellNotHold 0
/varset selfResist 0
:wait_for_stop
/if (${Me.Casting.ID} || (${Me.Moving} && ${castTime}>0.1)) {
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /goto :wait_for_stop
}
/if (${Window[SpellBookWnd].Open}) /keypress spellbook
/if (${Me.Ducking}) /keypress duck
/call DoCastingEvents
/varset castReturn X
/if (${spellType.Equal[item]}) /call ItemCast "${spellName}" "${mySub}"
/if (${spellType.Equal[alt]}) /call AltCast "${spellName}" "${mySub}"
/if (${spellType.NotEqual[item]} && ${spellType.NotEqual[alt]}) /call SpellCast "${spellType}" "${spellName}" "${mySub}" "${spellID}" "${giveUpValue}"
/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
/if (${PauseFlag}) /call PauseFunction
/varset giveUpTimer 0
/varset ResistCounter 0
/return ${castReturn}

Sub SpellCast(spellType,spellName,mySub,int spellID,giveUpValue)
:cast_spell
/if (!${Me.Gem[${spellName}]}) {
  /if (${Cursor.ID}) /call ClearCursor
  /if (${spellType.Left[3].Equal[gem]}) {
    /memspell ${spellType.Right[1]} "${spellName}"
        /delay 4s
        /delay 10s !${Window[SpellBookWnd].Open}
  } else {
    /return CAST_NOTMEMMED
  }
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /delay 6s ${Me.Gem[${spellName}]}
  /if (${Me.Gem[${spellName}]}) /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
  /if (!${Me.Gem[${spellName}]}) /return CAST_INTERRUPTED
  :wait_for_mem
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /delay 15s ${Me.SpellReady[${spellName}]}
  /if (!${Me.SpellReady[${spellName}]}) {
    /if (${giveUpTimer}) /goto :wait_for_mem
    /return CAST_NOTREADY
  }
}
/varset spellType spell
/if (${spellName.Find[illusion: ]} && ${Me.AltAbilityReady[project illusion]}) /call Cast "project illusion" alt
/varset giveUpTimer ${giveUpValue}
/declare recoverWaitTime timer local 30
:cast_spell_loop
/if (!${Me.SpellReady[${spellName}]} && (${spellRecastTime${Me.Gem[${spellName}]}}<${giveUpTimer} || ${refreshTime}>0 || ${castReturn.Equal[CAST_RESISTED]})) {
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /goto :cast_spell_loop
} else {
  /if (!${Me.SpellReady[${spellName}]} && !${castReturn.Equal[CAST_RESISTED]}) /return CAST_NOTREADY
}
/cast "${spellName}"
/if (${Me.Casting.ID}) {
  /varset spellID ${Me.Casting.ID}
  /varcalc castEndTime ${Me.Casting.MyCastTime}*10
  /if (${castEndTime}<${Math.Calc[${Me.Casting.CastTime}*5]}) /varcalc castEndTime ${Me.Casting.CastTime}*5
}
/varset moveBack false
/call WaitCast ${mySub} ${spellID}
/if (${moveBack}) {
  /keypress back hold
  /delay 4
  /keypress back
  /delay 15 !${Me.Moving}
}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (!${castReturn.Equal[CAST_SUCCESS]}) {
  /if (${castReturn.Equal[CAST_RECOVER]}) {
    /if (!${recoverWaitTime}) {
      /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
      /if (!${giveUpTimer}) /return CAST_NOTREADY
    }
    /goto :cast_spell_loop
  }
  /if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || ${castReturn.Equal[CAST_FIZZLE]} || ${castReturn.Equal[CAST_COLLAPSE]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_spell_loop
}
/if (!${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} && !${castReturn.Equal[CAST_INTERRUPTED]}) {
  /varcalc refreshTime 10*${Spell[${spellID}].RecoveryTime}
  /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
}
/return

Sub ItemCast(spellName,mySub)
/declare charges int local
/declare oldItemName string local
/declare slotName string local
/declare swapItemBack bool local false
:cast_item
/if (${FindItem[${spellName}].InvSlot}>21) {
  /varset swapItemBack true
  /if (${FindItem[${spellName}].WornSlot[1]} && ${FindItem[${spellName}].EffectType.Find[worn]}) {
    /varset slotName ${FindItem[${spellName}].WornSlot[1].Name}
  } else /if (${FindItem[${spellName}].InvSlot}>29) {
    /varset slotName pack8
  } else {
    /varset slotName ${FindItem[${spellName}].InvSlot.Name}
  }
  /varset oldItemName ${InvSlot[${slotName}].Item.Name}
  /call SwapItem "${spellName}" ${slotName}
}
:wait_item_loop
/if (${itemRefreshTime}>${MacroQuest.Running}) /goto :wait_item_loop
/varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+000]}
/varset charges ${FindItem[${spellName}].Charges}
/cast item "${spellName}"
/if (${Me.Casting.ID}) /varcalc castEndTime ${FindItem[${spellName}].CastTime}*10
/if (${charges}) /delay 1s ${FindItem[${spellName}].Charges}!=${charges}
/call WaitCast ${mySub}
/if (${swapItemBack} && ${FindItem[${oldItemName}].ID}) /call SwapItem "${oldItemName}" ${slotName}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || ${castReturn.Equal[CAST_COLLAPSE]} || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_item
/return

Sub AltCast(spellName,mySub)
:cast_alt
/alt activate ${Me.AltAbility[${spellName}].ID}
/if (${Me.AltAbility[${spellName}].Spell.MyCastTime}>=0.5) /delay 1s ${Me.Casting.ID}
/call WaitCast ${mySub}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_alt
/return

Sub ClearCursor
/declare i int local
:auto_inv
/if (${Cursor.ID}) {
  /if (${Cursor.Container}) {
    /for i 1 to 8
    /if (!${InvSlot[pack${i}].Item.Container}) /nomodkey /itemnotify pack${i} leftmouseup
    /next i
  } else {
    /autoinventory
  }
  /goto :auto_inv
}
/return

Sub DoCastingEvents
/doevents Recover
/doevents BeginCast
/doevents Fizzle
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents Collapse
/doevents NoTarget
/doevents NotReady
/doevents NoHold
/return

Sub EquipItem(WhatWhere)
/declare DestName string local
/declare ItemName string local ${WhatWhere.Arg[1,|]}
/declare SlotName string local ${WhatWhere.Arg[2,|]}
/if (${SlotName.Equal[NULL]}) /varset SlotName ${InvSlot[${FindItem[=${ItemName}].WornSlot[1]}].Name}
/if (${FindItem[=${ItemName}].InvSlot}<22 || !${FindItem[=${ItemName}].WornSlot[${SlotName}]}) /return
/if (!${InvSlot[${SlotName}].Item.Name.Equal[NULL]}) /varset DestName "${InvSlot[${SlotName}].Item.Name}|${SlotName}"
/call SwapItem "${ItemName}" "${SlotName}"
/return ${DestName}

Sub Interrupt
/if (${Me.Mount.ID}) /dismount
/stopcast
/if (${Defined[castReturn]}) /varset castReturn CAST_CANCELLED
/return ${castReturn}

Sub SwapItem(itemName,slotName)
/declare i int local
/if (${Cursor.ID}) /call ClearCursor
/exchange "${itemName}" ${slotName}
/delay 5s ${InvSlot[${slotName}].Item.Name.Equal[${itemName}]}
/if (${Cursor.ID}) /call ClearCursor
/return

Sub WaitCast(mySub,int spellID)
/declare currentTarget int local ${Target.ID}
/declare currentTargetType string local ${Target.Type}
:wait_cast_loop
/if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
/if (${Me.Casting.ID}) {
  /if (${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]}) {
    /if (!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} && (!${Me.Mount.ID} || !${noInterrupt})) {
      /if (!${Me.Mount.ID} || ${castEndTime}>70) {
        /call Interrupt
      } else /if (${Me.Casting.RecastTime}>3) {
        /varset castReturn CAST_CANCELLED
        /keypress forward hold
        /delay 6
        /keypress forward
        /varset moveBack true
      }
    }
  }
  /if (${Me.State.Equal[DUCK]}) /varset castReturn CAST_CANCELLED
  /goto :wait_cast_loop
}
/return

Sub Event_BeginCast
/if (${Defined[castReturn]}) /varset castReturn CAST_SUCCESS
/return

Sub Event_Collapse
/if (${Defined[castReturn]}) /varset castReturn CAST_COLLAPSE
/varset giveUpTimer 200
/return

Sub Event_FDFail(line,name)
/if (${name.Equal[${Me.Name}]} && ${Defined[castReturn]}) {
  /if (!${Me.Standing}) /stand
  /varset castReturn CAST_RESTART
}
/return

Sub Event_Fizzle
/if (${Defined[castReturn]}) /varset castReturn CAST_FIZZLE
/return

Sub Event_Immune
/if (${Defined[castReturn]}) /varset castReturn CAST_IMMUNE
/return

Sub Event_Interrupt
/if (${Defined[castReturn]}) /varset castReturn CAST_INTERRUPTED
/return

Sub Event_NoHold
/if (${Defined[spellNotHold]}) /varset spellNotHold 1
/return

Sub Event_NoLOS
/if (${Defined[castReturn]}) /varset castReturn CAST_CANNOTSEE
/return

Sub Event_NoTarget
/if (${Defined[castReturn]}) /varset castReturn CAST_NOTARGET
/return

Sub Event_NotReady
/if (${Defined[castReturn]}) /varset castReturn CAST_NOTREADY
/return

Sub Event_OutOfMana
/if (${Defined[castReturn]}) /varset castReturn CAST_OUTOFMANA
/return

Sub Event_OutOfRange
/if (${Defined[castReturn]}) /varset castReturn CAST_OUTOFRANGE
/return

Sub Event_Recover
/if (${Defined[castReturn]}) /varset castReturn CAST_RECOVER
/return

Sub Event_Resisted(line,name)
/if (${selfResist} && ${name.Equal[${selfResistSpell}]}) /varset selfResist 0
/if (${ResistCounter}) /varcalc ResistCounter ${ResistCounter}-1
/if (${Defined[castReturn]}) /varset castReturn CAST_RESISTED
/return

Sub Event_Resisted2(line,name)
/if (${Defined[selfResist]}) {
  /varset selfResist 1
  /varset selfResistSpell ${name}
}
/return

Sub Event_Standing
/stand
/if (${Defined[castReturn]}) /varset castReturn CAST_RESTART
/return

Sub Event_Stunned
/if (${Me.Stunned}) {
  /delay 3s !${Me.Stunned}
} else {
  /delay 7
}
/if (${Defined[castReturn]}) /varset castReturn CAST_STUNNED
/return



Thanks much again guys

Mod Edit: learn and use the buttons on the top of the window for quotes and code syntax
Thu May 03, 2012 3:15 pm
I think I got "all" of the Vista crap turned off so that my screen and everything looks almost like a stock XP box but I will recheck the background crap. Agree this is the worst damn OS ever....I think i still have a clean XP install at the house so I will prob do that.

Not just the visual stuff, but the anti-PEBKAC code. Defender or UAC or whatever Vista uses.

The things I see should cause the macro to misbehave on the XP machine as well as the Vista machine.

Macro
More +
/casting "${EpicClick}"|item


I'm not sure that's valid syntax. Try something like:
Macro
More +
/casting "Fabled Journeyman's Boots" item
/casting 68239|item
/casting "Shrunken Goblin Skull Earring" leftear

The Event_DoBuffs sub will also have issues since it uses the same basic format (but it leaves off the trailing "). It's probably just an undocumented format.


You might try adding a check to see if the epic click timer is ready. Below is the code to check for mod rod timer and cast if it's ready. Edit the name and item ID# to suit the epic or any other item with a cast timer.

Macro
More +
/if (${Cast.Ready[Rod of Mystical Transvergence]}) {
        /casting 3426|mainhand
}


I'm not familiar with the Cloak of Endless Dreams and it's not in this database nor Alla's. If it's a shoulder item, it may interfere with the exchange of Aenda's Woven Shawl and the original shoulder item.

Also, casting the spell from Cloak of Endless Dreams isn't inside the /if block like the rest of the sub. You are casting Cloak of Endless Dreams without changing targets. You are potentially casting that spell without a pet. Even worse, you are potentially casting an item (exchanging) before the previous exchange command has finished. That's usually a recipe for item deletion. It can very possibly cause an error in /call Cast.
Fri May 04, 2012 1:19 am
Senior Project Member
Mod Edit: learn and use the buttons on the top of the window for quotes and code syntax


Egad sorry about that...

Not just the visual stuff, but the anti-PEBKAC code. Defender or UAC or whatever Vista uses.

The things I see should cause the macro to misbehave on the XP machine as well as the Vista machine.


I am dropping the computer to its knees this weekend and adding a fresh install of XP to it. Not sold on Win7 but only because I havent spent much time on it. I put my standard setup with 2 boxes per comp last night and the vista box did its same old crap. Ran all 4 boxes on old machine with a striped global load to kill lag and not one macro drop all night. So I am sure Vista has a hidden gremlin I didnt kill so instead of hunting for the mythical fix ill kill the whole thing.

Macro

/casting "${EpicClick}"|item


I'm not sure that's valid syntax. Try something like:


I am not sure if it matters but the "EpicClick" item is /declared up top in the macro. I think the guy who built that mac was trying to use the /declare area like an .ini so you could just edit the epic name and be done and not worry about the individual line down below.


I'm not familiar with the Cloak of Endless Dreams and it's not in this database nor Alla's. If it's a shoulder item, it may interfere with the exchange of Aenda's Woven Shawl and the original shoulder item.

Also, casting the spell from Cloak of Endless Dreams isn't inside the /if block like the rest of the sub. You are casting Cloak of Endless Dreams without changing targets. You are potentially casting that spell without a pet. Even worse, you are potentially casting an item (exchanging) before the previous exchange command has finished. That's usually a recipe for item deletion. It can very possibly cause an error in /call Cast.


Cloak of Endless dreams is a unique item to Stormhaven I think and is a clickie for an enchanter spell. This is just a template macro and I moved that back into the /If command on mine and added a 1s delay to the very end of the macro just prior to the /exchange old to keep from killing the macro/game crash when casting and exchanging.

The Event_DoBuffs sub will also have issues since it uses the same basic format (but it leaves off the trailing "). It's probably just an undocumented format.


Is there a Document somewhere that shows formats? I have gained all the formats I use from other macros and not really any formal documents. I have read the Mq2 and Emulator wiki for how to use the formats but not what words go where.

Example
/if (${AutoSit} && (${Follow} != 1) && ${Me.PctMana} < 90 && ${Me.State.Equal[STAND]} && !${Me.Casting.ID}) /sit


I would have no idea where they came up with ${Me.State.Equal[STAND]}

I understand once I see it
Me = Me
State=what i am doing when the macro calls
Equal = duh
and [STAND] = checking my game position.

Get it all when its in front of me but I have no idea where it comes from to start writting a macro.

Thanks again Grumble
Fri May 04, 2012 2:11 pm
Is there a Document somewhere that shows formats? I have gained all the formats I use from other macros and not really any formal documents. I have read the Mq2 and Emulator wiki for how to use the formats but not what words go where.


Straight from the horses mouth: http://www.macroquest2.com/wiki/index.php/Main_Page.

Top Level Objects (TLOs) are the built in variables like Me, Spawn, Group, Target, Window, etc. Plugins have their own TLO's which can be found on the wiki entry for the plugin.

Not all features are documented. Not all documented features work on all clients and MQ2 versions.

I am not sure if it matters but the "EpicClick" item is /declared up top in the macro. I think the guy who built that mac was trying to use the /declare area like an .ini so you could just edit the epic name and be done and not worry about the individual line down below.


The declaration is fine, but the format may not be.

Try changing
/casting "${EpicClick}"|item
to
/casting "${EpicClick}" item
or
/casting "${EpicClick}|item"
It's the closing parenthesis in the middle of a string that might mess things up. MQ2Cast might be reading "|item" as the spell type instead of "item." "item" is defined and works. "|item" is undefined and might cause issues.
Fri May 04, 2012 4:48 pm
Senior Project Member
Update
Just an update for the Vista box-

Tried a couple more things and then took the box to the ground and installed a new xp pro copy.

Amazinly enough I had one macro die out from an error I made in a code adjustment. Otherwise they worked perfectly.

I am adjusting them all like you recomended for the possible syntax issue and than I am thinking I need need some tweaks to make it right.

Thanks much Grumble the help is much appriciated.
Mon May 07, 2012 12:41 pm
I didn't keep up with this thread but I noticed you saying you weren't sold on win 7 yet. I just anted to say its amazing. I'd put it right next to XP in quality and reliability. If you have access to someone with a college email you can get a copy in the cheap too.
Mon May 07, 2012 11:18 pm
Project Lead
I only use iOS, OSX, & Win 7.

Every time I go to a client where I have to use XP, I cry.
_________________
Sorvani
Tue May 08, 2012 2:09 pm
Senior Project Member
Haha Sorvani I was thinking the same thing only about Win 7 vrs XP. I hadnt done any windows 7 at all until this new laptop and it was like a monkey fu-king a football at first. I had no idea what the hell i was looking at. Now that I am used to it I def like Win7. However I am also cursed with cheap skate itis and dont want to spend money on something that isnt broke ....so to speak.

Thanks again for the help guys 8)
Tue May 08, 2012 2:27 pm
Errors Vista causing macros to "Flow ran into another subrouti
Reply