Moderator: MacroQuest Developers


Code: Select all
/declare ManaRobe outer
/varset ManaRobe Mana Robe
Code: Select all
/declare Manarobe string outer Mana Robe
Code: Select all
/call item "Discordant Leggings of Betrayal"
$(Me.Buff[Aura of Eternity].Duration.TotalSeconds)
Code: Select all
/declare ClickyFTItem string outer Discordant Leggings of Betrayal
/declare ClickyFTBuff string outer Aura of Eternity
/call item ${ClickyFTItem}
$(Me.Buff[${ClickyFTBuff}].Duration.TotalSeconds)

You're absolutely correct about this. The easiest (but less clean) solution would be for you to do a search and replace of all instances of a given buff name and replace it with something else. The other solution is to call the buff name out just once at the beginning of the code as a string name and then have that string referenced in all the code. However, you still have to replace the buff name at least once, so you may as well do a global search and replace. That said, when I have some time to look at it, I will probably do as you suggested only because I'm anal retentive that way. :)There are several places right away where the macro is checking for very specific buffs and items. I know there are really cool ways to get around it
I think I understand what you're asking, so I'll answer this in two different parts.what and where insert a code for cast gem 5 between each manarobe cast ? for long mob ) ?
for do in game
manarobe nuke manarobe nuke mana nuke mana nuke ?

Hi Flabbie,great effort ..at least I think so but it doesn't quite work for me at this point in time.
I have a fabled mana robe as opposed to the regular one..also I have a different rune device...I use the Wand of Impenetrable Force when robing. I also use a different regular primary and a different regular chest piece.
When I looked to change your variables to match my setup, I noticed that you have seperate variable declarations from the assigning the value.
For example you could consolidate your
Code:
/declare ManaRobe outer
/varset ManaRobe Mana Robe
into
Code:
/declare Manarobe string outer Mana Robe
Although that's just a preference for myself, it seems to be a popular practice on a lot of macros here.
However, I also noticed that you didn't use "string" in your declaration of the varaiables that named your various armor gear and that caused lots of errors for me...which disappeared after adding "string" into the line before the "outer".
Anyhoo, keep up the good work and I look forward to seeing more from this macro =)[/code]

Code: Select all
/declare AuxManaItem outer "Garter Belt of Minor Crack"Code: Select all
/declare AuxManaItem string outer Garter Belt of Minor CrackCode: Select all
/cast item ${AuxManaItem}Code: Select all
/cast item "${AuxManaItem}"

Code: Select all
|Useage: This Macro requires the Wizard Epic, but is easily
|adaptable to work with the Wand of Impenetrable Force from time.
|
|This macro will grab your mana robe from inventory (if you're not
|wearing it) and then cast it, keeping you buffed with the Epic
|rune so as not to take any damage.
|
| Thanks to Yalp, Casperwiz and Ieatacid for the orginal code. If it looks like I stole
| your code and didn't mention you, you're probably right. I learned this from scratch...
| and looked at tons of code to figure out how MQ2 basically works. If I forgot you, mea
| culpa.
|
| Significant (so I tell myself) modifications made by Horseshoecrabs: in no particular
| order...
|
| - Less retarded about casting the horse unnecessarily.
| - Attempting a new strategy for robeswapping: robes stay on pointer until macro is
| done or interrupted.
| - Made the delay for moving equipment around an incremental number so it's more
| dynamic about lagged vs. unlagged situations. Starts at zero.
| - Includes new logic to integrate Harvest and Harvest of Druzzil in a more robust way
| - Includes logic to check for a mount
| - If macro runs until you are FM, macro will dispel horse only if you didn't already
| have it loaded
| - Added counters to show mana and number of Mana Robe casts
| - Modified logic to swap the mainhand item and the chest item
| - Using Bandolier for primary item - it's faster at switching than scripting. They
| are referred to as "uber" and "lich" below.
| - Added Events handling to better capture actual runes cast, manarobe casts to handle
| counters better
| - Remembers how many casts were made against a rune in a previous macro session
| - If you don't get nailed between mana robe macro sessions, your rune shouldn't get
| removed at all.
|
| - Attempts to recognize if you're wearing the wrong gear at end of macro
| - added this because lag or spamming a break key can cause you to leave on the wrong
| robe or mainhand item. (may not be perfected or even possible to perfect)
|
| - Added a macro break key. Your mq2custombinds.txt file will need an entry to make
| the key work:
| name=Interrupt
| down=/multiline ; /if (${Me.Mount.ID}) /dismount; /stopcast
| up=
|
| - And of course you'll need to bind Interrupt (or whatever you want to call it) to a
| key, F11 etc. It may be necessary to push the break key a couple times to interrupt
| the script completely, but it's not too bad.
|
| - If you have a mana regen item such as Girdle of Efficiency, the script will check
| remaining time on it and recast at 5 minutes or less.
| - Used variables wherever possible so if you have the Time wand, you can simply change
| the varset for "RuneStaff" and the rest will work as intended.
| - If you use a Time wand, make sure you change all instances of "13" to "12" so you
| - don't chew through the entire rune.
| - Harvest of Druzzil has a special delay timer on casting - the scripting acts wonky
| if it's not there.
| - If you're not on a mount and you get stunned by Harvest, you sit automatically for a
| little extra mana regen :)
| - Script is agnostic about where you keep your items; any bag will do
| - Attempts to keep your best gear on as often as possible since HPs and resists matter
| during raid events.
#event StopRoutine "You must be standing to cast a spell."
#event StopRoutine "Your spell is interrupted."
#event FreshRune "You are surrounded by a swirling maelstrom of magical force."
#event FreshRune "Your body is surrounded by a Force Shield."
#event ManaRobeCast "You feel your life force draining into your mind."
#turbo
Sub Main
/declare AuxManaItem string outer Uber Legs of Minor Crack
/declare AuxManaBuff string outer Minor Crack
/declare ManaRobe string outer Mana Robe
/declare MountItem string outer Giant Black Drum
/declare PriChest string outer Ghostly Robes
/declare PriLegs string outer Pantaloons of Ass Kicking
/declare PriMainhand string outer Staff of Prismatic Power
/declare RuneBuff string outer Force Shield
/declare RuneStaff string outer Wand of Impenetrable Force
/declare BagChest int outer
|
| /declare RobeCasts int global
| move the previous command out to \release\autoexec.cfg
|
/declare AlreadyMounted int outer 1
/declare SpellWait int outer 1
/declare IncrementalWait int outer 0
/call UnloadCursor
/if (${Me.Buff[${RuneBuff}].Duration.TotalSeconds}>300 && ${Me.Buff[${AuxManaBuff}].Duration.TotalSeconds}<300 && ${Me.PctMana}>=95) /call CastAuxManaItem
/doevents
/if (${Me.Buff[${RuneBuff}].Duration.TotalSeconds}>300 && ${Me.Buff[${AuxManaBuff}].Duration.TotalSeconds}>300 && ${Me.PctMana}>=95) /goto :EndIt
/doevents
/if (!${Me.Mount.ID}) {
/varset AlreadyMounted 0
/cast item "${MountItem}"
/call CastWait
}
/doevents
/If (${Me.Buff[${AuxManaBuff}].Duration.TotalSeconds}<300) /call CastAuxManaItem
/doevents
/varset BagChest ${FindItem[${ManaRobe}].InvSlot.Pack}
/if (!${Window[${BagChest}].Open}) /nomodkey /itemnotify ${InvSlot[${BagChest}]} rightmouseup
:loop
/if (!${Cursor.ID}) {
/nomodkey /itemnotify ${FindItem[${ManaRobe}].InvSlot} leftmouseup
/varcalc IncrementalWait ${IncrementalWait}+1
/delay ${IncrementalWait}
/goto :loop
}
/varset IncrementalWait 0
/if (!${Window[${BagChest}].Open}) /nomodkey /itemnotify ${InvSlot[${BagChest}]} rightmouseup
/doevents
:mainloop
/varset SpellWait 1
/if (!${Me.Buff[${RuneBuff}].ID}) {
/if (!${Me.Inventory[Mainhand].Name.Equal[${RuneStaff}]}) /docommand /bandolier activate lich
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/echo Casting Rune (top of GetMana Routine)
/cast item "${RuneStaff}"
/call CastWait
/doevents
}
/if (${Me.PctMana} < 90 && ${Me.AltAbilityReady[Harvest of Druzzil]}) {
/varset SpellWait 10
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]}) /docommand /bandolier activate uber
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/echo Casting Harvest of Druzzil
/docommand /alt activate 172
/call CastWait
/varset SpellWait 1
/doevents
}
/if (${Me.PctMana} <= 90 && ${Me.SpellReady[Harvest]}) {
/varset SpellWait 10
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]}) /docommand /bandolier activate uber
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/echo Casting Harvest
/cast "Harvest"
/call CastWait
/varset SpellWait 1
/doevents
}
/if (${Me.Buff[${RuneBuff}].ID}) /echo Mana Robe has been cast ${RobeCasts} time(s) against this rune and you have ${Me.PctMana}% mana.
/if (${Me.PctMana}>=95 && ${RobeCasts}<=2) {
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]}) /docommand /bandolier activate uber
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/echo Mana is at ${Me.PctMana}% and Rune is healthy, exiting main loop.
/doevents
/goto :Endit
}
/if (${RobeCasts} >2 && ${Me.PctMana}>=95) {
/if (!${Me.Inventory[Mainhand].Name.Equal[${RuneStaff}]}) /docommand /bandolier activate lich
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/cast item "${RuneStaff}"
/call CastWait
/doevents
/goto :Endit
}
/if (${RobeCasts} == 12) {
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/if (!${Me.Inventory[Mainhand].Name.Equal[${RuneStaff}]}) /docommand /bandolier activate lich
/cast item "${RuneStaff}"
/call CastWait
/doevents
}
/if (!${Me.Inventory[Chest].Name.Equal[${ManaRobe}]}) /nomodkey /itemnotify chest leftmouseup
/nomodkey /itemnotify chest rightmouseup
/call CastWait
/doevents
/goto :mainloop
:Endit
/if (${Window[${BagChest}].Open}) /nomodkey /itemnotify ${InvSlot[${BagChest}]} rightmouseup
/if (!${Me.Buff[${RuneBuff}].ID} || ${Me.Buff[${RuneBuff}].Duration.TotalSeconds} < 300) {
/if (!${Me.Inventory[Mainhand].Name.Equal[${RuneStaff}]}) /docommand /bandolier activate lich
/cast item "${RuneStaff}"
/call CastWait
}
/doevents
:TryAgain0
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]}) /docommand /bandolier activate uber
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]} | | !${Me.Inventory[Chest].Name.Equal[${PriChest}]} ) /goto :TryAgain0
/call UnloadCursor
/if (${RobeCasts}==0) /echo Fresh Rune has been cast
/if (${Me.Buff[${AuxManaBuff}].Duration.TotalSeconds}<300) /call CastAuxManaItem
/if (${AlreadyMounted}==0) /dism
/endmac
Sub CastWait
:Casting
/delay ${SpellWait}
/if (${Me.Stunned} && !${Me.Sitting}) /sit
/if (${Me.Stunned}) /goto :Casting
/if (${Me.Casting.ID}) /goto :Casting
/return
Sub UnloadCursor
:loop
/autoinv
/delay ${IncrementalWait}
/if (${Cursor.ID}) {
/varcalc IncrementalWait ${IncrementalWait}+1
/goto :loop
}
/varset IncrementalWait 0
/return
Sub CastAuxManaItem
/varset BagChest ${FindItem[${AuxManaItem}].InvSlot.Pack}
/if (!${Window[${BagChest}].Open}) /nomodkey /itemnotify ${InvSlot[${BagChest}]} rightmouseup
:AuxManaItemLoop0
/if (!${Cursor.ID}) {
/nomodkey /itemnotify ${FindItem[${AuxManaItem}].InvSlot} leftmouseup
/varcalc IncrementalWait ${IncrementalWait}+1
/delay ${IncrementalWait}
/goto :AuxManaItemLoop0
}
/varset IncrementalWait 0
/if (!${Window[${BagChest}].Open}) /nomodkey /itemnotify ${InvSlot[${BagChest}]} rightmouseup
/nomodkey /itemnotify legs leftmouseup
/cast item "${AuxManaItem}"
/call CastWait
/nomodkey /itemnotify legs leftmouseup
/call UnloadCursor
}
/return
Sub Event_FreshRune
/varset RobeCasts 0
/docommand /bandolier activate uber
/return
Sub Event_ManaRobeCast
/varcalc RobeCasts ${RobeCasts}+1
/return
Sub Event_StopRoutine
/doevents flush
:TryAgain1
/if (!${Me.Inventory[Chest].Name.Equal[${PriChest}]}) /nomodkey /itemnotify chest leftmouseup
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]}) /docommand /bandolier activate uber
/if (!${Me.Inventory[Mainhand].Name.Equal[${PriMainhand}]} | | !${Me.Inventory[Chest].Name.Equal[${PriChest}]} ) /goto :TryAgain1
/call UnloadCursor
/if (${AlreadyMounted}==0) /dism
/endmac
/return
Code: Select all
/declare myvar [b]string[/b] outer belt of everlovin crack
I may know that, and you may know that (cause you read the manual, good job by the way), but not everybody else knows that.horseshoecrabs wrote:They already are strings.