OK folks listen up, here is an afk mac that has collected dust for 3 months. It's the real deal, it netted me a ton of slow but steady aa's and some for my second box as well. Use with caution, do not remove sticker, not recommended for children under 12 or pregnant animals. May cause nausia, vomiting, diarhea, leakage from various parts of the body etc...
This works great for a ranger with EQ and AM3. Probably modifiable for other ranged classes. If not the sentinal routine is at least interesting, for kill everything in a certain spot farming.
Basically you go to Natimbi stand behind the ghosts near the ditch. Start the mac and you will buff up go to a spot and kill all the fish (x2 damage) and move on to the next spot, then repeat forever. Looting is tricky, as it is hard to get back to the ledge you are standing on in certain spots. You can write another mac to auto-follow fo 2 boxing (or just stick). If there is any interest at all I'll post that file as well.
I accept Redcents and small unmarked bills
This works great for a ranger with EQ and AM3. Probably modifiable for other ranged classes. If not the sentinal routine is at least interesting, for kill everything in a certain spot farming.
Basically you go to Natimbi stand behind the ghosts near the ditch. Start the mac and you will buff up go to a spot and kill all the fish (x2 damage) and move on to the next spot, then repeat forever. Looting is tricky, as it is hard to get back to the ledge you are standing on in certain spots. You can write another mac to auto-follow fo 2 boxing (or just stick). If there is any interest at all I'll post that file as well.
I accept Redcents and small unmarked bills

Rich (BB code):
| Ditch.mac
| Author : BobDobbs (based on RobDawgs Hunter.mac but heavily modified)
|------------------------------------------------------------------------------------
#turbo 10
#include move.inc
#include spellcast.inc
#event SpeedOff "#*#The quickening spirit departs#*#"
#event TarFar "#*#Your target is too far away, get closer!#*#"
#event TarFar "#*#Mob NOT a Full Health, picking another#*#"
#event WardOff "#*#Your skin returns to normal#*#"
#event TooClose "#*#Your target is too close to use a ranged weapon!!#*#"
#Event Zoned "#*#You have entered Guild Lobby#*#"
#event GotHit "#*#hits YOU for#*#"
#event GotHit "#*#claws YOU for#*#"
#event GotHit "#*#slashes YOU for#*#"
#event GotHit "#*#crushes YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#smashes YOU for#*#"
#event GotHit "#*#mauls YOU for#*#"
#event GotHit "#*#gores YOU for#*#"
#event GotHit "#*#pierces YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
Sub Main
|------------------------------------------------------------
|How many times should aquire target fail before delaying?
|------------------------------------------------------------
/declare RV_FailMax int outer 3
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare RV_MaxRadius int outer 4000
|------------------------------------------------------------
|How far is the combat range?
|------------------------------------------------------------
/declare RV_Range int outer 2500
|||HAVE TO DO THIS OR WE CHASES THE MOBSES-VERY BAD
|------------------------------------------------------------
|What is the minimum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MinZRange int outer -1000
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MaxZRange int outer 1000
|------------------------------------------------------------
|Should I loot all items?
|------------------------------------------------------------
/declare RV_LootAllItems int outer 1
|------------------------------------------------------------
|Should I display stats?
|------------------------------------------------------------
/declare RV_DisplayStats int outer 1
|------------------------------------------------------------
|Home Location X (Set if you want location other then were you start the macro)
|------------------------------------------------------------
/declare AnchorX int outer ${Me.X}
|------------------------------------------------------------
|Home Location Y (Set if you want location other then were you start the macro)
|------------------------------------------------------------
/declare AnchorY int outer ${Me.Y}
|------------------------------------------------------------
|Loot Array Information. for loot warp
|------------------------------------------------------------
/declare LootMobs int outer 0
/declare CorpseList string outer 0
/declare CorpseRadius int outer 400
/declare MobsTooClose int outer 50
/declare CorpseAlertList int outer 70
/declare CorpseRotTime string outer 30s
/declare CorpseRotTimer timer outer
/declare CorpseRotSetTimer string outer TRUE
/declare LootINIFile string outer "${Me.Name}_loot.ini"
/declare useAutoLoot string outer TRUE
|------------------------------------------------------------
|Mob Array Information.
|------------------------------------------------------------
/declare RV_NumberOfMobs int outer 2
/declare RV_MobArray[${RV_NumberOfMobs}] string outer
/varset RV_MobArray[1] "a tide feaster"
/varset RV_MobArray[2] "a saltwater longnose"
|/varset RV_MobArray[3] "a reef crustacean"
|/varset RV_MobArray[4] "a saltwater longnose"
|||||||||||||||||||||SENTINAL|||||||||||||||||||||||
|set location to LoneSalt-0 Base-1 Outpost-2 New_Base-3 Spot1-4 X-5
/declare Sentinal int outer 0
/declare CurrentBaseX int outer ${Me.X}
/declare CurrentBaseY int outer ${Me.Y}
/declare TooFar int outer 0
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare RV_FailCounter int outer 0
/declare RV_MyTargetID int outer 0
/declare RV_MyTargetName string outer
/declare RV_MyTargetDead int outer 0
/declare RV_InvalidTargetID int outer 0
/declare RV_HasTarget int outer 0
/declare RV_RandomWait int outer 0
/declare RV_LootSlot int outer 0
/declare RV_CheckLook int outer 0
/declare RV_Fighting int outer 0
/declare RV_TargetDead int outer 0
/declare RV_MyXLOC int outer 0
/declare RV_MyYLOC int outer 0
/declare RV_FastRange int outer
/declare RV_RangeMax int outer
/declare RV_RangeMin int outer
/varcalc RV_FastRange ${RV_Range}+3
/varcalc RV_RangeMax ${RV_Range}+1
/varcalc RV_RangeMin ${RV_Range}-1
/declare MyXLOCA int outer 0
/declare MyYLOCA int outer 0
/declare BreakLoop int outer 0
/declare xDistance int outer 0
:Start
/doevents
/if (${Param0.equal[1]}) {
}
/call GMCheck
/call MaintainBuffs
/call GetTarget
/call Heal
:KillAdds
|/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
|/if (${RV_HasTarget}) /call MoveToMob
|/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/if (${RV_DisplayStats}) /call DisplayStats
/call ResetSub
/varset RV_RandomWait ${Math.Rand[7]}
/varcalc RV_RandomWait ${RV_RandomWait}
/echo Paranoia - Waiting ${RV_RandomWait} seconds before resuming
/delay ${RV_RandomWait}s
/if (${Target.ID}) {
/echo Looks like something is attacking us, killing it...
/delay 1s
/varset RV_HasTarget 1
/varset RV_Fighting 1
/goto :KillAdds
}
/goto :Start
/return
Sub Event_TooClose
/tar clear
/return
Sub Event_Zoned
/sit
/delay 1m
/camp
/delay 1m
/endmacro
Sub Event_TarFar
/call Heal
/doevents
/handlecursor
/delay 1s
/if (${TooFar}==0) {
/varcalc TooFar ${TooFar}+1
/tar clear
/echo TooFar 1
/return
}
/if (${TooFar}==1) {
/varcalc TooFar ${TooFar}+1
/tar clear
/echo TooFar 1
/return
}
/if (${TooFar}==2) {
/varcalc TooFar ${TooFar}+1
/tar clear
/echo TooFar 1
/return
}
/if (${TooFar}==3) {
/varset TooFar 0
/tar clear
/echo TooFar 2
/echo calling sentinal mode
/echo Reset TooFar to 0
/call Sentinal
/return
}
/return
Sub Sentinal
/call GMCheck
/call Heal
/doevents
/call GMCheck
/if (${Sentinal}==0) {
|IF 0 goto BASE1
/echo Sentinal is - ${Sentinal}
/varcalc Sentinal ${Sentinal}+1
/echo ADDING 1 to Sentinal - - ${Sentinal}
/echo Sentinal is - ${Sentinal}
/echo GOING TO BASE1
/delay 2
/call MoveToLoc 671 -1036
/call MaintainBuffs
/varset CurrentBaseX ${Int[${Me.X}]}
/varset CurrentBaseY ${Int[${Me.Y}]}
/return
}
/if (${Sentinal}==1) {
|IF 1 goto BASE2A
/echo Sentinal is - ${Sentinal}
/varcalc Sentinal ${Sentinal}+1
/echo ADDING 1 to Sentinal - - ${Sentinal}
/echo Sentinal is - ${Sentinal}
/echo GOING TO BASE2A (but hittin the outpost and BASE2 first)
/ALT ACT 80
/delay 5s
/call MoveToLoc 640 -825
/delay 2s
/call MoveToLoc 704 -620
/delay 2s
/call MoveToLoc 815 -311
/delay 2s
/call MaintainBuffs
/varset CurrentBaseX ${Int[${Me.X}]}
/varset CurrentBaseY ${Int[${Me.Y}]}
/return
}
/if (${Sentinal}==2) {
|IF 2 goto X
/echo Sentinal is - ${Sentinal}
/varcalc Sentinal ${Sentinal}+1
/echo ADDING 1 to Sentinal - - ${Sentinal}
/echo Sentinal is - ${Sentinal}
/echo GOING TO X
/call MoveToLoc 853 540
/delay 3s
/call MaintainBuffs
/varset CurrentBaseX ${Int[${Me.X}]}
/varset CurrentBaseY ${Int[${Me.Y}]}
/return
}
/if (${Sentinal}==3) {
|IF 2 goto Peninsula
/echo Sentinal is - ${Sentinal}
/varcalc Sentinal ${Sentinal}+1
/echo ADDING 1 to Sentinal - - ${Sentinal}
/echo Sentinal is - ${Sentinal}
/echo GOING TO Peninsula
/ALT ACT 80
/call MoveToLoc 781 613
/call MoveToLoc 729 639
/call MoveToLoc 339 655
/call MaintainBuffs
/varset CurrentBaseX ${Int[${Me.X}]}
/varset CurrentBaseY ${Int[${Me.Y}]}
/return
}
/if (${Sentinal}==4) {
|IF 2 goto BASE1
/echo Sentinal is - ${Sentinal}
/varset Sentinal 0
/echo RESETING Sentinal - ${Sentinal}
/echo Sentinal is - ${Sentinal}
/echo GOING TO BASE2A (but hittin the outpost and BASE2 first)
/ALT ACT 80
/call MoveToLoc 729 639
/call MoveToLoc 781 613
/call MoveToLoc 853 540
/call MoveToLoc 825 -292
/call MoveToLoc 704 -620
/call MoveToLoc 640 -825
/call MoveToLoc 684 -1036
/echo safe and sound at home BASE1
/call MaintainBuffs
/varset CurrentBaseX ${Int[${Me.X}]}
/varset CurrentBaseY ${Int[${Me.Y}]}
/return
}
Sub Heal
/if (${Int[${Me.PctHPs}]}<40) {
/zone nedaria
/delay 4m
:Heal
/target ${Me.Name}
/call Cast "Greater Healing" gem2
/if (${Me.PctHPs}<95) /goto :Heal
/echo Sentinal is - ${Sentinal}
/varset Sentinal 0
/echo RESETING Sentinal - ${Sentinal}
/zone natimbi
/delay 4m
/ALT ACT 80
/call Sentinal
}
/return
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub Event_WardOff
/keypress forward
/keypress back
/keypress forward
/keypress back
/call Cast "Planestriders Hauberk" item
/return
Sub Event_SpeedOff
/keypress forward
/keypress back
/keypress forward
/keypress back
/call Cast "Eyepatch of Plunder" item
/return
|||||||||||||||||||SUB: MaintainBuffs |||||||||||||||||||||||||
Sub MaintainBuffs
/call GMCheck
/call Heal
/autoinv
/if (${Me.Buff[Greater Wolf Form].Duration}<30) {
/target ${Me.Name}
/call Cast "Greater Wolf Form" gem1
}
/if (${Me.Buff[Feet Like Cat].Duration}<30) {
/target ${Me.Name}
/call Cast "Feet Like Cat" gem5
}
/if (${Me.Buff[Storm Strength].Duration}<30) {
/target ${Me.Name}
/call Cast "Storm Strength" gem5
/delay 2s
/cal cast "Spirit of Eagle" gem3
}
/if (${Me.Buff[Captain Nalots Quickening].Duration}<30) {
/target ${Me.Name}
/cast item "Eyepatch of Plunder"
/itemnotify face rightmouseup
/delay 4s
}
/if (${Me.Buff[Protection of the Wild].Duration}<30) {
/target ${Me.Name}
/cast item "Planestriders Hauberk" item
/delay 7s
/itemnotify chest rightmouseup
/delay 7s
}
/if (${Me.Buff[Bramblecoat].Duration}<30) {
/target ${Me.Name}
/call Cast "Bramblecoat" gem2
}
/if (${Me.Buff[Chloroplast].Duration}<30) {
/target ${Me.Name}
/call Cast "Chloroplast" gem4
}
/if (${Me.Buff[Skin like Diamond].Duration}<30) {
/target ${Me.Name}
/call Cast "Skin like Diamond" gem4
}
/if (${Me.Buff[Nature's Precision].Duration}<30) {
/target ${Me.Name}
/call Cast "Nature's Precision" gem4
}
/if (${Me.Buff[Eagle Eye].Duration}<30) {
/target ${Me.Name}
/call Cast "Eagle Eye" gem2
}
/squelch /target clear
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/call Heal
/call GMCheck
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
:Acquire
/doevents
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100
/for RV_TargetSub 1 to ${RV_MobArray.Size}
|||||CHANGED THIS AFTER NOPCNEAR
/squelch /target radius ${RV_CurrentRadius} nopcnear 200 npc "${RV_MobArray[${RV_TargetSub}]}"
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetDead 0
/if (${Target.ID}) {
|/if (${Int[${Target.PctHPs}]}<80) {
|/echo Mob NOT a Full Health, picking another...
|/varset RV_InvalidTargetID ${Target.ID}
|/call ResetSub
|/goto :Acquire
|}
/if (${Int[${Target.Z}]}<${RV_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varset RV_HasTarget 1
/varset RV_MyTargetName ${Target.CleanName}
/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]}
/return
}
/next RV_TargetSub
/delay 2
/next RV_CurrentRadius
/if (!${Target.ID}) {
/delay 2s
/varcalc RV_FailCounter ${RV_FailCounter}+1
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s)
/if (${RV_FailCounter}>=${RV_FailMax}) {
/echo Waiting for Respawns, Resetting Failure Counter...
/call CheckAnchor
/delay 60s
/varset RV_FailCounter 0
}
/goto :Acquire
}
/return
|--------------------------------------------------------------------------------
|SUB: Moving
|--------------------------------------------------------------------------------
Sub MoveToMob
/call Heal
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/declare RV_DistanceTimer timer 15
/doevents
|/handlecursor
:MovementLoop
/if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}>100)) {
/echo Mob not at full health, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/varset RV_HasTarget 0
/call ResetSub
/return
}
/if (${Target.ID}) {
/face fast
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) {
/keypress forward hold
}
/if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) {
/keypress forward
}
/if (${Int[${Target.Distance}]}<${RV_RangeMin}) {
/keypress back
}
/if (!${RV_DistanceTimer}) {
/if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/varset RV_DistanceTimer 15
/goto :Movementloop
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/call Heal
/echo Attacking Mob NOW!
/varset RV_Fighting 1
/varset RV_TargetDead 0
/ALT ACT 184
|/disc trueshot
:CombatLoop
/call GMCheck
/call Heal
/doevents
|/handlecursor
/if (${Param1.equal[1]}) {
/pet attack
}
/face
/ranged
|/call MoveToMob
/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back
/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
||||||||||||||||||||||||||||||||||||||| LOOT____WARP ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/if (${SpawnCount[pc radius 1100]}>1) {
/echo PC close
/echo pausing the macro...
/delay 3s
} else {
/if ((${LootMobs}==1) && (!${Me.Moving})) {
/delay 6
|| /call LootMob
|| Dont use - it cant get back to the correct spot
}
}
/echo THIS WORKED 1
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}
/return
|--------------------------------------------------------------------------------
|SUB: Special Combat
|--------------------------------------------------------------------------------
Sub SpecialIt
/declare TempID int inner 0
/if (${Param2.equal[1]}) {
/cast $(Param3)
}
/if (${Param4.equal[1]}) {
/call Heal
}
/return
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/face fast
/keypress forward
/keypress back
/fastdrop on
/lootn never
/delay 2s
/loot
/delay 2s
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup
/delay 1s
/if (${RV_LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 1s
} else {
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1
/autoinventory
/delay 1s
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 1s
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
/delay 2
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/tar clear
/varset RV_HasTarget 0
/varset RV_TargetDead 0
/varset RV_Fighting 0
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[100]}+1>50) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return
|--------------------------------------------------------------------------------
|SUB: GM Check
|--------------------------------------------------------------------------------
Sub GMCheck
:check
/if (${SpawnCount[pc radius 55]}>1) {
/echo PC close
/echo pausing the macro...
/keypress forward
/keypress back
/delay 5s
/goto :check
}
/if (${Spawn[gm].ID}) {
/echo GM has entered the zone!
/echo $&#* HIM but pausing the macro...
/keypress forward
/keypress back
/delay 60s
}
/return
|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName,ArrayType)
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 1s
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (${String[${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["HunterMob.ini"]}&&${nValues}>0) {
/echo Declaring Mob Array...
/declare RV_MobArray[${nValues}] string outer
/declare RV_MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare RV_LootArray[${nValues}] string outer
/declare RV_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset RV_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_LootStats[${nArray}] 0
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1s
/return
|--------------------------------------------------------------------------------
|SUB: Display Stats
|--------------------------------------------------------------------------------
Sub DisplayStats
/declare nArray int local
/if (${Defined[RV_LootArray]}) {
/for nArray 1 to ${RV_LootArray.Size}
/echo ${Int[${RV_LootStats[${nArray}]}]} ${RV_LootArray[${nArray}]}'s
/next nArray
}
/return
|--------------------------------------------------------------------------------
|SUB: Forage
|--------------------------------------------------------------------------------
Sub Forage
/cleanup
| Verify that we have the ability to forage.
/if (${Me.Skill[Forage]}==0) {
/echo You cannot forage, silly person!
/goto :Exit
}
| Stand up. Can't forage while sitting.
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
| If we can forage then do so.
/if (${Me.AbilityReady[Forage]}) {
/doability forage
}
| If we successfully foraged something then take care of it.
/if (${Cursor.ID}) {
/call HandleItem
}
:Exit
/return
|--------------------------------------------------------------------------------
|SUB: HandleItem
|--------------------------------------------------------------------------------
sub HandleItem
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1
| Look up this item in yafm.ini
/varset ItemSetting ${Ini[yafm.ini,ForageList,${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "yafm.ini" "ForageList" "${Cursor.Name}" "1"
/varset ItemSetting 1
}
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
/if (${ItemSetting}==1) {
:LootIt
/autoinventory
/delay 5
/if (${Cursor.ID}) /goto :LootIt
} else {
/destroy
}
/return
|--------------------------------------------------------------------------------
|SUB: MoveToAnchor
|--------------------------------------------------------------------------------
Sub MoveToAnchor
/declare iCount int local
/varset iCount 0
/echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}.
:AnchorMoveLoop
/delay 1
/doevents
|/handlecursor
/face nolook loc ${AnchorY},${AnchorX}
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) {
/keypress forward hold
} else {
/keypress forward
/face away loc ${AnchorY},${AnchorX}
/return
}
/if (${iCount}>2) {
/call Detectobst
/face nolook loc ${AnchorY},${AnchorX}
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :AnchorMoveLoop
/return
|--------------------------------------------------------------------------------
|SUB: CheckAnchor
|--------------------------------------------------------------------------------
Sub CheckAnchor
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor
/return
|--------------------------------------------------------------------------------
|SUB: MoveToAnchor
|--------------------------------------------------------------------------------
Sub MoveToAnchor
/declare iCount int local
/varset iCount 0
/echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}.
:AnchorMoveLoop
/delay 1
/doevents
|/handlecursor
/face nolook loc ${AnchorY},${AnchorX}
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) {
/keypress forward hold
} else {
/keypress forward
/face away loc ${AnchorY},${AnchorX}
/return
}
/if (${iCount}>2) {
/call CheckObstacle
/face nolook loc ${AnchorY},${AnchorX}
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :AnchorMoveLoop
/return
|--------------------------------------------------------------------------------
|SUB: CheckObstacle
|--------------------------------------------------------------------------------
|# Checks to see if we may have bumped into something that is stopping us
sub CheckObstacle
|# Record our current position, wait a moment and then check if its the same
/varset MyXLOCA ${Me.X}
/varset MyYLOCA ${Me.Y}
/delay 2
/if (${MyXLOCA}==${Me.X} && ${MyYLOCA}==${Me.Y}) /call Obstacle
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle
|--------------------------------------------------------------------------------
|# Uses strafe and randomness to try and get around things
sub Obstacle
/keypress forward
/keypress back hold
/delay 5
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
/delay 3
/keypress strafe_right
} else {
/keypress strafe_left hold
/delay 3
/keypress strafe_left
}
/keypress forward hold
/return
|--------------------------------------------------------------------------------
|SUB: CheckAnchor
|--------------------------------------------------------------------------------
Sub CheckAnchor
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor
/return
|--------------------------------------------------------------------------------
|SUB: CheckAnchor
|--------------------------------------------------------------------------------
Sub Heal
/if ((${Int[${Me.PctHPs}]}<50)&&(${Me.Gem[$(Param5)]})&&(${Me.SpellReady[$(Param5)]})) {
/varset TempID ${Target.ID}
/keypress forward
/keypress back
/keypress F1
/echo Casting Heal Spell because of low health...
/cast $(Param5)
/delay 3s
/target id ${TempID}
}
/return
Last edited:

