Kaladim Fungi Harvester

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Kaladim Fungi Harvester

Post by BrainDeath » Tue May 04, 2004 4:09 pm

Harvest the fungi at the farm in Kaladim.
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."
/return

common 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 
Last edited by BrainDeath on Mon Oct 18, 2004 5:44 pm, edited 13 times in total.

elkcit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Aug 31, 2002 3:20 pm

Post by elkcit » Tue May 04, 2004 8:13 pm

nice macro.. what is the kaladim fungi used for?

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Post by BrainDeath » Tue May 04, 2004 9:11 pm

It's used to brew Kaladim Constitutionals.

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Wed May 05, 2004 11:18 am

Thanks! it works!

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Sat May 08, 2004 2:49 am

hrmm..after testing it a bit further it seems there is a small glitch.

Mr collector runs around and does fine most of the time..but if he sits near the fence, when he stands up or something, he runs in a circle, hits the water and swims against a wall till I pull him out.

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Post by BrainDeath » Sat May 08, 2004 2:00 pm

Hmmm...never seen that problem myself and i've left this macro running for hours on occasion.

You might try the following: Increase the value of 15 in the line with
${Ground.Distance}>15 and see if that helps. You could also try putting your toon in walk mode instead of run.

Let me know if either of these helps.

ChrisCim
a lesser mummy
a lesser mummy
Posts: 77
Joined: Sun Feb 29, 2004 2:45 am

Post by ChrisCim » Sat May 08, 2004 4:05 pm

Works good so far, I'll let it run for awhile and post any problems I see.

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Sat May 08, 2004 5:41 pm

increased 15 to 20..and works great ..been running about 6 hrs..only other issue I saw so far is that it got stuck in dummy mode when I PC approached..he did his thing and never started back.

thanks for this wonderful macro!

byterunner
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Nov 06, 2003 11:01 pm

Post by byterunner » Fri May 28, 2004 9:19 pm

humm.. this seems to have stopped working for me since I updated to the 5/27/04b version. Did something change recently that made this stop working?? I glanced through the changes log and checked it against the code but just don't see what the problem is. :( . my guy turns toward the shroom and looks at it but never picks it up. If i manually click the shroom for pickup it gets auto-inventoried and then turns and moves to next shroom and just sits there. Seems he has gone on picking strike or something. If anyone can throw me a bone on this one it would be greatly appreciated.

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Post by BrainDeath » Fri May 28, 2004 9:34 pm

As far as I can tell, /click left item no longer works as of the May 27 zip.

It has been mentioned in another thread, so I am hoping that it gets fixed sometime. It also broke my most used tradeskill macro which uses /click left item to open enviro containers that have been targeted with /itemtarget. :(

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Sat May 29, 2004 11:32 am

Fixed:
HERE
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Wed Jun 02, 2004 10:03 pm

used tonight after patch and it works flawlessly. thanks for a great macro.

thanks,
geo

lycan138
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jun 21, 2004 2:29 pm

Post by lycan138 » Wed Jun 30, 2004 4:48 am

just not working for me.
target nearest shroom then gives me

Failed to parse /if condition'(22.53<11.67)', non-numeric encountered
shrooms2.mac@132 (GetNextTarget):
(${RedDistance]<${BlueDistance}) {
shrooms2.mac@35 (Harvest): /call GetNextTarget
shrooms2.mac@19 (main): /call Harvest

I mean i understand that the first if condition causes the problem which meanst hst the folling commands wont work, but i dont get why the first error. splain me so i can understand?

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Wed Jun 30, 2004 5:02 am

Your problem is not the macro but PHBB you need to check you macro and do this:

Code: Select all

All < and > have been changed to their html safe equivalents (  < and > )
Find this - < and change it to this <

and

Find this - > and change it to this >
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

Carrotcruncher
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Jun 27, 2004 4:19 am

Post by Carrotcruncher » Wed Jun 30, 2004 7:28 am

Works for me - grat macro - thanks very much :wink: :lol: