• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Forage macro: YAFM corrected

I found this macro somewhere and liked that I could limit the number of items I kept, excpet that it didn't work. It either kept the item or destroyed it if the ini file was set to zero. I found the problem in the itemcount command. Here is my corrected version. I also added to the echo command to show how many of the item was on hand and the total to keep.

Rich (BB code):
|yafm.mac 
| 
|Yet Another Forage Macro 
| 
|Ini File: yafm.ini 
| 
| 0 = destroy 
| x = keep at most x of this item 
| 
|New foraged items are added to the ini file automatically and are kept by default. 


|||||||||||||||||||| 
| Main 
|||||||||||||||||||| 
sub Main 
	/echo forage macro started

    /declare DefaultMaxSave int outer 

    /varset DefaultMaxSave ${Ini[yafm.ini,Default,MaxSave,${NotFound}]} 
    /if (${DefaultMaxSave}==${NotFound}) { 
       /ini "yafm.ini" "Default" "MaxSave" "100" 
        /varset DefaultMaxSave 100 
    } 

   /delay 1 

   | Verify that we have the ability to forage. 
   /if (${Me.Skill[Forage]}==0) { 
      /echo You cannot forage, silly person! 
      /goto :Exit 
   } 

   :Forage 

   | If we can forage then do so. 
   /if (${Me.AbilityReady[Forage]}) { 
      | Stand up.  Can't forage while sitting. 
      /if (${Me.State.NotEqual[STAND]}) { 
         /stand 
         /delay 5 
      } 

      /doability forage 
   } 

   | If we successfully foraged something then take care of it. 
   /if (${Cursor.ID}) { 
      /call HandleItem 
   } 

   /goto :Forage 

:Exit 
/return 

|||||||||||||||||||| 
| HandleItem 
|||||||||||||||||||| 
sub HandleItem 

   /declare ItemSetting int local 
   /declare NotFound int local 
   /declare ItemsHave int local 

   /varset NotFound -1 

   :LootIt 

   | Look up this item in yafm.ini 
   /varset ItemSetting ${Ini[yafm.ini,ForageList,${Cursor.Name},${NotFound}]} 
   /delay 5 

   | If the item isn't in the .ini file then add it. 
   /if (${ItemSetting}==${NotFound}) { 
       /ini "yafm.ini" "ForageList" "${Cursor.Name}" "${DefaultMaxSave}" 
       /varset ItemSetting ${DefaultMaxSave} 
   } 

   /varset ItemsHave ${FindItemCount[=${Cursor.Name}]}  
   | If we're keeping this item then stash it in our bags. 
   | Otherwise, just destroy it. 
   /if (${ItemSetting}>${ItemsHave}) { 
     /echo Keeping "${Cursor.Name}" only ${ItemsHave} of ${ItemSetting} on hand 
     /autoinventory 
        } else { 
     /echo Destroying "${Cursor.Name}" already have ${ItemsHave} of ${ItemSetting}
     /destroy 
   } 

   /delay 5 
   /if (${Cursor.ID}) /goto :LootIt 

/return
 
Forage macro: YAFM corrected

Users who are viewing this thread

Back
Top
Cart