Page 1 of 1

Pathed Farming Macro for any zone.

Posted: Fri Aug 27, 2004 9:00 pm
by Override
I got a lot of messages wanting to post just my farming macro that I am going to use in my tailoring macro. I have put it on the website:

http://www.soc-music.com/mq2/

It is under Other Macros. I'm not going to post it, that way I only have to update it on my website in the zip file and don't have to update it here everytime I edit it too. I have included the pathing for inside Netherbain Lair to farm Porous Mineral Blocks for tinkering. Every tinker that has MQ needs this macro. LOL. It has saved me a LOT of time getting my tinkering up. But anyways, I have commented it pretty way so it is very easy to add new zones to it and all you have to do is add in the locs that you want to use for your path, the loot you want and the mobs you want to kill in the ini file. Its pretty easy to use. It was designed to melee only. You can edit it to your likings if you want the character to cast something. I used a 65 warrior with almost 9k hp unbuffed to farm with this, so I never needed any kind of heal or anything for it. I haven't added in the pathing for the silk I am using for the tailoring macro yet. That will be released once I get the tailoring macro done. Anyways, enjoy the macro. Hopefully you will be able to translate my comments to add your own pathing.

Here is where you need to start this macro:

Image

odd (and deadly) behavior

Posted: Tue Oct 26, 2004 8:06 pm
by diespammers_2000
Thanks for writing and posting a sweet macro! I'll have to learn how to use advpath to record a path, so I don't have to type in all those locs myself. :smile:

I've learned the hard way that using farming.mac in Everfrost Peaks can be deadly. Every few minutes (or sometimes hours) it targets on something WAY too far off (maybe not even a real target?) and my poor character takes off in some weird direction, way off path, and either gets stuck running into the edge of the map or goes climbing the ice cliffs and dies from falling off the other side.

I have the path set to loop through the canyons. Often the loop is traversed successfully. ...then ZING! Off he goes.

I'm afraid if I use this in a zone with a coast he'll drown, or in a zone with a whole side zone boundary, that he'll switch zones.

Is this a bug or a lag problem? What other details can I give you if you are interested in fixing this? Anyone else have this problem?

Posted: Sat Oct 30, 2004 7:38 pm
by Zelker
Yep, it looks like I am getting the same error too :( . I think it has to do with the loc array and it not knowing the when to end or loop back to the start at Loc1. That was all I could figure from my minor macro writting skills. I'm not sure if Override is around much lately, so if anyone is good with arrays and wants to take a look and help, it would be appreciated.
thanks,
-Z

Posted: Fri Nov 12, 2004 8:24 am
by s0rcier
Well i know override give up all his eq account and move to eq2 pre-beta and his on eq2 now ... not sure those will have any more support for now on...

s0rCieR

Posted: Sun Nov 21, 2004 7:52 am
by BottgottenMonk
Ok I have been looking at the it appears that some time the char runs past the locs and ends up running in circles. You can reduce this in increasing the tolerances.
/if (${Math.Distance[${RV_LocArray[${Location}]}]}>4) { | Maybe make this a constant and tailor for chars with runspeed(x) or horses
/nomodkey /keypress forward hold
/if (${SetMobs}==1) {
/for Mobs 1 to ${RV_MobArray.Size}
/squelch /target radius ${SetRadius} zradius ${SetZRadius} nopcnear npc "${RV_MobArray[${Mobs}]}"
/if (${Target.CleanName.Equal[${RV_MobArray[${Mobs}]}]}) {
/echo ${Target.CleanName} is on list!
}
/if (${Target.ID}) /call MobCheck
/next Mobs
} else {
/squelch /target npc radius ${SetRadius} zradius ${SetZRadius} nopcnear
/if (${Target.ID}) /call MobCheck
}
/face nolook loc ${RV_LocArray[${Location}]}
/look
}
/if (${Math.Distance[${RV_LocArray[${Location}]}]}<=4) | Maybe make this a constant and tailor for chars with runspeed(x) or horses{
The same seems to go for the GoBackTo Subroutine but not so much so because it is not checking for mobs here.

I also moved this bit from
:KillStart
/if (!${Me.Combat}) /attack
to
/if (!${Me.Combat}) /attack
:KillStart


That way if you get stuck behind a rock or tree turn attack off move round it and turn it back on to resume the persuit.

Oh if you are interested I knocked up a little route recorder for making the path for zone that samples movment every 3 secs to make it look a little more human.

Posted: Fri Nov 26, 2004 11:18 am
by draco
I'm definitely interested in a route recorder

RecPath.mac

Posted: Sat Dec 18, 2004 12:05 pm
by BottgottenMonk
Ok this records the path in to farming macro ini file. To use Press attack start macro, when you have finsihed the path just stop attack to stop recording. I am hoping to add the targets that you look at whilst pathing to create the mobs list later.

Code: Select all

sub Main

	/declare counter int inner 1
   /declare MyXLOC float inner	0.0
   /declare MyYLOC float inner	0.0
   /declare MyPrevXLOC float inner	0.0
   /declare MyPrevYLOC float inner	0.0
   /declare INIFile string farming.ini

   /varset counter 1
   /echo Attempting to Read Section "${Zone.Name}" Zone Information from ${INIFile}
   /delay 1s 

:start
  	/if (${Ini["${INIFile}","${Zone.Name}", "Loc${counter}"]}) {
		/echo File already recorded
		/return
  	} else {
		/varset MyXLOC ${Me.X}
   		/varset MyYLOC ${Me.Y}
		/if (${Me.Combat}) {
			/if ( ${MyXLOC} == ${MyPrevXLOC} ) {
				/delay 1
			} else {
				/if ( ${MyYLOC} == ${MyPrevYLOC} ) {
				/delay 1
			} else {
					/echo Recording Loc ${Me.X}, ${Me.Y} to Zone ${Zone.Name} position ${counter}
					/ini "${INIFile}" "${Zone.Name}" "Loc${counter}" "${Me.Y}, ${Me.X}"
					/delay 3s
					/varcalc counter ${counter}+1
 
				}
			}

		}	
	}
	/if (${Me.Combat}) /goto :Start

/return

Posted: Sun Dec 19, 2004 10:31 am
by KungFuHamster
I just made a hotkey called LOC that does this:

/mqlog loc=${Me.Y}, ${Me.X}
/echo loc=${Me.Y}, ${Me.X}

I also made a macro for the mobs, very similar;

/mqlog Mob=${Target.CleanName}
/echo Adding ${Target.CleanName} to kill list

And

/mqlog NotMob=${Target.CleanName}
/echo Adding mob to spare list

Two caveats. You have to go to the mqlog file and manually edit out the timestamp (I use EditPlus; you can Select by Column and just yank them all out at once) and then you have to add the numbers after each entry aka loc1, loc2, loc3.

If you have a big path, something like BottgottenMonk's script would be better because of all the loc#'s you have to do, but I would rewrite it so that you can trigger each loc manually.

After reading BottgottenMonk's script, I guess using /ini directly would save me a step.

Posted: Sun Apr 10, 2005 5:05 pm
by Twen
in the last month or so not sure when it started exactly but, when i try to use this macro, /mac farming i get this message in mq2 window:

Flow ran into another subroutine.
farming.inc@39 (Setup): Sub Setup
farming.mac@41 (Main): /call Setup
The current Macro has ended.

any help would be cool

Posted: Tue Apr 19, 2005 10:13 am
by Robbiem01
I had a problem with the macro not closing loot window if there were no items on the corpse. Here is my modification that worked, before and after code shown.

Before:

Code: Select all

Sub LootMob 

   /declare LootSlot    int inner  0 
   /declare LootCheck   int inner  0 
   /declare LootTotal   int inner  0 
   
   /delay 1s
   /face fast 
   /keypress forward 
   /keypress back 
   /keypress forward
   /delay 2s 
   /loot 
   /delay 2s
   /doevents
   /if (!${Corpse.Items}) { 
      /echo NO LOOT! Cheap Bastard!
      /return 
   }
   /varset LootTotal ${Corpse.Items} 
   /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} leftmouseup 
      /delay 1s 
      /if (${RV_LootAllItems}) { 
         /echo Keeping a ${Cursor.Name}... WOOT! 
         /autoinventory 
         /delay 1s 
      } else { 
         /for LootCheck 1 to ${RV_LootArray.Size} 
            /if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) { 
               /echo Keeping a ${Cursor.Name}... WOOT! 
               /autoinventory 
               /delay 1s 
            } 
         /next LootCheck 
      } 
      /if (${Cursor.ID}) { 
         /echo Destroying a ${Cursor.Name}... 
         /destroy 
         /delay 1s 
      } 
   /next LootSlot 
   /notify LootWnd DoneButton leftmouseup 
   /delay 2 
   /look
/return 
After:

Code: Select all

Sub LootMob 

   /declare LootSlot    int inner  0 
   /declare LootCheck   int inner  0 
   /declare LootTotal   int inner  0 
   
   /delay 1s
   /face fast 
   /keypress forward 
   /keypress back 
   /keypress forward
   /delay 2s 
   /loot 
   /delay 2s
   /doevents
   /if (!${Corpse.Items}) { 
      /echo NO LOOT! Cheap Bastard!
      /notify LootWnd DoneButton leftmouseup 
      /return 
   }
   /varset LootTotal ${Corpse.Items} 
   /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} leftmouseup 
      /delay 1s 
      /if (${RV_LootAllItems}) { 
         /echo Keeping a ${Cursor.Name}... WOOT! 
         /autoinventory 
         /delay 1s 
      } else { 
         /for LootCheck 1 to ${RV_LootArray.Size} 
            /if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) { 
               /echo Keeping a ${Cursor.Name}... WOOT! 
               /autoinventory 
               /delay 1s 
            } 
         /next LootCheck 
      } 
      /if (${Cursor.ID}) { 
         /echo Destroying a ${Cursor.Name}... 
         /destroy 
         /delay 1s 
      } 
   /next LootSlot 
   /notify LootWnd DoneButton leftmouseup 
   /delay 2 
   /look
/return 
There are also a few problems i'm having with the macro that I haven't been able to fix yet .. maybe someone else knows more.

1) If a mob adds on me while i'm killing one, my pet finishes off the add and the macro never loots the add's corpse.
2) Getting the macro to delete items not specified in the loot section of the ini. I have /varset RV_LootAllItems 0 for the zone i'm farming in setup in the farming.inc but yet it loots every item on the corpse. The loot table on the mobs i'm farming is huge too so it would be a pain to specify all items i'm supposed to delete.
3) Pathing. I'm getting stuck on trees, rocks, and whatnot. I'm planning on just making the pathing code very detailed but was wondering if there was a better way. It seems like MQ could just attempt to target Mob1, Mob2, ..., MobN then /face and go kill it and repeat rather than pathing around but I don't have the coding knowlege to do that yet (I'm a newbe t o this stuff yet.)

Anyways, thanks for the awesome macro and any help you can give me. It does work very well for the most part.

Problem with this macro

Posted: Mon Apr 25, 2005 6:05 pm
by BigDaddyDinDin
Guys,

I tried to adapt this macro to work in East COmmon so I could farm a few Deathfist Belts.

Here is the problem, when I start the macro the toon runs off in the distance and then starts to run the macro. Not even close to where i recorded the LOCs from the recorder snippet in this thread. It runs the macro correctly in that location, could it be that when I am getting the LOC numbers it is giving me bad info? I even tried to take a loc and then type it in manually in the file. Still no luck.

ALso tried the /mqlog loc= hotkey posted in this thread and there is no joy for me.

When you take a loc such as 1091.10, 2678.23, -32.65 how is this to be entered into the files for the Farming Mac? Which is the X, Y?