Page 1 of 1

ForageDestroy.mac

Posted: Thu Apr 29, 2004 4:43 pm
by xander
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 

Posted: Wed Sep 15, 2004 6:16 pm
by User_99
Not a Code Guru but this doesnt seem to work anymore :x

Posted: Wed Sep 15, 2004 9:36 pm
by Night Hawk
/em mashes his fingers firmling into <