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
Code: Select all
[ForageList]
Berries=1
Fishing Grubs=0
Fruit=1
Pod of Water=0
Rabbit Meat=0
Roots=1
Vegetables=1
