|** Lewt.mac by Gnuoy
Make a hotkey:
/mac lewt.mac
clear the zone ... this targets, warps, and loots all the corpses in the zone.
Uses /warp t and /warp s
I use MQ2Cursor to handle autodestroying items.
Mostly TheNewGuy's code just made it loot for all corpses in zone.
This code based upon Wat4rez.mac by FaNTuM. Changed from Wait4rez.mac to
loot.mac at the following URL:
http://www.macroquest2.com/wiki/index.php/Editing_Existing_Macros
**|
| --------------
| -- Main Sub --
| --------------
Sub Main
/declare t int outer 0
/declare loottotal int outer
/declare lootslot int outer
/declare lootleft int outer 0
/if (!${Defined[Param0]}) {
} else {
/varset lootleft ${Param0}
}
:main
/tar corpse
/if (!${Target.ID}) {
/warp s
/end
}
/warp t
/delay 10
/loot
| -----------------
| -- Count items --
| -----------------
/delay 1s
:LootLag
/if (${loottotal}!=${Corpse.Items}) {
/varset loottotal ${Corpse.Items}
/delay 1s
/goto :LootLag
}
/if (${loottotal}<=${lootleft}) {
/notify LootWnd DoneButton leftmouseup
/return
}
/varset loottotal ${Math.Calc[${Corpse.Items}-${lootleft}]}
| ---------------------
| -- Loot the corpse --
| ---------------------
/for lootslot 1 to ${loottotal}
:LootItem
/itemnotify loot${lootslot} leftmouseup
/squelch /notify QuantityWnd QTYW_Accept_Button LeftMouseUp
/delay 1
/autoinventory
/if (!${Corpse.Item[${lootslot}].ID}) {
/next lootslot
} else {
/goto :LootItem
}
| -----------------
| -- Doublecheck --
| -----------------
/if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag
/notify LootWnd DoneButton leftmouseup
:end
/delay 15
/autoinventory
/goto :main
/return