KISS Forage

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

Moderator: MacroQuest Developers

denzien
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Aug 25, 2004 12:23 pm

Post by denzien » Wed Aug 25, 2004 12:35 pm

Chill, the macro you posted works perfectly for an AFK macro, but if you want to manipulate your inventory, it needs to be turned off because of the constant /autoinventory.

I would prefer something a little more like this:

Code: Select all

Sub Main 
  :Loop 
     /if (${Me.AbilityReady[Forage]}) /call Forage
  /goto :Loop 
/return

Sub Forage
     /autoinventory 
     /doability Forage
     /delay 1s
     /autoinventory 
/return

It's not quite as simple as yours is (and yours is beautifully simple), but this version allows the user to manage their inventory while it is running.

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

Post by aChallenged1 » Wed Aug 25, 2004 1:35 pm

Code: Select all

#include ExpReport.inc 

Sub Main

|   /declare IniFileName string outer ${Me.Name}_${MacroQuest.Server}.ini
    /declare IniFileName string outer ${Me.Name}_Casic.ini
    /call  StartExpTrack

  :Loop
     /doevents
     /if (${Me.AbilityReady[Forage]}) /call Forage
     /delay 1s 
  /goto :Loop 
/return 

Sub Forage 
     /if ( ${Cursor.ID} ) /autoinventory
     /doability Forage 
     /delay 3
     /if ( ${Cursor.ID} ) /autoinventory 
     /autoinventory 
/return
My version. Same as above but adding in something I'm always running when playing, the main thing is that you don't need a 1second delay after forage, /delay 3 should be long enough. Also might as well have it check to see if it needs to /autoinventory something.
Last edited by aChallenged1 on Wed Aug 25, 2004 4:08 pm, edited 1 time in total.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

denzien
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Aug 25, 2004 12:23 pm

Post by denzien » Wed Aug 25, 2004 3:46 pm

In my old version of a forage macro, I paused .5 sec after foraging and from time to time the lag would cause me to pass the .5s mark without showing the foraged item, so 1s is pretty safe, and for an afk macro, it should be no big deal anyway.

As far as checking it see if there is anything on the cursor...if you're going to /autoinventory the item *anyway*, I don't see what the point of checking is; There are only 2 conditions: true and false. When true, /autoinventory. When false, don't autoinventory. If sending the command /autoinventory with nothing on the cursor, nothing bad happens, so why bother to use an extra step?

I like the 1s pause you have after calling the forage subroutine, that should be plenty and it prevents running the loop too many times, just in case. My old macro actually paused for 1m41s because that is the time I found it takes forage to refresh (actually 1minute 40seconds). In this way I had no need for an extra subroutine.