Hunter.mac - Hunting script --- Updated

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Wed Nov 20, 2002 4:08 am

also check that you have

Code: Select all

#define HomeY v58 
#define HomeX v59 
at the top of the include script.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

Finally

Post by Malachi » Thu Nov 21, 2002 1:50 pm

Because I'm sure everyone was eagerly awaiting it...I'd just like to say that I got it working, and everything's radical.

The weird thing is that I discovered that for the runhome part, I have to specify my x and y reversed...it had me resting in the middle of nowhere till I reversed them. No worries now.

Anyone have ideas for fixing the aggro while resting or the aggro while fighting problem? I know how xylo handles text on the chat box, but not MQ...seems like there should be a simple "hits you" extention to the one that's already there to stand, kill, and run back to safe area.

Thanks again Fippy, great script you have here.

~Malachi

Oh...PS..I should mention that I went in and removed all superfluous spaces following all sub's. :) That helped a lot.
~Oh danny boy, the pipes the pipes are calling.~

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Nov 22, 2002 12:36 am

Malachi wrote:The weird thing is that I discovered that for the runhome part, I have to specify my x and y reversed...it had me resting in the middle of nowhere till I reversed them. No worries now.
Um. You never noticed that the EQ locations have reversed coordinates? X and Y are always swapped. Everything in EQ is y,x instead of x,y.

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

Doh!

Post by Malachi » Fri Nov 22, 2002 1:13 pm

I had stopped playing EQ for about a year...that probably explains why when I came back I couldn't find anything via /loc to save my life. Hehe.

#insert noob.mac

~Malachi
~Oh danny boy, the pipes the pipes are calling.~

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Nov 22, 2002 8:49 pm

Well, I primarily play non-tracking classes, and before I found MQ, I got pretty darned good at finding my way around with /loc.. I still only rarely use MQ to 'track' to a mob at a known location, I'm still used to using my old landmarks and locs :D

AlphaBeta
a ghoul
a ghoul
Posts: 126
Joined: Sat Nov 09, 2002 12:35 am

Post by AlphaBeta » Thu Dec 05, 2002 12:35 pm

This message is not a flame. I am still new to MQ and I love this macro. Just started using this macro the other day. I have however found a few flaws in it and am not any where near the point I would know how to go in and fix them.

1. The log file is way, way to chatty.
2. The on screen reporting is also way to chatty. I really like Farmpad.mac (less chatty, finds mobs better, maybe fights a little better but I am not sure.) but it doesn’t have all features hunter.mac does.
3. The anti-Ksing code seems poor. I found myself Ksing a number of times. Perhaps +Adding+ to the curent code (the curent code is good just add the /assist part) an /assist on your target to determine if the Mob is taken up to the point when you engage the mob would help.
4. The Alert 4 mobs don’t seem to be avoided at all once you have a target or if you don’t have a target.
5. The code to fight if your being attacked by a add/something else aggro’s doesn’t seem to work most of the time if at all.
6. The macro doesn’t seem to see targets that it could be attacking at times and sits and does nothing (showeq).
7. The area avoidance code seems to make you look a little jerky/robot like when going around an area.

Things I would love to see:

1. Avoid mobs with in an area all together until they leave that area.
2. Some more AI on what your fighting or what is attacking you. I.E. if the mob is a Red/yellow and depending on your level Blue Con run to your Home location or don’t attack at all or avoid. Might be better to use Con messages rather than colors.
3. Add spell casing for hybrids. Buffs, heals, snares, dots etc. depending on class.
4. Total area avoidance for some areas. Some zones are not layed out as well as EC and the zones are odd shapes etc.
5. Better AI to take you around an avoided area via shortest path. I.E. Don’t always go around clock wise.
6. A way to use both soundex or full name support Not sure if that makes any sense or not.

AlphaBeta
a ghoul
a ghoul
Posts: 126
Joined: Sat Nov 09, 2002 12:35 am

Post by AlphaBeta » Thu Dec 05, 2002 2:09 pm

Sigh... Boards not working well today. Can someone please remove dupe posts?

AlphaBeta
a ghoul
a ghoul
Posts: 126
Joined: Sat Nov 09, 2002 12:35 am

Post by AlphaBeta » Fri Dec 06, 2002 12:46 pm

Ok now that the boards are working again for me ::sigh:: will an admin remove my multi-posts please?

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Post by lifewolf » Wed Dec 11, 2002 11:10 am

Nerfy wrote:I had a similar problem. Remove the quotes. This is a problem with MQ. I have never been able to specify specific targets using alerts - only similar ones. So that if I try:

Code: Select all

/alert 1 add "a fire beetle"
/alert 1 add a fire beetle
/alert 1 add beetle
The first one will look for a mob called ". There are no mobs with the name " so it will tell you just that. The second alert will look for a mob called a. Here you will get quite a few hits. a bat, a wolf, etc. Similar to the first word. The last will return all beetles.

Problem with this is that you want 'a fire beetle' and not 'a dragon beetle' which is level 50+ with a bad attitude.

My solution? Well, the alerts were done so that you would have a convient way of defining what to target. Just specify your targets. I have made a FindTarget routine that doesn't rely on MQ at all. It's a pain to customize, but I feel safer using it. I'm at work right now, but here's the way it runs as best as I can remember.

Code: Select all

sub FindTarget
   | Successful Find Flag
   /varset v1 0  

   | Start Loop
   :TryTarget

      | Order these from least to most wanted
      /target "a fire beetle"
      /target "a decaying skeleton"

      | Make sure we found one of 
      | what we were looking for - MQ
      | often will target anything if it can't
      | find what we wanted
      /if $target(name)=="a fire beetle" /varset  v1 1
      /if $target(name)=="a decaying skeleton" /varset v1 1

      | Make sure it's less of a level then me
      /if n $target(level)>=$char(level) /varset v1 0

   /if n $v1!=1 /goto :TryTarget
/return

Again, that's written from memory with no testing so there's no garuntee that it'll work - but you get the idea. Actually I think that I set the MOBs that I want to hunt in an array, but I'll let you do that on your own.

This way we get beasties that are named exactly what we want, and that are not as strong as we are. Only thing I'd add is anti KS code with the PC radius. Anyway, have fun.



This will hang in Sub FindTarget untill it finds a mob that is less than your level.

Per the quoted example, if you were level 1, this Sub would hang indefinatly.

Also, it will only target the skeleton at the bottom of the list as long as its still in zone. Wont ever advance up the list of mobs and may never kill that skeleton if hes not 1 level lower than you which is the Level 1 problem all over again.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Only keeps first item type listed in Loot array.

Post by Mckorr » Sat Dec 14, 2002 10:11 am

Modified to work in Shadeweaver (better farming for leather padding). For some reason it only keeps whatever is listed at the top of the loot list. If I list silk first, it only keeps silks. List "quality" first, only keeps hides. Here's the modified zone macro:

[-- Code Brackets by L124RD --]

Code: Select all

| shadeweaver.mac 
| 
| Zone specific Info for Hunter Script 
#define HomeY v58 
#define HomeX v59 

| This Sub sets up the alert lists for the mobs we want to hunt 
| 
sub SetAlerts 
| Setup Alerts for the most important mobs here (rare) 
| 
   /alert clear 1 
   /alert add 1 npc radius 500 worm 
   /alert add 1 npc radius 500 saurek 
   /alert add 1 npc radius 500 lesser
   /alert add 1 npc radius 500 dratha
   /alert add 1 npc radius 500 loda

| Setup Alerts for the next most important mobs here (uncommon) 
| 

   /alert clear 2 
   /alert add 2 npc radius 1000 worm
   /alert add 2 npc radius 1000 saurek
   /alert add 2 npc radius 1000 lesser
   /alert add 2 npc radius 1000 dratha
   /alert add 2 npc radius 1000 loda
    
| Setup Alerts for the next most important mobs here (common) 
| 
   /alert clear 3 
   /alert add 3 npc worm
   /alert add 3 npc saurek
   /alert add 3 npc lesser
   /alert add 3 npc dratha
   /alert add 3 npc loda    

| Setup Alerts for Scary mobs here 
| 
   /alert clear 4 
   /alert add 4 npc radius 500 griffin 

/return 


| This sub sets up the list loot we wish to keep. 
| 
sub SetLootList 

   /varset a(1,0) "quality"
   /varset a(1,1) "silk"
   /varset a(1,2) "swirling"
  
   | Put number of items in list here. 
   /varset LootTotal 3

/return 



| This sub sets our home point we return to if low on health 
| 
sub SetHomePoint    

   | Set home to be entrance of tunnel 
   /varset HomeX -2301.93, 
   /varset HomeY -2000.38 
   /mqlog Home Point is $HomeX, $HomeY 

/return 


| This sub does the checks to make sure we avoid certain specified areas 
sub CheckObstacles 

| this sub just calls avoidloc for each area i want to avoid in EC 
      
   | Single Hut Near WF Zone 
   /call avoidloc -2033.43 -2932.90 30 
    
/return
I made as few changes as possible to avoid hosing it up too badly (my first attempt created a long list of parse errors.) No changes to hunter.mac intself, other than changing the include to shadeweaver.mac.

Any ideas why it will only farm the first item in the loot array?

User avatar
SingleServing
a hill giant
a hill giant
Posts: 195
Joined: Tue Dec 17, 2002 11:00 pm

Question About Loot Function

Post by SingleServing » Tue Dec 17, 2002 11:11 pm

Sorry if this is a dumb question but can someone explain to me how the loot function works? (here's the part thats confusing me)

$a(#,#)
Returns an array variable

Code: Select all

      | Scan list of loot to keep and auto drop it if we are keeping it. 
      /varset CheckLoot 0 
      :GetLoot 
         /if "$cursor(name)"~~"$a(1,$CheckLoot)" { 
            /mqlog  Looted $cursor(name) 
            /click left auto 
            /goto :Looted 
         } 
          
         /varadd CheckLoot 1 
         /delay 0 
         /if n $CheckLoot<$LootTotal /goto :GetLoot 
I am unsure how the $a(xx,xx) works and what type of values it returns returns. :)

Heres the code for $a(x,x) in the eqlib.cpp file

Code: Select all

// $a(#,#)
					} else if (!strncmp("a(",szVar,2)) {
						if ((!strstr(szVar,",")) || (!strstr(szVar,")"))) {
							DebugSpew("PMP - Bad $a() '%s'",szVar);
							i--;
							szOutput[j] = '@';
							j++;
						} else {
							DWORD Index1, Index2;
							Index1=atoi(szVar+2);
							Index2=atoi(strstr(szVar,",")+1);
							if ((Index1 < MAX_MACROARRAYS) || (Index2 < MAX_MACROVARS)) {
								while (szOriginal[i]!=')') i++;
								strcat(szOutput,gMacroArray[Index1][Index2]);
								j+=strlen(gMacroArray[Index1][Index2]);
							} else {
								DebugSpew("PMP - Bad $a() '%s'",szVar);
								i--;
								szOutput[j] = '@';
								j++;
							}						
						}

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Wed Dec 18, 2002 5:12 am

Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

User avatar
SingleServing
a hill giant
a hill giant
Posts: 195
Joined: Tue Dec 17, 2002 11:00 pm

Note

Post by SingleServing » Wed Dec 18, 2002 8:17 pm

Thanks for the link Flippy a :idea: came on =)

One note about that section of the code. I have reverted back to the old UI so I can use the /click command. In the old UI /mouseto auto places the mouse in the middle of the screen and not in the autoequip area. For those using the old UI i suggest something like

Code: Select all

/mouseto 600 100
Now I would be interested in stealing err utilizing a hunting macro like this for my Shaman, has anyone done something similar to this for a caster (with a pet) by chance?

I am thinking that I will need to change the engage distance so that I can get a root off, send in pet, debuff, dot and go in and meelee with my pet, re-root, heal, and dot as needed. I have started a working script to logon summon food/drink, summon pet, buff up me, med/canni dance full, buff pet / me (short term buffs haste, cloro etc). Now I need to place in a nice hunt script and a function to test buff duration, then rebuff as needed. If anyone is intersted in assisting me or would just like to steal er borrow the code let me know I can put it here or start a new thread.

Thanks =)

Fyrestorm
decaying skeleton
decaying skeleton
Posts: 5
Joined: Fri Nov 01, 2002 7:31 pm

Post by Fyrestorm » Fri Dec 20, 2002 3:03 pm

I added a check for the level in the GetTarget code, made a huge difference when acquiring targets. I made a list of all mobs in the zone I want to fight, then when it acquires a target, it checks it's level first before attacking. The list in the zone file can be single word descriptions like:

bat
skeleton
drakeling
orc

You get the idea...

Here's the changed code, added a line near the end...

Code: Select all

| Acquire Target subroutine
sub GetTarget
   :Acquire
      /if AttackedMe==1 { 
         /mqlog Targeted "$v13" who jumped me 
         /target "$v13" 
         /varset AttackedMe 0
      } else /if "$alert(1)"=="TRUE" { 
         /target npc alert 1 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 1 
      } else /if "$alert(2)"=="TRUE" { 
         /target npc alert 2 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 2 
      } else { 
         /target npc alert 3 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 3
      }

      /varset MyTarget $target(id)
      /varset TargetDead 0
      /doevents
      /delay 0
      | Check the level of the mob first!
      /if n $target(level)>$char(level) /goto :Acquire
   /if n $target(id)==0 /goto :Acquire 
/return

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Fri Dec 20, 2002 3:29 pm

You can also specify the level of the mob in the /alerts

/alert add 1 npc radius 500 range $calc($char(level)-4) $calc($char(level)+1) lion
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]