AFK Looting Macro

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

Moderator: MacroQuest Developers

screwju
decaying skeleton
decaying skeleton
Posts: 4
Joined: Mon Jun 14, 2004 9:19 am

AFK Looting Macro

Post by screwju » Fri Jul 23, 2004 2:44 pm

Wasn't able to find anything exactly like this so a Friend and I came up with this.

Code: Select all

#Event zone "#*#You have entered #*#"

Sub main
   /declare MyXLOCA int outer 0
   /declare MyYLOCA int outer 0
   /declare BreakLoop int outer 0
   /declare AnchorX int outer ${Me.X}
   /declare AnchorY int outer ${Me.Y}
   /declare LootSlot int outer 0 
   /declare LootCheck int outer 0 
   /declare LootTotal int outer 0 
   /declare locv1 int outer 0
   /declare xDistance int outer 0  
:Loopa
/call Loot
/call CheckAnchor
/delay 1m
/goto :Loopa
/endmacro


Sub Loot 


   :LtLoop 
   /varcalc locv1 ${locv1}+1 
   /target corpse radius 400 
   /if (!${Target.ID} || ${Target.Type.NotEqual[Corpse]}) /return 
   /varset xDistance 5 
   /call GotoBody ${Target.ID} 
   /if (${Target.ID}) /face nolook fast 
   /loot 
   /delay 40 ${Window[LootWnd].Open} 
   /if (!${Corpse.Items}) { 
      /goto :ExitSWLt 
   } 
   /varset LootTotal ${Corpse.Items} 
   /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} rightmouseup 
      /delay 10 ${Cursor.ID} 
      /notify InventoryWindow IW_CharacterView rightmouseup 
      /delay 10 
      :NextSWLt 
   /next LootSlot 
   :ExitSWLt 
   /cleanup 
   /delay 10 
   /if (${locv1}<4) /goto :LtLoop 
/return

Sub GotoBody(BodyID)
   /varset BreakLoop 0 
   /if (${Me.Mount.ID}) { 
      /dismount 
      /delay 10 
   } 
   /if (${Me.Sitting}) /stand 
   /if (${Target.ID}!=${BodyID}) { 
      /keypress clear_target 
      /delay 3 
      /target id ${BodyID} 
      /delay 3 
   } 
    
   :KeepGoingBody 
   /doevents 
   /delay 0 
   /if (${BreakLoop}==1) /return 
   /if (${Target.Distance}>=10) { 
      /face nolook fast 
      /keypress forward hold 
   } 
   /if (${Target.Distance}<10) {
      /varset BreakLoop 1 
      /keypress forward 
      /return 
   } 
   /call CheckObstacle 
   /if (${BreakLoop}!=1) /goto :KeepGoingBody 
/return

|# Checks to see if we may have bumped into something that is stopping us 
sub CheckObstacle
   |# Record our current position, wait a moment and then check if its the same 
   /varset MyXLOCA ${Me.X} 
   /varset MyYLOCA ${Me.Y} 
   /delay 2 
   /if (${MyXLOCA}==${Me.X} && ${MyYLOCA}==${Me.Y}) /call Obstacle 
/return 

|# Uses strafe and randomness to try and get around things 
sub Obstacle 
   /keypress forward 
   /keypress back hold 
   /delay 5 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
      /delay 3 
      /keypress strafe_right 
   } else { 
      /keypress strafe_left hold 
      /delay 3 
      /keypress strafe_left 
   } 
   /keypress forward hold 
/return

Sub CheckAnchor    
  /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor   
/return

Sub MoveToAnchor 
    /declare iCount int local 
    /varset iCount 0 

    /echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}. 

:AnchorMoveLoop  
    /delay 1 
    /doevents 
    /face nolook loc ${AnchorY},${AnchorX} 
    
    /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) { 
       /keypress forward hold 
   } else { 
       /keypress forward
       /face away loc ${AnchorY},${AnchorX}
        /return 
    } 

    /if (${iCount}>2) { 
        /call Detectobst 
        /face nolook loc ${AnchorY},${AnchorX} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+1 
    /goto :AnchorMoveLoop 
/return

Sub Detectobst
/return 
 
/endmacro

Sub Event_zone
  /echo ZONE! Ending macro!
  /endmacro
/return

Any suggestions / revisions would be greatly appreciated.

Bardmad
a lesser mummy
a lesser mummy
Posts: 36
Joined: Mon Apr 05, 2004 4:55 am

Post by Bardmad » Sun Aug 08, 2004 10:39 pm

nice macro, but it cant loot no drop item, is there a way to do so? can it specify to loot only a certain thing, cos it's great to use it for camping cleric's epic item (shards from Skyfire). Duo with some other hnting macro.

VorticoNT
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Jun 16, 2004 7:32 pm

Post by VorticoNT » Sun Aug 08, 2004 10:56 pm

/lootnodrop always

That should turn off the confirmation window for no drop

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Sun Aug 08, 2004 11:51 pm

Might want to add a check to make sure it isn't a PC corpse.

morevit
a lesser mummy
a lesser mummy
Posts: 47
Joined: Tue Sep 14, 2004 10:35 am

Post by morevit » Tue Sep 14, 2004 11:13 am

VorticoNT wrote:/lootnodrop always

That should turn off the confirmation window for no drop
No, the command is bassackwards. You want

/lootnodrop never

to never put up the confirmation window.

FrOsTy
orc pawn
orc pawn
Posts: 14
Joined: Thu Oct 14, 2004 4:06 pm

Post by FrOsTy » Sat Jan 29, 2005 2:01 am

This was working until the last release/patch. Now, it simply moves to the body and attempts to loot to no avail. It tries 3 or 4 times and then gives up and moves back to the anchor. Yes, I've already recompiled the 1/28/2005 release of MQ2 and all the plugins I use (which seems to grow with each release, hehe).

I am new to this MQ stuff, so, has anything changed to make this broken?!

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Sat Jan 29, 2005 5:19 am

I haven't tried it this morning, since the new 1-28 zip release, but last night I could not use my custom bind to loot corpses. I'll try with the new release.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

hairpin
I like boobies
Posts: 108
Joined: Wed Dec 15, 2004 1:01 pm

Post by hairpin » Sun Jan 30, 2005 5:42 am

Clearly a raiding macro.

User avatar
Soul Hunter
orc pawn
orc pawn
Posts: 13
Joined: Wed May 04, 2005 8:59 am

Post by Soul Hunter » Sat May 07, 2005 6:31 pm

What would I need to add in order for it to only loot a certain type of item or item's with a certain name in common like 'Cloth" or 'Fine Steel".

User avatar
unknownerrors
a ghoul
a ghoul
Posts: 133
Joined: Tue Oct 12, 2004 7:00 am
Location: Las vegas USA

any update

Post by unknownerrors » Mon Aug 22, 2005 10:16 am

macro is currently not working. is there any update comming ??
may our enemys shed tears of crimson apon the field of battle.
- vicious, of cowboybeop

everyone is a potential enemy, everywhere is a potential battlefield.
-zensunni wisdom, of Dune.

lastly - I'll be your huckleberry
-Doc Holliday
webmaster of:
http://unknownerrors.net
http://insideeq.com
http://alphapirates.com
http://reviewthis.info

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Mon Aug 22, 2005 11:52 am

"Macro is not working" covers a wide spectrum. What happens when you run the macro? Is there an error message?
Slice

User avatar
unknownerrors
a ghoul
a ghoul
Posts: 133
Joined: Tue Oct 12, 2004 7:00 am
Location: Las vegas USA

errors

Post by unknownerrors » Thu Aug 25, 2005 1:28 pm

when ran these lines return errors. the macro still runs, but does not loot anything more then mone. all items are left on the corpse until you are forced to close the loot window because the corpse is rotting.

Code: Select all

 /declare LootSlot int outer 0 

Code: Select all

 /declare LootTotal int outer 0 

these two items are used in the loot sub, and i see no reason why they shouldn't be working

Code: Select all

   /varset LootTotal ${Corpse.Items}
   /for LootSlot 1 to ${LootTotal}
but then again i'm not really very good with this stuff yet.
may our enemys shed tears of crimson apon the field of battle.
- vicious, of cowboybeop

everyone is a potential enemy, everywhere is a potential battlefield.
-zensunni wisdom, of Dune.

lastly - I'll be your huckleberry
-Doc Holliday
webmaster of:
http://unknownerrors.net
http://insideeq.com
http://alphapirates.com
http://reviewthis.info

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Post by JJ » Thu Aug 25, 2005 10:09 pm

Try introducing some delays. If you look in the snippets forum I made a loot include file that shows good delays.