LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

jaq
a ghoul
a ghoul
Posts: 148
Joined: Fri Mar 12, 2004 8:29 am

LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by jaq » Fri May 06, 2005 2:56 am

This is compltely based on fantum409's wait4rez macro. I chopped out the loot portion of the macro for instances where you just want to loot your corpse leaving x items on it, but for whatever reason.. dont want to wait for a rez. I didn't see any other macros that did this so figured I'd go ahead and share it.

The macro will loot all but the spcified number of items on your corpse. Specify number of items to leave on corpse:
/mac lootmycorpse 0
will fully loot the corpse.

~Thanks to fantum409 for 99.9999% of the code in the macro.

Code: Select all

|** LoocMyCorpse.mac (Shamelessly Based on code by FaNTuM ~ changes made by jaq)
This will automatically loot your corpse for you, leaving
   the specified number of items on it. Usage: </mac LootMyCorpse 0> where 0
   is the number of items to leave on corpse, 0 loots all items.
05/03/2005 **|
	

| --------------
| -- Main Sub --
| --------------
Sub Main
   /declare loottotal int outer
   /declare lootslot int outer
   /declare lootleft int outer 1

   /if (${Defined[Param0]}) {
      /varset lootleft ${Param0}
   }
   /echo LootCorpse.mac activated! 
   /echo Attempting to loot corpse leaving ${lootleft} item/s on corpse.
   /call Loot
   /end

| -----------------------
| -- Pull corpse close --
| -----------------------
Sub Loot
   :corpsepull
   /target mycorpse
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]}
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]} || !${Target.ID}) {
      /echo No corpse in this zone
      /return
   }
   /delay 3s
   /corpse
   /delay 1s ${Target.Distance}<20
   /if (${Target.Distance}>20) {
      /echo Corpse is too far away
      /return
   }
| ---------------------
| -- Open the corpse --
| ---------------------
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) {
      /loot
   } else {
      /echo where did my corpse go?
      /return
   }
   /delay 5s ${Me.State.Equal[BIND]}
   /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull
   /varset loottotal 0
| -----------------
| -- Count items --
| -----------------
   /delay 3s
   :LootLag
   /if (${loottotal}!=${Corpse.Items}) {
      /varset loottotal ${Corpse.Items}
      /delay 2s
      /goto :LootLag
   }
   /if (${loottotal}<=${lootleft}) {
      /echo Looting aborted.  Error in number of items to be left on corpse.
      /notify LootWnd DoneButton leftmouseup
      /return
   }
   /varset loottotal ${Math.Calc[${Corpse.Items}-${lootleft}]}
| ---------------------
| -- Loot the corpse --
| ---------------------
   /echo Looting all but ${lootleft} item(s)
   /for lootslot 1 to ${loottotal}
   :LootItem
   /itemnotify loot${lootslot} rightmouseup
   /delay 5 !${Corpse.Item[${lootslot}].ID}
   /if (!${Corpse.Item[${lootslot}].ID}) {
      /next lootslot
   } else /goto :LootItem
| -----------------
| -- Doublecheck --
| -----------------
   /if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag
   /notify LootWnd DoneButton leftmouseup
   /echo Done looting.  ${lootleft} Item(s) left on your corpse.
/return
--jaq

Jorick
decaying skeleton
decaying skeleton
Posts: 8
Joined: Fri Nov 18, 2005 5:34 am

Post by Jorick » Thu Apr 12, 2007 3:31 pm

Thanks for the mac, works great, but I do have one issue. I run a custom UI based on Delta with MQ worked in as well and for some reason, this macro doesn't seem to like the EQUI_LootWnd.xml incorporated in the UI. When I try to use the mac with the custom loot window, it'll loot two items then stall out, though if I continue to pick items up manually, the macro seems to keep running and will occationally pick up an item or two ahead. Way the loot window is set up, all the items on the corpse are in one compacted window organized into three columns without the need to scroll. Any suggestions on how to adjust the mac so I can continue to use this window would be greratly appreciated.

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 4:21 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 4:23 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 4:24 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:01 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:02 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:03 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:04 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:05 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 5:42 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 6:57 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 6:58 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 8:11 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: LoocMyCorpse.mac -- Loots your Corpse (Based on wait4rez)

Post by xyilla » Wed May 14, 2025 8:13 am