Yet Another Forage Macro - yafm

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

Moderator: MacroQuest Developers

shadowman33
orc pawn
orc pawn
Posts: 18
Joined: Sun Feb 20, 2005 7:50 pm

auto sit

Post by shadowman33 » Thu Mar 03, 2005 11:29 am

Just curious, but could this macro be modified so you could be sitting, foragre, then the macro will sit you back down automatically? Only reason I ask is because I like to use this macro while I am medding. I ride on a Drog so I do not use the macro full time except when I leave for the night and just sit in Guild Hall and let macro run all night to skill up. When I run out of mana, I like to get off the drog, start this macro, then sit down. Only problem is I have to keep sitting myself back down after I forage attempt. It's not a complaint because the macro works wonderfully. Was just wondering if someone could modify it for people like me so I will sit back down to med after foraging.

idoit2
orc pawn
orc pawn
Posts: 12
Joined: Thu Nov 11, 2004 2:18 am

..

Post by idoit2 » Tue Mar 15, 2005 7:29 pm

im sure im doing something wrong but i looked couldnt figure it out when i try to stay the mac it says you no longer have a target. the current macro has ended. if anyone could help me id appreciate it!

The0Eldest
decaying skeleton
decaying skeleton
Posts: 2
Joined: Wed Mar 23, 2005 2:35 pm

Post by The0Eldest » Wed Mar 23, 2005 2:39 pm

The correct fix for mdar's code is...

Code: Select all

/varset ItemsHave ${FindItemCount[=${Cursor.Name}]}
Instead of...

Code: Select all

 /varset ItemsHave ${FindItem=${Cursor.Name}} 
This error was because of a missprint in the Manual, the example doesn't show "Count" in the command.

Works great with that slight change.

eqsomebody
a lesser mummy
a lesser mummy
Posts: 74
Joined: Thu Jul 29, 2004 10:36 am

Re: ..

Post by eqsomebody » Thu Mar 31, 2005 11:24 pm

idoit2 wrote:im sure im doing something wrong but i looked couldnt figure it out when i try to stay the mac it says you no longer have a target. the current macro has ended. if anyone could help me id appreciate it!
Running into the same problem. I'm using the original macro posted at the top of thread. The macro is not automatically foraging. When I hit my hotkey for forage and find something, it will auto inventory the item but will not automatically forage. Suggestions?

eqsomebody
a lesser mummy
a lesser mummy
Posts: 74
Joined: Thu Jul 29, 2004 10:36 am

Post by eqsomebody » Thu Mar 31, 2005 11:33 pm

As an update to my post, I found that I did not have Forage assigned to an ability under my Actions window. Once I assigned Forage to one of the abilities, I was off to the races..

Thanks.

Steggo
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Apr 20, 2005 2:44 pm

Post by Steggo » Wed Apr 20, 2005 2:52 pm

Modified quite a bit to be more useful for me, plan on making it an inc. once I get all the bugs out. Basically it'll run without hindering anything you do (unless you're anal about the precious seconds you lose while it pauses your combat). Any suggestions or comments welcome, still pretty new to all this.

Code: Select all

|04/20/05 
|yafm.mac 
| 
|Yet Another Forage Macro
| 
|Ini File: yafm.ini 
| 
| 0 = destroy 
| x = keep at most x of this item 
| 
|New foraged items are added to the ini file automatically and are kept by default. 
|04/20/05: You should return to sitting or fighting as applicable.
|04/24/05 Will stop the macro automatically if you camp 
| -- was causing an issue spamming your MQ window at character select screen.
|04/25/05 Added a check to see if you are at the bank, casting a spell,
| or have your spellbook open so you won't get spammed.

#event Success "You have scrounged #*#"
#event Camp "It will take about #*#"

|||||||||||||||||||| 
| Main 
|||||||||||||||||||| 
sub Main

    /declare DefaultMaxSave int outer 

    /varset DefaultMaxSave ${Ini[yafm.ini,Default,MaxSave,${NotFound}]} 
    /if (${DefaultMaxSave}==${NotFound}) { 
       /ini "yafm.ini" "Default" "MaxSave" "100" 
        /varset DefaultMaxSave 100 
    } 

   | Verify that we have the ability to forage. 
   /if (${Me.Skill[Forage]}==0) { 
      /echo You cannot forage, silly person! 
      /goto :Exit 
   } 

:Forage 
   | If we can forage then prepare to do so and return to previous state--
   | sitting or attacking so far. Am I missing anything?
	 /if (${Me.AbilityReady[Forage]}) { 
   		/if ( ${Window[BigBankWnd].Open}) {
  	 		/goto :Forage
  	 	}
  	 	/if ( ${Window[SpellBookWnd].Open}) {
  	 		/goto :Forage
  	 	}
  	 	/if ( ${Me.Casting.ID}) {
				/goto :Forage
			}
      /if (${Me.State.NotEqual[STAND]}) { 
        /stand 
        /delay 1s
        /doability forage 
        /sit
      } else /if (${Me.Combat})	{
      	/attack off
      	/delay 1s
        /doability forage
        /attack on 
      } else {
      	/delay 1s
      	/doability forage
      }
   }
   /doevents      
   /goto :Forage 

:Exit 
/return 

||||||||||||||||||||
| Success
||||||||||||||||||||
sub Event_Success
   | If we successfully foraged something then take care of it.
   /if (${Cursor.ID}) {
      /call HandleItem 
   } 
/return

||||||||||||||||||||
| Camp
||||||||||||||||||||
sub Event_Camp
	/echo "Camping, macro ended."
	/endmacro
/return

|||||||||||||||||||| 
| HandleItem 
|||||||||||||||||||| 
sub HandleItem 

   /declare ItemSetting int local 
   /declare NotFound int local 
   /declare ItemsHave int local 

   /varset NotFound -1 

   :LootIt 

   | Look up this item in yafm.ini 
   /varset ItemSetting ${Ini[yafm.ini,ForageList,${Cursor.Name},${NotFound}]} 
   /delay 5 

   | If the item isn't in the .ini file then add it. 
   /if (${ItemSetting}==${NotFound}) { 
       /ini "yafm.ini" "ForageList" "${Cursor.Name}" "${DefaultMaxSave}" 
       /varset ItemSetting ${DefaultMaxSave} 
   } 

 
/varset ItemsHave ${FindItemCount[=${Cursor.Name}]}  

   | If we're keeping this item then stash it in our bags. 
   | Otherwise, just destroy it. 
   /if (${ItemSetting}>${ItemsHave}) {  
     /autoinventory 
   } else { 
     /destroy 
   } 

   /delay 5 
   /if (${Cursor.ID}) /goto :LootIt 

/return
*Edit* 04/24/05 Will stop the macro automatically if you camp -- was causing an issue spamming your MQ window at character select screen.

*Edit* 04/25/05 Added a check to see if you are at the bank, casting a spell, or have your spellbook open so you won't get spammed.
Last edited by Steggo on Wed Jan 10, 2007 4:32 pm, edited 1 time in total.

Cybmax
a lesser mummy
a lesser mummy
Posts: 54
Joined: Wed Jul 28, 2004 1:55 pm

Post by Cybmax » Tue May 24, 2005 1:24 pm

Hmm.. what am i doing wrong? I only get "Cannot call when a macro isn't running" when i start it.. do i have to put some options on it or??

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Tue May 24, 2005 2:05 pm

That's the error message you would get if you just typed "/call <something>" in game. Are you sure you pasted the macro properly and are starting it properly?

Cybmax
a lesser mummy
a lesser mummy
Posts: 54
Joined: Wed Jul 28, 2004 1:55 pm

Post by Cybmax » Wed May 25, 2005 7:23 am

Copy paste from the one 2 messages up..

I type /macro yafm

i got yafm.ini in the same folder as yafm.mac

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Wed May 25, 2005 9:28 am

There is only one /call statement in that whole macro. Check the line number that the error gives you. What is on that line? Also, check your line wrap. Each line should start with a command or a comment. Depending on how you pasted the macro and what program you used to do it, there may be line wrap issues.

creamsoda
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Apr 29, 2005 2:32 pm

Post by creamsoda » Sat Jun 18, 2005 4:29 pm

I'm getting the "Cannot call when a macro isn't running" message alsowhen trying to start the macro. It's copied verbatim to whats posted above. No error message givin. Just the "Cannot call when a macro isn't running"

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Sun Jun 19, 2005 12:50 am

You're doing something wrong. I run this macro regularly with no problems at all. As I said above, there is only one /call statement in the entire macro. How are you saving the macro? How are you running the macro?

creamsoda
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Apr 29, 2005 2:32 pm

Post by creamsoda » Sun Jun 19, 2005 4:19 pm

Some thing somewhere is getting lost in the translation. I have the macro scripted from a copy format the same as whats listed above. Looking at the script I see nothing off hand that would cause the notation I listed previously. Note that when I run the script I get no mention of an error on line "so and so". I've even removed to call line from the script itself to see if that changes the line to an actual error but there was no change on my end.

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Sun Jun 19, 2005 4:44 pm

Can you run any other macro?

ziptop21
decaying skeleton
decaying skeleton
Posts: 1
Joined: Mon Jun 20, 2005 3:17 pm

Post by ziptop21 » Mon Jun 20, 2005 3:19 pm

Delete all of this


|** 04/20/05
|yafm.mac
|
|Yet Another Forage Macro
|
|Ini File: yafm.ini
|
| 0 = destroy
| x = keep at most x of this item
|
|New foraged items are added to the ini file automatically and are kept by default.
|04/20/05: You should return to sitting or fighting as applicable.
|04/24/05 Will stop the macro automatically if you camp
| -- was causing an issue spamming your MQ window at character select screen.
|04/25/05 Added a check to see if you are at the bank, casting a spell,
| or have your spellbook open so you won't get spammed.

and it should work