Page 1 of 1

Loot all but X items

Posted: Thu Apr 29, 2004 9:26 pm
by bob_the_builder
Loot items after res or loot all but X items

Code: Select all

| Loot.mac 
| By LordGiddion and AP50 
| Edited by Bob_the_builder 
| 5/2/04 
| /mac loot <# items to leave on corpse> 
| 

Sub main
   /declare LootTotal int
   /declare LootSlot int 
   /declare LootLeft int

   :CheckParam 
   /if (!${Defined[Param0]}) { 
      /varset LootLeft 1 
      /echo Using default LootLeft of ${LootLeft} 
      /echo Useage: /mac loot <# items to leave on corpse> 
      /echo Useage: /mac loot 0 <Loots all items> 
   } else { 
      /varset LootLeft ${Param0} 
   } 

   :CheckMyCorpse 
   /target mycorpse 
   /corpse 
   /loot 
   /delay 2s 

   :CheckIfCorpseNear 
   /if (!${Corpse.Items}) { 
      /popup NO CORPSE TO LOOT 
      /endmacro 
   } 

   :SetLootTotal 
   /varset LootTotal ${Math.Calc[${Corpse.Items}-${LootLeft}].Int} 
   /echo Total to Loot: ${LootTotal} 

   :MainLoop 
   /for LootSlot 1 to ${LootTotal} 
      |/echo loot slot: ${LootSlot} 
      /itemnotify loot${LootSlot} rightmouseup  
      /delay 1s 
   /next LootSlot 

   :DoneLooting 
   /delay 1s 
   /notify LootWnd DoneButton leftmouseup 
   /popup DONE LOOTING 
/endmacro
Bob

Posted: Thu Apr 29, 2004 9:42 pm
by ml2517
You missed a var:

Code: Select all

/itemnotify loot@LootSlot rightmouseup 

Posted: Sat May 01, 2004 6:38 am
by nald
This one not working for me? Off to look for the setting to remove the profainity :)

Macro - Loading macro: D:\games\MQ2-Latest\Release\Macros\loot.mac

Macro - Starting macro with '/call Main 0'

WriteChatColor([MQ2] Using default LootLeft of "1")

WriteChatColor([MQ2] Useage: /mac loot <# items to leave on corpse>)

WriteChatColor([MQ2] Useage: /mac loot 0 <Loots all items>)

Target - toonsname's corpse0 selected

CChatHook::Detour(Summoning toonsname corpse...)

CChatHook::Detour(You receive 109 platinum, 188 gold, 257 silver and 290 copper as your split.)

WriteChatColor(GKFJDGJKFDGJKDF you fucking broke it FUCKING DUMBASS)

WriteChatColor(Calculate encountered unparsable text '"1"')

WriteChatColor(loot.mac@36 (main): /varset LootTotal "${Math.Calc[${Corpse.Items}-${LootLeft}].Int}")

WriteChatColor(The current macro has ended.)

WriteChatColor(FUCKING CHRIST whatever you're smoking, pass it MOTHER FUCKING along FUCKING IDIOT)

WriteChatColor(/varset failed, variable 'LootTotal' not found)

Posted: Sun May 02, 2004 2:03 am
by theafkxper
line 15:

Code: Select all

     /varset LootLeft [color=red]"[/color]1[color=red]"[/color]
remove the quotes and should be alright

Posted: Sun May 02, 2004 10:28 pm
by Space-Boy

Code: Select all

/for loops ust use an int variable
loot.mac@41 (main): /for LootSlot 1 to ${LootTotal}
The Current Macro has ended.
not to sound like a fucktard but please post working macros =P i was all hoping this would work, and i still have no clue how the hell to fix it lol

thats the spew i get

Posted: Sun May 02, 2004 11:21 pm
by dirx
I got this to work by changing a few things here is my code.

Code: Select all

Sub main 
   /declare LootTotal 
   /declare LootSlot int 
   /declare LootLeft 
  [color=red] /varset LootLeft ${Param0}[/color]
   :CheckParam 
   [color=red]/if (!${Defined[Param0]})[/color] { 
      /varset LootLeft 1 
      /echo Using default LootLeft of ${LootLeft} 
      /echo Useage: /mac loot <# items to leave on corpse> 
      /echo Useage: /mac loot 0 <Loots all items> 
   } else { 
      /varset LootLeft ${LootLeft} 
   } 

   :CheckMyCorpse 
   /target mycorpse 
   /corpse 
   /loot 
   /delay 2s 

   :CheckIfCorpseNear 
   /if (!${Corpse.Items}) { 
      /popup NO CORPSE TO LOOT 
      /endmacro 
   } 

:SetLootTotal 
   [color=red]/varset LootTotal ${Math.Calc[${Corpse.Items}-${LootLeft}].Int}[/color] 
   /echo Total to Loot: ${LootTotal} 
   /popup LOOTING ALL BUT ${LootLeft} ITEMS 

   :MainLoop 
   /for LootSlot 1 to ${LootTotal} 
      |/echo loot slot: ${LootSlot} 
      /itemnotify loot${LootSlot} rightmouseup  
      /delay 1s 
   /next LootSlot 
   
   :DoneLooting 
   /delay 1s 
   /notify LootWnd DoneButton leftmouseup 
   /popup DONE LOOTING 
/endmacro

The lines I changed are in red. I have been looking for this exact macro you guys rock.

Thanks,

Dirx