#turbo 80
|Forage Macro by Wirlin
|Auto adds items foraged to Forage.ini
|Set items to 0 to have them destroyed
|Set items to 1 to have them kept
|
|
Sub Main
/declare DefaultMaxSave int outer
/varset DefaultMaxSave ${Ini[Forage.ini,Default,MaxSave,${NotFound}]}
/if (${DefaultMaxSave}==${NotFound}) {
/ini "Forage.ini" "Default" "MaxSave" "1"
/varset DefaultMaxSave 1
}
:Loop
/if (${Me.AbilityReady[Forage]}) /doability forage
/delay 1s
/if (${Cursor.ID}) {
/call ItemForaged
}
/delay 1s
/if (${Cursor.ID}) {
/call ItemForaged
}
/delay 10s
/goto :Loop
/delay 10s
/goto :Loop
/return
Sub ItemForaged
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1
:Loot
|Look up item in Forage.ini
/varset ItemSetting ${Ini[Forage.ini,ForageList,${Cursor.Name},${NotFound}]}
/delay 2s
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "Forage.ini" "ForageList" "${Cursor.Name}" "${DefaultMaxSave}"
/varset ItemSetting ${DefaultMaxSave}
}
| If keeping it stash it in a bag otherwise destroy it
/if (${ItemSetting}>0) {
/autoinventory
} else {
/destroy
}
/delay 1s
/return
/end