| spell_routines.inc v2.4
|
| Originally Written by Rusty~
| Upkeep performed by A_Druid_00
|
| Includes MQ2Exchange integration for item swapping by BrainDeath
| Also includes FD fix that would cause an endless loop if you were hit by FD mid-cast by A_Druid_00
|
| Features:
| - Casts spells, clicks items, or uses AA abilities for you
| - Allows back to back casting without waiting on spell gems to pop all the way up
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left
| is greater than 7 seconds, else it will move forward a bit to interrupt, then move you back
| ** IMPORTANT: if you don't want to interrupt a spell while mounted, put this at the top of your macro: **
| ** /declare noInterrupt int outer 1 **
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0)
| If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED
| - Lets you call a custom subroutine while waiting for spell to finish casting
| Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true
| - This file also includes a sub named Interrupt. You can call this to interrupt any spell you're casting instantly.
| - You can also use the SwapItem sub included in this to swap items to certain slots
| - Added EquipItem sub to easily equip items in your main Inventory slots.
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top:
| /declare noInvis int outer 1
| This will make it return CAST_INVIS if you're invis
|
| Below is a list of outer scope variables you can access in your macros:
| refreshTime - How much time is left till you're done recovering from casting
| castEndTime - How much time left till you're done casting the current spell... usable in custom spell Subs
| spellNotHold - 1 if your last spell didn't take hold, 0 otherwise
| spellRecastTime1-9 - How much time left till that spell is back up
|
|======================================================================================================================
| EquipItem: An easier way to equip items you have in bags ( useful for weapons or focus items )
| slot name is optional. If not given, it will equip it in the first possible spot
|
| Usage:
| /call EquipItem "item name|slotname"
|
| Returns: "old item name|slotname"
| Examples:
|
| To Equip Sharp Ended Broken Lever when you have Serpent of Vindication equiped:
| /call EquipItem "Sharp Ended Broken Lever"
| It will return "Staff of Vindication|mainhand"
| To reequip the original item, you can save the return in a variable, and then use it later like this:
| /varset oldPrimary ${Macro.Return}
| | ... do stuff here with your new item equiped
| /call EquipItem ${oldPrimary}
|
|======================================================================================================================
| SwapItem: a subroutine which is used in the Cast sub itself. You don't need to do this to cast an item in a bag
| but you can call it in your macro to SwapItems (such as weapons or focus items)
| Usage:
| /call SwapItem "item name" slotname|slotID
| Examples:
|
| To swap Darkblade of the Warlord to your main hand:
| /call SwapItem "Darkblade of the Warlord" mainhand
|
| To swap stat food in one bag with other food in another bag:
| /call SwapItem "Bristlebanes Party Platter" ${FindItem[halas 10lb meat pie].InvSlot}
|
|======================================================================================================================