I'm trying to add MQ2Cast_Spell_Routines.inc support so it will not go dumb on gate collapse or fizzle. I've been trying different things for a couple of days and am getting nowhere. Any help would be greatly appreciated. Here is my code.
Rich (BB code):
| tradin.mac, by amml
| modified by tms
| full automation added by fuzzymelon
| Buy function courtesy of EqMule on RedGuides.com
| modified by Pepekeao for SOLO Wizard use! Made it to level 95 in days unattended!
#include MQ2Cast_Spell_Routines.inc
#Event Fizzle "Your spell fizzles#*#"
#Event Collapse "Your gate is too unstable, and collapses.#*#"
Sub Main
| *** Increase the destroydelay ONE by ONE until every item on your cursor gets destroyed.
/declare destroydelay int local 1
/declare chips int local
/declare done int local 0
:top
/doevents
/delay 5s
/squelch /target clear
/target "Gunlok Jure"
/delay 2s
/nav ${Math.Calc[${Target.X}-12]} ${Math.Calc[${Target.Y}+25]} ${Target.Z}
/delay 5s
/face fast
/echo Opening Bags
/keypress OPEN_INV_BAGS
/delay 5
/echo Handing in Chips.
:Loop
/if (!${FindItem[=Bone Chips].InvSlot}) {
/echo backpacks empty go get more stuff
/goto :EmptyBags
}
/if (!${FindItem[=Bone Chips].InvSlot}) /goto :EmptyBags
/for chips 0 to 3
/shift /itemnotify ${FindItem[=Bone Chips].InvSlot} leftmouseup
/delay 5
/click left target
/click left target
/delay 5
/next chips
/delay 8
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 2s
|/echo Clearing Cursor
:cursorclear
/if (${Cursor.ID} && ${Cursor.ID} != 13073) {
/destroy
/delay ${destroydelay}
/goto :cursorclear
}
/if (!${FindItem[=Bone Chips].InvSlot}) /goto :EmptyBags
/goto :Loop
:EmptyBags
/if (!${done}) {
/varset done 1
/goto :cursorclear
}
/echo Clearing up your bags, this will take a moment.
/delay 8
/while (${FindItem[=Rusty Axe].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Axe].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Broad Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Broad Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Mace].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Mace].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Short Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Short Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Two Handed Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Two Handed Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Lantern].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Lantern].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Tattered Gloves].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Tattered Gloves].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Torch].InvSlot}) {
/shift /itemnotify ${FindItem[=Torch].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Tunic].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Tunic].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Tattered Skullcap].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Tattered Skullcap].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Sleeves].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Sleeves].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Pants].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Pants].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
:Done
/delay 8
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 8
/echo Closing Bags
/keypress CLOSE_INV_BAGS
/echo Done .. Have fun..
/goto :port
} else {
/delay 2s
/goto :top
}
:port
/doevents
/squelch /target clear
/delay 5s
/call MQ2Cast "Brell's Rest Gate" -maxtries|9
/delay 45s
/goto :buy
:buy
/squelch /target clear
/target "Marie Fay"
/if (${Target.Type.Equal[npc]}) {
/delay 5s
/nav ${Math.Calc[${Target.X}+9]} ${Math.Calc[${Target.Y}+4]} ${Target.Z}
/delay 15s
/face fast
/delay 3s
/call npc "Marie Fay"
|/echo Opening Bags
|/keypress OPEN_INV_BAGS
|/delay 5
/call Buy
|/echo Closing Bags
|/keypress CLOSE_INV_BAGS
/goto :bind
} else {
/delay 2s
/goto :buy
}
:bind
/doevents
/squelch /target clear
/if (${Merchant.Open}) {
/notify MerchantWnd MW_Done_Button leftmouseup
/delay 1s !${Merchant.Open}
/delay 5s
/call MQ2Cast "Gate" -maxtries|9
/delay 25s
/goto :top
/return
Sub NPC(NPCName)
/target npc ${NPCName}
/delay 1s
/if (!${Select[${Target.Type},npc,pet]} || !${Target.ID} || ${Target.Type.Equal[pet]} && !${Target.CleanName.Find[familiar]}) {
/echo Please target a vendor or guildbanker
/return
}
/echo Doing business with ${NPCName}
/target id ${Spawn[${NPCName}].ID}
/delay 3s ${Target.ID}==${Spawn[${NPCName}].ID}
/if (${Target.Distance}>15) {
/moveto id ${Spawn[${NPCName}].ID}
/delay 250 ${MoveTo.Stopped}
}
/face nolook
/delay 1s
/echo Opening Bags
/keypress OPEN_INV_BAGS
/delay 2s
/echo Opening merchant/guildbank window
/nomodkey /click right target
/echo Waiting 5s for merchant/guildbank window to populate
/delay 5s
/return
Sub Buy
/notify MerchantWnd ItemList listselect ${Window[MerchantWnd].Child[ItemList].List[=Bone Chips,2]}
/delay 2s
:goagain
/if (${Me.FreeInventory}>4) {
/Shiftkey /notify merchantwnd MW_Buy_Button leftmouseup
:waitforit
/if (${Window[MerchantWnd].Child[MW_Buy_Button].Enabled}==FALSE) {
/echo button is false
/delay 2
/goto :waitforit
}
|/echo ${FindItemCount[${"Bone Chips"}]} ${"Bone Chips"} in inventory
| /varcalc QTY ${amount}-${FindItemCount[${Bone Chips}]}
| /delay 1
/goto :goagain
}
/echo Closing Bags
/keypress CLOSE_INV_BAGS
/return
Sub Event_recast_Gate
/call MQ2Cast "Gate"
/return
Sub Event_recast_Brells_Rest_Gate
/call MQ2Cast "Brell's Rest Gate"
/return

