Yet another Forage/Fishing Macro

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

Moderator: MacroQuest Developers

ScubaSki
a lesser mummy
a lesser mummy
Posts: 55
Joined: Mon Jun 21, 2004 8:27 pm

Yet another Forage/Fishing Macro

Post by ScubaSki » Wed Aug 18, 2004 7:49 pm

I couldn't find any foraging or fishing macro's that satisfied my needs so I hacked/slashed/and chopped apart a couple others to make this simple solution.


I am no coder, but I'm learning.

These macro's forage or fish continually, they check an INI file to determine if they should save or destroy the items they forage/catch. If the item isn't in the INI it will add an entry and automatically save it. Otherwise it does destroy items. Be careful of what you grab on your cursor. I haven't lost anything yet, typically if it doesn't recognize something it adds it and inventories it.


Forage.mac

Code: Select all

| Forage Macro

#Event Pocket "#*#You have scrounged#*#" 


Sub Main 

  /echo Foraging Started

  :KeepsGoing 

    /if (${Me.AbilityReady["Forage"]}) { 
        /delay 5 
        /doability "Forage" 
        /delay 5 
    } 

  /doevents  
  /delay 1s 
  /goto :KeepsGoing 
/return 



Sub Event_Pocket 

   /delay 1s 
   /declare ItemSetting int local 
   /declare NotFound int local 

   /varset NotFound -1 

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

   /delay 5 

   | If the item isn't in the .ini file then add it. 
   /if (${ItemSetting}==${NotFound}) { 
      /ini "forage.ini" "ForageList" "${Cursor.Name}" "1" 
      /echo New Item added ${Cursor.Name}
      /varset ItemSetting 1 
   } 

   | If we're keeping this item then stash it in our bags. 
   | Otherwise, just destroy it. 
   /if (${ItemSetting}==1) { 
      :LootIt 
      /echo Pocketing ${Cursor.Name} for future enjoyment. 
      /autoinventory 
      /delay 5 
      /if (${Cursor.ID}) /goto :LootIt 
   } else { 
      /echo Don't want ${Cursor.Name} destroying!
      /destroy 
   } 

/return

Forage.ini

Code: Select all


[ForageList]
Berries=1
Fishing Grubs=0
Fruit=1
Pod of Water=0
Rabbit Meat=0
Roots=1
Vegetables=1


Last edited by ScubaSki on Wed Aug 18, 2004 7:54 pm, edited 1 time in total.

ScubaSki
a lesser mummy
a lesser mummy
Posts: 55
Joined: Mon Jun 21, 2004 8:27 pm

Post by ScubaSki » Wed Aug 18, 2004 7:50 pm

Fishing.mac

Code: Select all


| Fishing Macro

#Event Pocket "#*#You caught#*#"
#Event Handsfree "#*#You can't fish while holding something#*#"
|#Event BrokenPole "#*#Your fishing pole broke!#*#" 
#Event OutOfBait "#*#You can't fish without fishing bait, go buy some.#*#" 
#Event NeedPole "#*#You can't fish without a fishing pole, go buy one.#*#"
#Event PrimaryHand "#*#You need to put your fishing pole in your primary hand.#*#"


Sub Main 

  /echo Fishing Started

  :KeepsGoing 
    /if (${Me.AbilityReady["Fishing"]}) { 
        /doevents
        /delay 5 
        /doability "Fishing" 
        /delay 5 
    } 
    /doevents  
    /delay 1s 
  /goto :KeepsGoing 

/return 



Sub Event_Pocket 

   /delay 1s 
   /declare ItemSetting int local 
   /declare NotFound int local 

   /varset NotFound -1 

   | Look up this item in forage.ini 
   /varset ItemSetting ${Ini[fishing.ini,FishingList,${Cursor.Name},${NotFound}]} 

   /delay 5 

   | If the item isn't in the .ini file then add it. 
   /if (${ItemSetting}==${NotFound}) { 
      /ini "fishing.ini" "FishingList" "${Cursor.Name}" "1" 
      /echo New Item added ${Cursor.Name}
      /varset ItemSetting 1 
   } 

   | If we're keeping this item then stash it in our bags. 
   | Otherwise, just destroy it. 
   /if (${ItemSetting}==1) { 
      :LootIt 
      /echo Pocketing ${Cursor.Name} for future enjoyment. 
      /autoinventory 
      /delay 5 
      /if (${Cursor.ID}) /goto :LootIt 
   } else { 
      /echo Don't want ${Cursor.Name} destroying!
      /destroy 
   } 

/return

Sub Event_BrokenPole 
   /end
/return 

Sub Event_Handsfree 
   /autoinventory 
/return 

Sub Event_NeedPole 
   /stop
   /cast item "Fisherman's Companion" 
   /delay 11s 
   /autoinventory 
/return 

Sub Event_PrimaryHand 
   /stop
   /cast item "Fisherman's Companion" 
   /delay 11s 
   /autoinventory 
/return 

Sub Event_OutOfBait 
   /Echo Ran out of Bait. 
   /beep  | /sound if you use the MQ2Sound Plugin
   /end
/return 

Fishing.ini

Code: Select all

[FishingList]
Fish Scales=0
Fresh Fish=1
Nightmare Cichlid=1
Prepared Fish=1
Rusty Dagger=0
Tattered Cloth Sandal=0
Vallorian Discus=1
Waterleaf Scale=0