spellroutines.inc bug fix - please add to compile

Joined
Dec 10, 2007
Messages
22
Reaction score
0
Points
0
Anthrax asked that I post this here so that the source can be corrected.

The BUG:
If you are trying to cast an item from inventory
AND
your open inventory slot is the bottom right slot (Slot 30)

Spellroutines.inc has the following code error: (search for "29")

} else /if ( ${FindItem[${spellName}].InvSlot}>29 ) {
/varset slotName 29

I assume this is a leftover from before the PowerSource slot was added. There are now 30 slots. While I am unsure this check really needs to be made, changing the 29 to 30 "fixed" my error.

I would like the spellrountines.inc file corrected. I usually figure out I forgot when I die :D

Your mileage may vary.
;)
Knows_little_does_less
 
My version has that in there already, but about 7 months ago I updated it from Macroquest site.
I am not sure if the one included in the MMOBugs is the latest one as I claim less of a coder and more of a systems admin!
Here is the intro to mine.

Code:
| 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} 
| 
|======================================================================================================================
 
I have a little macro that i use for hitting all my clickies that isnt working after this patch, it casts the item but it always gets interrupted. This is what im using

PHP:
#include Spell_routines.inc


Sub main

/if ( ${Me.Buff[Soul Energy].Duration.TotalSeconds} < 200) {
		/call Cast "Bladesoul's Spiritual Armguards" item
		/delay 5
}

/if ( ${Me.Buff[Form of Endurance V].Duration.TotalSeconds} < 200) {
		/delay 2
/call Cast "Glowing Orb of Temporal Stasis" item
	
}

/if ( ${Me.Buff[Ancient Power].Duration.TotalSeconds} < 200) {
		/call Cast "Symbol of the Overlord" item
		/delay 5
}
/if ( ${Me.Buff[Furious Might].Duration.TotalSeconds} < 200) {
		/call Cast "Veil of Intense Evolution" item
	}

/if ( ${Me.Buff[Aura of Rage].Duration.TotalSeconds} < 200) {
		/call Cast "Fabled Shrunken Goblin Skull Earring" item
	}

/if ( ${Me.Buff[Miraculous Visions].Duration.TotalSeconds} < 200) {
		/call Cast "Jymall's Gloves of Frenzy" item
	}

/if ( ${Me.Buff[Frost Guard].Duration.TotalSeconds} < 200) {
		/call Cast "Pauldron of Dark Auspices" item
	}

/if ( ${Me.Buff[Fiery Might].Duration.TotalSeconds} < 200) {
		/call Cast "Chestplate of Fiery Might" item
	}

/if ( ${Me.Buff[Illusion: Human].Duration.TotalSeconds} < 200) {
		/call Cast "Circlet of Disguise" item
	}

/if ( ${Me.Buff[Familiar: Dragon Sage].Duration.TotalSeconds} < 200) {
		/call Cast "Familiar of Lord Nagafen" item
	}

/return
 
I think he means MQ2ClickMaint

Ok, tried this, and messed around with it. Typing /citem # (was 0 for me), made me crash. I have half a dozen custom click item macro's made up for various characters, uses, and items depending on situation. is there any way to just fix the simple mac that i posted above?