ForageDestroy.mac

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

Moderator: MacroQuest Developers

xander
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Apr 22, 2004 11:40 pm

ForageDestroy.mac

Post by xander » Thu Apr 29, 2004 4:43 pm

Just a note that this macro simply forages as often as possible, destroying what you specify below. No INI support, not sit/stand support, etc. It's very simple, but serves my needs nicely.

Code: Select all

|ForageDestroy.mac 
|Based off of Grimjack's forage.mac - Thank you =) 
|edit the /varset DestroyArray to reflect what you want to destroy. 
|If you add more update DestArraySize to reflect the change. 
|The next value in the array would be like this. 
|/varset DestroyArray(20) "what you want" 
|And you would update DestArraySize like this. 
|/varset DestArraySize 21 
| 
|Edited by Xander for mq2data & mq2datavars compliance 

sub Main 
   /cleanup 
   /declare LoopCount int outer 
   /declare DestroyArray[9] string outer 
   /declare DestArraySize int outer 
   /varset DestroyArray[1] "Small Chunk of Velium" 
   /varset DestroyArray[2] "Berries" 
   /varset DestroyArray[3] "Fruit" 
   /varset DestroyArray[4] "Roots" 
   /varset DestroyArray[5] "Rabbit Meat" 
   /varset DestroyArray[6] "Arctic Mussels" 
   /varset DestroyArray[7] "Arctic Scallop" 
   /varset DestroyArray[8] "Glob of Slush Water" 
   /varset DestroyArray[9] "Fishing Grubs" 
   /varset DestArraySize 9 
   /varset LoopCount 0 
   :Forage 
       /delay 1s 
       /if (${Cursor.ID}) /call ItemSort 
       /if (!${Cursor.ID}) { 
      /if (${Me.Skill[Forage]} > 0) /doability forage 
       } 
       /if (${Cursor.ID}) /call ItemSort 
       /goto :Forage 
   :loop 
/return 

sub ItemSort 
   :itemchecker 
      /if (${Cursor.ID}) { 
          /if (${Cursor.Name.Find[${DestroyArray[${LoopCount}]}]}) { 
            /echo Destroying ${Cursor.Name} 
       /destroy 
            /delay 2s 
         } 
      /varcalc LoopCount ${LoopCount}+1 
      |/varadd LoopCount 1 
      /if (${Cursor.ID}) { 
        /if (${LoopCount}<${DestArraySize}) /goto :itemchecker 
        } 
   } 

   /if (${Cursor.ID}) { 
      /echo Keeping ${Cursor.Name} 
      /autoinventory 
      /delay 1s 
   } 
   /doevents 
   /varset LoopCount 0 
/return 
Xander

User_99
decaying skeleton
decaying skeleton
Posts: 1
Joined: Tue Sep 14, 2004 2:27 pm

Post by User_99 » Wed Sep 15, 2004 6:16 pm

Not a Code Guru but this doesnt seem to work anymore :x

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Wed Sep 15, 2004 9:36 pm

/em mashes his fingers firmling into <