MyForage.mac (Ver: 2.8)
Code: Select all
|MyForage.mac By: Chaos12010
|Version History: 0.3 Creation of MyForage.
| 1.0 Modfications and adjustments to the code.
| 1.3 Some More Modifications based off of YAFM and Forage Macros were added to the macro.
| 2.0 Added the inate cammo to the code...
| 2.1 A little bit of tweaking.
| 2.2 Corected an issue with item's that are suposed to be deleting (Not deleting).
| 2.3 Added the AFK option to be turnd (On or Off).
| 2.4 Modified the Timers for better performance.
| 2.5 Added the how many times you have foraged & MqClear lines.
| 2.6 Added the ability to count what is (Kept, Amount Foraged, Amount Destroyed)
| 2.7 Fixed timer bugs and added meclear to the Camo area's, also added a popup that says (Sucess you found: (Item)).
| 2.8 Added 2 extra timers to the Loot area to fix the timeing of deleting (Echo Data).
|Feature Realse: Would like to add the ability to section the MyForage.ini adding zones so it will become neater for the user to read.
| I would also love to put in the Exoduse option and the ability to auto exit and end macro after Max is compleated.
|Purpose of this macro: The purpose of this macro is to auto forage any item based on the MyForage.ini file. This macro will also protect
|the user by casting Innate Cammo. Added the ability to turn on or of the cammo option. Modified and added new Timers that will slow down the macro
|a bit so it won't delete or inventory items wanted or items you don't want. This macro also sets your toon in afk mode. This can be
|changed or modified by the user as well. I hope everyone enjoys it. Also enhanced the output messages so that you actualy know clearly
|what's going on.
sub Main
|Delares the statment that will be used to define true or false for cammo (This Can Be Changed By The User.)
/declare set_MyCammo bool outer TRUE
/declare set_AFK bool outer FALSE
/declare set_MyTotalForage int outer 0
/declare set_Kept int outer 0
/declare set_Destroyed int outer 0
|MyForage Welcome.
/mqclear
/echo Welcome to MyForage 2.8.
/delay 10
/mqclear
|This if statement will only activate once per run in the macro. (If The User Expresses True.) (AFK)
/if (${set_AFK}) /afk Be Back Soon..... I Hope!
|This if statement will only activate once per run in the macro. (If The User Expresses True.) (Camo)
/if ((${set_MyCammo}) && (!${Me.Buff[Camouflage].ID})) /alt activate 80
|Begins the cleanup befor the actual forage loop begins. The user can again comment this out if they wish to
|see there bags always open on the screen.
/cleanup
|This is where the actual codeing takes place for the forage loop. It steps throw etch line of code; then does the coresponding calls
|(ItemSort, Cammo). This Code Does Not Need To Be Changed.
:Forage
/delay 2
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 3
}
/delay 1s
/if (${Me.Skill[Forage]} > 0) /doability forage
}
/if (${Cursor.ID}) /call ItemSort
/call Cammo
/goto :Forage
:loop
/return
|This is where the Items Get sorted if you want the item it gets put in inventory. If Not it destroys it. -1 was added so it will never delete
|Items in inventory on accsedent. Normaly I have seen people set this to 1. YOu can set this at your own risk.
sub ItemSort
/delay 3
:IsItEmpty
/if (!${Ini[MyForage.ini,ForageList,${Cursor.Name}].Length}) {
/ini "MyForage.ini" "ForageList" "${Cursor.Name}" "-1"
} else {
/if (${Ini[MyForage.ini,ForageList,${Cursor.Name}]}) {
/if (${FindItemCount["=${Cursor.Name}"]}>=${Ini[MyForage.ini,ForageList,${Cursor.Name}]} && ${Ini[MyForage.ini,ForageList,${Cursor.Name}]}!=-1) /goto :Destroy
} else {
:Destroy
/varcalc set_MyTotalForage ${set_MyTotalForage}+1
/varcalc set_Destroyed ${set_Destroyed}+1
/delay 2s
/mqclear
/echo ================================================
/echo Destroying this item: (${Cursor.Name})
/echo Number of forages: (${set_MyTotalForage})
/echo Amount of item's destroyed: (${set_Destroyed})
/echo Amount of item's kept: (${set_Kept})
/echo ================================================
/destroy
/delay 15
/return
}
}
:LootIt
/varcalc set_MyTotalForage ${set_MyTotalForage}+1
/varcalc set_Kept ${set_Kept}+1
/delay 2s
/mqclear
/echo ================================================
/echo Keeping this item: (${Cursor.Name})
/echo Number of forages: (${set_MyTotalForage})
/echo Amount of item's destroyed: (${set_Destroyed})
/echo Amount of item's kept: (${set_Kept})
/echo ================================================
/popup Success you found: (${Cursor.Name})
/autoinventory
/delay 15
/if (${Cursor.ID}) /goto :IsItEmpty
/return
|This section gets calld from within the Forage loop. Now your probably wondering why I placed the code for calling it at
|the bottom of the forage loop. If I put it at the top of the forage loop there will be timer issues that will kik the macro off.
|I tried to solve this problom by moveing the call code to the ending of the loop so it will not bother the forage code.
sub Cammo
/if ((${set_MyCammo}) && (!${Me.Buff[Camouflage].ID})) {
/echo Enableing (Cammo AA)...
/alt activate 80
/mqclear
/delay 8
}
/return
Added Option to Turn on or off AFK (Within Macro).
Added Total Forage Counter that also counts Double Forage if it happens.
Added Total Item's Destroyed Counter
Added Total Item's Kept Counter.
Added A Success Pop-up that will notify you that you actually got something you wanted.
Added Enhanced Timers.
Added code, and Fixed numerous bugs in the code (AND) Yes I fixed the autoinventory Items not wanted so it no longer keeps one of anything unless specified.
Added Enhanced Text output to the Macro so no scrolling is needed when looking in the MQ Window. (Scrolling is just so annoying).
Added /MQClear to some areas to keep the MQ2 Window Clean.
Fixed a few timers that prevented some text (Echo) from being displayed. And extended the delay on the Camo call to correct stability issues within the macro.
Please Enjoy this New Release of MyForage 2.8 By Chaos12010
Here is the MyForage.Ini file
Code: Select all
[Default]
MaxSave=10000
[ForageList]
Bookworm=0
Pod of Water=0
Miller Carrot=0
Fishing Grubs=0
Griffon Eggs=0
Rabbit Meat=0
Green Apple=0
Mana Infused Pod of Water=0
Psilocybe of Magic=0
Vegetables=0
Desiccated Vegetables=0
Desiccated Fruit=0
Psilocybe of Rage=0
Desiccated Roots=0
Sundered Blade Shards=0
Desiccated Berries=0
Blood Tainted Pod of Water=0
Morning Dew=0
Mantrap Bud=0
Emerald Palm Root=0
Emerald Moss=0
Ancient Coin=0
Emerald Leaves=0
Trakanon Fern Root=0
Cockatrice Egg=0
Lightning Stone=0
Thunder Stone=0
Roots=0
A Broken Rallosian Blade=0
Tuft of War Boar Fur=0
Water Flask=0
Pieces of Shattered Armor=0
Ripened Heartfruit=0
Berries=0
Rathe Berries=0
Sylvan Berries=0
Fruit=0
Emerald Orange=0
Pomegranate=0
Pitaya=0
Palm Leaf=0
Speckled Pine Fruit=0
Cinnamon Sticks=0
Rain Water=0
Heartfruit Walnut=0
Enjoy!
Set 0 to anything. and MaxSave to anything you want... You can also separate the items acording to recipie.

