• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Forage Macro based on yafm

ammonone79

New member
Joined
May 1, 2006
RedCents
11¢
This macro I wrote because yafm didn't meet my needs.
There may be some idea's out there as to how I can make this better and I am more then open to them.
BTW this is also posted in the VIP Section of macroquest by me. I do not mind it being redistrubited... Good luck and happy foraging.
Rich (BB code):
#include spell_routines.inc 
#event ReGate "#*#spell is interrupted#*#" 
#event ReGate "#*#spell fizzles!#*#" 
#event ReGate "#*#standing to cast#*#" 
#chat tell 

/declare gatecount int global 


|||||||||||||||||||| 
| Main 
|||||||||||||||||||| 
sub Main 
    /echo Starting YAFM! 
    /declare DefaultMaxSave int outer 
    /varset gatecount 0 

    /varset DefaultMaxSave ${Ini[yafm.ini,Default,MaxSave,${NotFound}]} 


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

   :Forage 
   /call Egate 
   /call GMCheck 
   |Stand up.  Can't forage while sitting. 
      /if (${Me.State.NotEqual[Stand]}) { 
         /stand 
         /delay 5 
      } 
   | If we can forage then do so. 
   | Make sure to have forage as one of your buttons on your Actions menu. 
     /if (${Me.AbilityReady[Forage]}) { 
      /doability forage 
   } 
   | If we successfully foraged something then take care of it. 
   /if (${Cursor.ID}) { 
      /call HandleItem 
   } 
   /doevents 
   /goto :Forage 

:Exit 
/return 

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

   /declare ItemSetting int local  
   /declare ItemsHave int local 
   /declare NotFound -1 
  

   :LootIt 

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


   | If the item isn't in the .ini file then add it. 
   /if (${ItemSetting}==${NotFound}) { 
   /echo Zone ${Zone.Name} and Item ${Cursor.Name} Not found adding it now... 
   /Ini "yafm.ini" "${Zone.Name}" "${Cursor.Name}" "${DefaultMaxSave}" 
   /varset ItemSetting ${DefaultMaxSave} 
   } 

   /varset ItemsHave ${FindItemCount[=${Cursor.Name}]} 
   /goto :Handlethis 
/return 
   | If we're keeping this item then stash it in our bags. 
   | Otherwise, just destroy it. 
    
   :Handlethis 
   /if (${ItemSetting}>${ItemsHave}) { 
   /echo (${Cursor.Name}),(${ItemSetting}),(${ItemsHave}) 
     /autoinventory 
   } else { 
   /echo Destroyed (${Cursor.Name}) 
     /destroy 
   } 

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

/return 


|-------------------------------------------------------------------------------- 
|SUB: Check for GM's in zone. 
|-------------------------------------------------------------------------------- 
Sub GMCheck 

   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      /echo GM entered the zone! 
      /echo For safty reasons ending the macro... 
      /camp desktop 
      /endmacro 
   } 

/return 
|--------------------------------------------------------------------------------- 
|SUB: Log on Tell 
|--------------------------------------------------------------------------------- 
Sub Event_Chat(type,sender,line) 

/echo ${type} 
/echo ${sender} 
/echo ${line} 

|Change charactername to the character that you want to be able to tell you to log. 
|This is handy when sharing an account. 
/if (${sender.Equal[charactername]}) { 
  /echo ${sender} sent me a tell and it said ${line} 
  /if (${line.Find[log]}) { 
    /camp desktop 
    /endmacro 
  } 
} 
/return 
|--------------------------------------------------------------------------------- 
|SUB: Gate when being attacked. 
|--------------------------------------------------------------------------------- 
Sub Egate 
/squelch /target ${Spawn[npc radius 50]} 

/if (${Target.ID}) { 
 /echo ${Target.CleanName} 
 /cast 8 |spell Ring of Combine. 
 /target clear 
 /doevent ReGate 
 /varcalc gatecount ${gatecount}+1 
 /echo ${gatecount} 
}    

| If someone trains you more then 3 times and you have ported 3 times then gate and camp 
  /if (${gatecount} > 2) { 
   /echo Can't shake this dude, Gating and camping 
   /tar pc 
   /tar next pc 
   /tell ${Target.DisplayName} Thanks! 
   /cast 9 |spell Gate 
   /delay 20s 
   /camp desktop 
   /endmacro 
} 
  
/return 
|------------------------------------------------------------------ 
|Event ReGate - Try the spell again if it fails. 
|------------------------------------------------------------------ 
Sub Event_ReGate 
  /if (${gatecount} > 2) { 
   /echo Can't shake this dude, Gating and camping 
   /tar pc 
   /tar next pc 
   /tt Thanks! 
   /cast 9 |spell Gate 
   /delay 20s 
   /camp desktop 
   /endmacro 
  } 
/cast 8 |spell Ring of Combine 
/return
 
Last edited:
ini for this.

Rich (BB code):
|Save this as yafm.ini in the same directory you save your macros.
|
|

[Default] 
MaxSave=100

[The Western Wastes]
Glob of Slush Water=20
Dragon Claw Sliver=0
Wurm Egg=o
Arctic King Crab=100
Lichen Roots=20
Drake Egg=0
Small Chunk of Velium=0
Tuft of Dire Wolf Fur=1000
Dragon Egg=100
Roots=20
Pod of Water=100

[Guild Hall]
Arctic King Crab=20
Rabbit Meat=20
Roots=20
Fishbone Darts=100
Pod of Water=20
Vegetables=100
Berries=20
Fruit=20

Fishing Grubs=100
[Dranik's Scar]
Pod of Water=100
[Wall of Slaughter]
Hearth Heat Flute=100
Sabertooth Horn=100

[The Plane of Knowledge]
Roots=20
Pod of Water=20
Vegetables=100
Berries=20
Fruit=20
Habanero Pepper=100
Bookworm=100
[The Lavastorm Mountains]
Fishing Grubs=100

[The Broodlands]
Marsh Algae=0
Vegetables=40
Burnberry=0
Storm Cloud=0
Pod of Water=20
Rabbit Meat=0
Roots=20
Fishing Grubs=0
Berries=0
Deadly Ivy=0
Olive=100
Steaming Water=100
Camphor Leaf=0
Sky Vine=0
Coarse Salt=100
Silkworm Larva=0
Deep Forest Mushroom=100
Nettle Creeper=0
Blue Nightwort=0
Marsh Gas=100
Lime=0
Fruit=0
Mature Silkworm=0
Red Cups=100
Jungle Pineapple=0
Amber Water Worm=100
Scale Ore=0
Starshine Moss=0
Luminous Ivy=0
Chunk of Ice=100
Draconic Essence=0
Pitcher Plant=0
Firefly=100
Cryptanthus=100
Spiny Fruit=100
Silkworm=100
Air-Infused Spring Water=100

[The Dreadlands]
Roots=20
Nodding Blue Lily=1000
Frost Crystal=0
Drachnid Silk=20
Vegetables=40
Fruit=0
Drachling Silk=20
Pod of Water=20
Fishing Grubs=0
Rabbit Meat=0
Honey Berry=0
[Guild Lobby]
Pod of Water=100
Roots=100
Vegetables=100
Rabbit Meat=100
Berries=100
Fruit=100
Fishing Grubs=100
 
Just a question ... is there a reason for running a macro not using the plug-in ... Mq2autoforage or mq2melee?
 
Forage Macro based on yafm

Users who are viewing this thread

Back
Top
Cart