Code: Select all
| - Forage.mac -
|
#turbo
#event Skillup "You have become better at Forage"
#event Failed "You fail to locate any food"
#chat tell
Sub Main
/cleanup
/call ClearStats
/varset v99 0
/varset t1 10m
/doevents flush
:Forage
/varset l0 $return
/if n $calc($l0+$v99)>0 /call Event_Timer
/if n $calc($l0+$v99)>0 /return
/if $char(ability,Forage)>0 /if $cursor()==NULL /call Looking
/if $cursor()==TRUE /call KeepStats "$cursor(name)"
/if $cursor()==TRUE /call KeepItem
/doevents
/goto :Forage
/return
Sub Looking
/varadd v10 1
/doability Forage
/return
Sub KeepItem
/if "$cursor(name)"!="Fish Scales" /call DoLog "foraged up some $cursor(name)..."
/click left auto
/return
Sub KeepStats
/if "$p0"~~"Pod of Water" {
/varadd v0 1
} else /if "$p0"~~"Roots" {
/varadd v1 1
} else /if "$p0"~~"Vegetables" {
/varadd v2 1
} else /if "$p0"~~"Berries" {
/varadd v3 1
} else /if "$p0"~~"Fruit" {
/varadd v4 1
} else /if "$p0"~~"Fishing Grubs" {
/varadd v5 1
} else /if "$p0"~~"Rabbit Meat" {
/varadd v6 1
} else {
/varadd v7 1
}
/return
Sub Event_Skillup
/varadd v8 1
/return
Sub Event_Timer
/varcalc v11 $v9/$v10*100
/call DoLog "Run time: $calc($running/60) min /// Skill ups: $int($v8) /// Fails: $int($v9) /// Total Foraged Atempts: $int($v10) /// Fail Rate: $int($v11) % "
/call DoLog "Found: $int($v0) Pods of water - $int($v1) Roots - $int($v2) Vegetables - $int($v3) Berries - $int($v4) Fruits - $int($v5) Fishing Grubs - $int($v6) Rabbit Meat - $int($v7) zone items"
/varset t$p0 $p1
/return
Sub ClearStats
/varset v0 0
/varset v1 0
/varset v2 0
/varset v3 0
/varset v4 0
/varset v5 0
/varset v6 0
/varset v7 0
/varset v8 0
/varset v9 0
/varset v10 0
/return
Sub Event_Chat
/mqlog ** $p1: '$p2'
/return
Sub DoLog
/mqlog $p0
/echo $p0
/return
Sub Event_Failed
/varadd v9 1
/return
saw a few request for this ... hope it is helpfull ...
Muddle..
