| --------------------------------------------------------------------------
| autoShroom.mac
| harvests the kaladim fungi
| original macro was by psychotik
| Updates by BrainDeath, Exmarine
| --------------------------------------------------------------------------
#turbo
#chat tell
#event Full "#*#There was no place to put that#*#"
Sub Main
/echo Welcome to autoShroom
/declare DummyTime string outer
/declare DummyMsg string outer
/declare ShroomCount int outer
/varset DummyTime 5m
/varset DummyMsg AFK
/cleanup
/notify actionsmainpage AMP_WalkButton leftmouseup
/afk off
/delay 1s
/sit off
/delay 1s
:HarvestLoop
/call CheckForPCs
/for ShroomCount 1 to 9
/squelch /itemtarget *Blue
/if (${Ground.Distance}<150) {
/call MoveToTarget
/call GetIt
/doevents
}
/squelch /itemtarget *Red
/if (${Ground.Distance}<150) {
/call MoveToTarget
/call GetIt
/doevents
}
/call CheckForPCs
/next ShroomCount
/notify actionsmainpage AMP_RunButton leftmouseup
/delay 1s
/target clear
/face loc 661,-107
/keypress CENTERVIEW
/delay 2s
/afk ${DummyMsg}
/echo Next Harvest 6 minutes...
/delay 1m
/echo 5 minutes...
/delay 1m
/echo 4 minutes...
/delay 1m
/echo 3 minutes...
/delay 1m
/echo 2 minutes...
/delay 1m
/echo 1 minute...
/delay 1m
/echo Preparing to Harvest...
/delay ${Math.Rand[300]}
/doevents
/afk off
/delay 2s
/notify actionsmainpage AMP_WalkButton leftmouseup
/goto :HarvestLoop
/return
Sub MoveToTarget
:KeepMoving
/face loc ${Ground.Y}, ${Ground.X}
/delay 1
/keypress forward hold
/if (${Ground.Distance}>15) /goto :KeepMoving
:StopMoving
/keypress forward
/return
Sub DummyMode
/beep
/echo Entering Dummy Mode...
/delay 1s
/afk ${DummyMsg}
:waitabit
/delay ${DummyTime}
/if (${Spawn[gm].ID} || (${SpawnCount[pc radius 150 loc -140 640]}>1)) /goto :waitabit
/afk off
/delay 1s
/return
Sub CheckForPCs
/if (${Spawn[gm].ID}) {
/echo GM in Zone!
/call DummyMode
}
/if (${SpawnCount[pc radius 150 loc -140 640]}>1) {
/echo PC nearby!
/call DummyMode
}
/return
Sub GetIt
/click left item
/delay 5s (${Cursor.ID})
/delay ${Math.Rand[10]}
/autoinv
/delay 5s (!${Cursor.ID})
/delay ${Math.Rand[10]}
/doevents
/return
Sub Event_Chat
/if (!${Me.AFK}) {
/reply AFK Message: ${DummyMsg}
/afk ${DummyMsg}
}
/echo Received a Tell...Ending. Camping soon
/beep
/timed 1000 /camp
/endmacro
/return
Sub Event_Full
/echo "Your inventory is full...Ending."
/camp
/endmacro
/return