Mount any bridle/drum

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

Shadows91
a lesser mummy
a lesser mummy
Posts: 31
Joined: Mon Feb 09, 2009 11:21 pm

Mount any bridle/drum

Post by Shadows91 » Sun Mar 15, 2009 4:47 pm

Usage: Supply the trigger text (Mount Up) to cast any mount.

Required Plugins:
- MQ2Cast
- MQ2Exchange


In the events section add:

Code: Select all

#event Mount			"#*#Mount Up#*#"

At the bottom add:

Code: Select all

| -=-=-=-=-=-=-=-=-=-=-=-=-
| -=     Mount   Event   =-
| -=-=-=-=-=-=-=-=-=-=-=-=-
| * Attempts to cast a mount
| -=-=-=-=-=-=-=-=-=-=-=-=-
Sub Event_Mount
	/declare counter1 int local
	/declare counter2 int local
	/If (!${Me.Moving} && !${Me.Casting.ID}) {
		/for counter1 1 to 25
			/If (${Me.Buff[${counter1}].ID} && !${Me.Buff[${counter1}].Spell.WillStack[Summon Drogmor]}) /return
		/next counter1
		/for counter1 22 to 30
			/If (${Me.Inventory[${counter1}].Container}) {
				/for counter2 1 to ${Me.Inventory[${counter1}].Container}
					/If (${Me.Inventory[${counter1}].Item[${counter2}].Spell.Name.Length} && !${Me.Inventory[${counter1}].Item[${counter2}].Spell.WillStack[Summon Drogmor]}) {
						/casting "${Me.Inventory[${counter1}].Item[${counter2}].Name}" ${Me.Inventory[${counter1}].Item[${counter2}].WornSlot[1]} Item 
						/return
					}			
				/next counter2
			} else /If (${Me.Inventory[${counter1}].Spell.Name.Length} && !${Me.Inventory[${counter1}].Spell.WillStack[Summon Drogmor]}) {
				/casting "${Me.Inventory[${counter1}].Name}" ${Me.Inventory[${counter1}].WornSlot[1]} Item 
				/return
			}
		/next counter1
	}
/return
Cheers

-([edited: 3/29/09] Restructured for better optimization)
-([edited: 3/15/09] Removed "Bejeweled Bridle")

Shadows91
a lesser mummy
a lesser mummy
Posts: 31
Joined: Mon Feb 09, 2009 11:21 pm

Update (3/29)

Post by Shadows91 » Sun Mar 29, 2009 7:59 pm

Update (3/29):
- Restructured code for better performance