lol GoatFoot, was messing with it myself:
Code: Select all
|-----------------------------------------------------
| Shin Noir's ideal AFK Forage (modified from EnterTheFist's simple PoJ forager) Sept 9th 2003
| Multi-Zone Forage:
| An endless forage macro for any given zone.
| Keeps items listed in forage.ini (auto-generated)
|
| Note! It is HIGHLY recommended you do NOT pick up anything while running this macro.
| Doing so MAY delete the item you have on the cursor, You have been warned.
|---------------------------------
| Commands: /mac forage [help|list|clear|add|del] "[item]"
|
| Ex: /mac forage add "Justice Fruit"
|-----------------------------------------------------
|
| Quick Reference for Different Forage Tables:
| http://www.eqdruids.com/reference/foraging/foraging_main.htm
|
#event ZoneChange "You have entered"
#define CurZone v10
Sub Main
/call ZoneSetup
/if "$p0"!="" /call ForageConfig "$p0" "$p1" "$p2" "$p3"
| Added a delay here to allow EQW users to unlock the mouse first.
/delay 20
:Forage
/if n $char(ability,"Forage")>0 /doability "Forage"
/doevents
/goto :CheckItem
:CheckItem
/if "$cursor(name)"=="NULL" /goto :ForageDelay
/for l0 1 to $a(0,0)
/if "$cursor(name)"=="$a(0,$l0)" /goto :KeepItem
/doevents
/next l0
/goto :DestroyItem
:KeepItem
/click left auto
/goto :ForageDelay
:DestroyItem
/click left destroy
/goto :ForageDelay
:ForageDelay
/delay 895
/goto :Forage
/return
sub ZoneSetup
/varset CurZone "$zone"
/for l0 1 to 10
/if "$ini("forage.ini","$CurZone","$l0")"=="NOTFOUND" {
/goto :EndSetup
} else {
/if "$ini("forage.ini","$CurZone","$l0")"=="" /goto :EndSetup
/varset a(0,$l0) "$ini("forage.ini","$CurZone","$l0")"
}
/doevents
/next l0
:EndSetup
/varset a(0,0) $int($calc($l0-1))
/echo $a(0,0) Items set to keep on auto-forage for $zone
/return
sub event_ZoneChange
/if "$zone"!="$CurZone" /call ZoneSetup
/return
sub ForageConfig
/if "$p0"=="help" /echo Syntax: /mac forage [help|list|clear|add|del] "[item]"
/if "$p0"=="list" {
/echo $Zone Forage List:
/if n $a(0,0)>0 {
/for l0 1 to $a(0,0)
/echo $l0: $a(0,$l0)
/doevents
/next l0
}
}
/if "$p0"=="add" {
/for l0 1 to 10
/if "$ini("forage.ini","$CurZone","$int($calc($l0))")"=="NOTFOUND" {
/ini "forage.ini" "$CurZone" "$l0" "$p1"
/goto :DoneAdding
} else {
/if "$ini("forage.ini","$CurZone","$int($calc($l0))")"=="" {
/ini "forage.ini" "$CurZone" "$l0" "$p1"
/goto :DoneAdding
}
}
/next l0
/varset l0 0
:DoneAdding
/if n $l0>0 /echo Added $p1 as forage item # $l0 in $Zone.
}
/if "$p0"=="del" {
/if "$p1"=="" {
/echo Syntax: /mac forage delete "[item]"
/goto :DoneDeleting
}
/if $a(0,0)==0 {
/echo no items in $Zone to delete.
/goto :DoneDeleting
}
/for l0 1 to $a(0,0)
/if "$ini("forage.ini","$CurZone","$int($calc($l0))")"=="$p1" {
/for l1 1 to $calc($a(0,0)+1)
/varadd l2 1
/if $l1==$l0 /varadd l1 1
/ini "forage.ini" "$CurZone" "$int($l2)" "$a(0,$l1)"
/doevents
/next l1
/goto :DoneDeleting
}
/next l0
/varset l0 0
:DoneDeleting
/if n $l0>0 /echo Deleted $p1 from item # $l0 in $Zone.
}
/if "$p0"=="clear" {
/if $a(0,0)==0 /goto :DoneClearing
/for l0 1 to $a(0,0)
/ini "forage.ini" "$CurZone" "$int($l0)" ""
/next l0
:DoneClearing
/echo Cleared Forage List for $zone.
}
/endm
/return
I rather like this code ^^