Not very pretty, but works.
Recently converted to MQData.
Posting at the request of bzt.
Requires common.inc which is included.
10-18-04:
Incorporated various suggested changes.
Completely reworked PC/GM detection.
If you want the macro to end if you receive a tell, set your character to NOT use tell windows.
Code: Select all
|---------------
| shrooms.mac
| harvests the kaladim fungi
| original macro was by psychotik
| Heavily modified by BrainDeath Last Update: 10-18-04
#turbo
#chat tell
#event Full "#*#There was no place to put that#*#"
#include common.inc
Sub Main
/if (${GameState.Equal[CHARSELECT]}) /endmacro
/cleanup
/call ClearCursor
/call DefineOuters
/call CheckForPCs
/doevents
/varset BlueCount 0
/call Harvest
/return
Sub DefineOuters
/declare DummyTime string outer
/declare DummyMsg string outer
/declare BlueCount int outer
/varset DummyTime 15m
/varset DummyMsg Stepped away for a minute...I'll be back soon
/return
Sub Harvest
/if (${GameState.Equal[CHARSELECT]}) /endmacro
/notify actionsmainpage AMP_WalkButton leftmouseup
/afk off
/delay 1s
/sit off
/delay 1s
:HarvestLoop
/if (${GameState.Equal[CHARSELECT]}) /endmacro
/call GetNextTarget
/if (${Macro.Return.Equal[NOTFOUND]}) /goto :Pause
/call CheckForPCs
/doevents
/call MoveToTarget
/call GetIt
/goto :HarvestLoop
:Pause
/notify actionsmainpage AMP_RunButton leftmouseup
/delay 1s
/target clear
/face loc 661,-107
/keypress CENTERVIEW
/delay 1s
/delay 1s
/afk ${DummyMsg}
/echo Countdown to next Harvest...
/echo 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]}
/call CheckForPCs
/doevents
/varset BlueCount 0
/afk off
/delay 1s
/delay 1s
/notify actionsmainpage AMP_WalkButton leftmouseup
/goto :HarvestLoop
/return
Sub MoveToTarget
:KeepMoving
/face loc ${Ground.Y}, ${Ground.X}
/delay 5
/keypress forward hold
/if (${Ground.Distance}>15) /goto :KeepMoving
:StopMoving
/keypress forward
/return
Sub DummyMode
/beep
/beep
/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
/call WaitForPickup
/delay 1s
/delay ${Math.Rand[10]}
/if (${String[${Cursor}].Find[Mushroom]}) {
/varcalc BlueCount ${BlueCount}+1
/if (${BlueCount}>7) /destroy
}
/autoinv
/call WaitForDrop
/delay 1s
/delay ${Math.Rand[10]}
/doevents
/return
Sub GetNextTarget
/declare BlueDistance local
/declare RedDistance local
/squelch /itemtarget *Blue
/if (${Target.Distance}) {
/varset BlueDistance ${Target.Distance}
} else {
/varset BlueDistance 999
}
/squelch /itemtarget *Red
/if (${Target.Distance}) {
/varset RedDistance ${Target.Distance}
} else {
/varset RedDistance 999
}
/if (${RedDistance}<${BlueDistance}) {
/squelch /itemtarget *Red
} else {
/squelch /itemtarget *Blue
}
/if (${Ground.Distance}>115) /return NOTFOUND
/return FOUND
Sub Event_Chat
/if (!${Me.AFK}) {
/reply AFK Message: ${DummyMsg}
/afk ${DummyMsg}
}
/echo Received a Tell...Ending.
/beep
/beep
/beep
/endmacro
/return
Sub Event_Full
/call EndMacro "Your inventory is full...Ending."
/returncommon subs
Code: Select all
| common.inc Common Subroutines
| Converted 4/30/2004
| Wait for cursor to contain something.
Sub WaitForPickup
:waiting
/delay 1
/if (!${Cursor.ID}) /goto :waiting
/return
|Wait for cursor to become empty.
Sub WaitForDrop
:waiting
/delay 1
/if (${Cursor.ID}) /goto :waiting
/return
| Send everything on cursor to inventory.
Sub ClearCursor
:Loop
/if (${Cursor.ID}) {
/autoinv
/delay 5
}
/if (${Cursor.ID}) /goto :Loop
/return
| Pause while self is targeted.
Sub Pause
/if (!${String[${Target}].Equal[${Me}]}) /return
/echo Pausing!! To resume, type /target clear or target something else.
:HoldingPattern
/delay 20
/if (${String[${Target}].Equal[${Me}]}) /goto :HoldingPattern
/return
| Error reporting.
Sub EndMacro(Error)
/echo ${Error}
/echo An error has occured.. ending macro.
/beep
/endmacro
/return



