• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Help on Named Spawn Macro (1 Viewer)

Mithaniel

New member
Joined
Oct 21, 2005
RedCents
Fisrt off forgive the sloppyness. I am POSITIVE I have a bunch of unnessecery code in here. This is one of my first macros so I'm still trying to learn code, etc.

I built this to help my brother finish his mage epic. It is designed to act as a hunter.mac for a spawn cycle based on the hunter.ini and override the hunter if Quillmane pops.

I have it calling custom subs on Quill pop, which I thin would be the correct way to do it.

If any veteran coders could look through my code and see if (where) I fubared it, It would be much appreciated.

For looting I should probably use a varset and next comment, but it was just as easy to copy and paste the loot code to run twice incase Quill drops 2 items.

Thanks,

Rich (BB code):
| Hunter Macro 
| Hunter.mac 
| Author      : robdawg 
| Edit        : Mithaniel 
| Version     : v1.0 12/20/2005 
| Useage      : /macro Hunter 
| Description : This macro will run your character around killing any mobs in your 
|      RV_MobArray.  It calls a special action when a named spawn pops.  Thanks to |original writer for source
| 
|------------------------------------------------------------------------------------ 

#turbo 10
#include HunterMob.ini 

Sub Main 

 
   |------------------------------------------------------------ 
   |How many times should aquire target fail before delaying? 
   |------------------------------------------------------------ 
   /declare RV_FailMax          int outer  3 
   |------------------------------------------------------------ 
   |How far would you like to target a mob? 
   |------------------------------------------------------------ 
   /declare RV_MaxRadius        int outer  50000 
   |------------------------------------------------------------ 
   |How far is the combat range? 
   |------------------------------------------------------------ 
   /declare RV_Range            int outer 10 
   |------------------------------------------------------------ 
   |What is the minimum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MinZRange        int outer  -1000 
   |------------------------------------------------------------ 
   |What is the maximum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MaxZRange        int outer  1000 
   |------------------------------------------------------------ 
      |Generic Counter Variable 
   |------------------------------------------------------------ 
   /declare c int outer 0 

   |------------------------------------------------------------ 
   |MOB Array Information. 
   |------------------------------------------------------------ 
   /call ReadINI HunterMob.ini "${Zone.Name}" Mob 
   /if (!${Defined[RV_MobArray]}) { 
      /echo Mob Array Creation Error, ending macro... 
      /endmacro 
   } 

   |------------------------------------------------------------ 
   |Variables that you don't need to worry about. 
   |------------------------------------------------------------ 
   /declare RV_FailCounter      int outer  0 
   /declare RV_MyTargetID       int outer  0 
   /declare RV_MyTargetName     string outer 
   /declare RV_MyTargetDead     int outer  0 
   /declare RV_InvalidTargetID  int outer  0 
   /declare RV_HasTarget        int outer  0 
   /declare RV_RandomWait       int outer  0 
   /declare RV_LootSlot         int outer  0 
   /declare RV_CheckLook        int outer  0 
   /declare RV_Fighting         int outer  0 
   /declare RV_TargetDead       int outer  0 
   /declare RV_MyXLOC           int outer  0 
   /declare RV_MyYLOC           int outer  0 
      /declare RV_FastRange        int outer 
   /declare RV_RangeMax         int outer 
   /declare RV_RangeMin         int outer 
   /varcalc RV_FastRange ${RV_Range}+3 
   /varcalc RV_RangeMax ${RV_Range}+1 
   /varcalc RV_RangeMin ${RV_Range}-1 

   	/fastdrop on 
   	/lootnodrop never 

   :Start 
   	/call GMCheck 
  	/call GetTarget 

   :KillAdds 
   /if (${RV_HasTarget}) /call MoveToMob 
   /if (${RV_HasTarget}) /call CombatSub 
   /if (${RV_HasTarget}) /call MoveToMob 
   /call ResetSub 

   /varset RV_RandomWait ${Math.Rand[5]} 
   /varcalc RV_RandomWait ${RV_RandomWait}+1 
   /echo Paranoia - Waiting ${RV_RandomWait} seconds before resuming 
   /delay ${RV_RandomWait}s 
    
   /if (${Target.ID}) { 
      /echo Looks like something is attacking us, killing it... 
      /delay 1s 
      /varset RV_HasTarget 1 
      /varset RV_Fighting 1 
      /goto :KillAdds 
   } 
    
   /goto :Start 
    
/return 

 
Sub GetTarget 

   /if (${SpawnCount[Quillmane NPC]}==1) /call Quillmane     
   /declare RV_CurrentRadius   int local 
   /declare RV_TargetSub   int local 
   :Acquire 
   /for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100 
      /for RV_TargetSub 1 to ${RV_MobArray.Size} 
         /squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}" 
         /varset RV_MyTargetID ${Target.ID} 
         /varset RV_MyTargetDead 0 
         /if (${Target.ID}) { 
            /if (${Int[${Target.PctHPs}]}<100) { 
               /echo Mob NOT a Full Health, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
               /echo Mob is BELOW Min Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
               /echo Mob is ABOVE Max Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /varset RV_HasTarget 1 
            /varset RV_MyTargetName ${Target.CleanName} 
            /echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]} 
            /return 
         } 
      /next RV_TargetSub 
      /delay 2 
   /next RV_CurrentRadius 

   /if (!${Target.ID}) { 
      /delay 2s 
      /varcalc RV_FailCounter ${RV_FailCounter}+1 
      /echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s) 
      /if (${RV_FailCounter}>=${RV_FailMax}) { 
         /echo Waiting for Respawns, Resetting Failure Counter... 
         /delay 60s 
         /varset RV_FailCounter 0 
      } 
      /goto :Acquire 
   } 
/return 

 
Sub MoveToMob 

   /varset RV_MyXLOC ${Int[${Me.X}]} 
   /varset RV_MyYLOC ${Int[${Me.Y}]} 
   /declare RV_DistanceTimer timer 15 
    
   /doevents 
    
   :MovementLoop 

   /if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<100)) { 
      /echo Mob not at full health, picking another... 
      /varset RV_InvalidTargetID ${Target.ID} 
      /varset RV_HasTarget 0 
      /call ResetSub 
      /return 
   } 

   /if (${Target.ID}) { 
      /face fast 
   } 

   /if (${Int[${Target.Distance}]}>${RV_FastRange}) { 
      /keypress forward hold 
   } 
   /if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) { 
      /keypress forward 
   } 
   /if (${Int[${Target.Distance}]}<${RV_RangeMin}) { 
      /keypress back 
   } 
   /if (!${RV_DistanceTimer}) { 
      /if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle 
      /varset RV_MyXLOC ${Int[${Me.X}]} 
      /varset RV_MyYLOC ${Int[${Me.Y}]} 
      /varset RV_DistanceTimer 15 
      /goto :Movementloop 
   } 
   /if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop 

/return 

 
Sub CombatSub 

   /echo Attacking Mob NOW! 
   /varset RV_Fighting 1 
   /varset RV_TargetDead 0 
  
   :CombatLoop 
   /attack on 
   /pet attack

   /call MoveToMob 
   /if (!${Target.ID}) { 
      /attack off 
      /keypress forward 
      /keypress back 
       /varset RV_TargetDead 1 
      /varset RV_Fighting 0 
      /delay 1s 
      /target radius 30 corpse 
      /delay 1s 
      /if (!${Target.ID}) { 
         /call ResetSub 
         /return 
      } 
      /face fast 
   } 
   /if (!${RV_TargetDead}) { 
      /goto :CombatLoop 
   } 
    
/return 


 
Sub Quillmane
/tar Quillmane   
/warp target
:loop
/attack on
/pet attack 
         		/face fast 
 		/if (${SpawnCount[Quillmane Corpse]}==0) /call Loot
/goto :loop 
/return



Sub Loot
:loot
/tar corpse Quill
/warp target
/lootnodrop never 
/autoinventory
/if (${Target.Type.Equal["Corpse"]}  /loot
/autoinventory
/delay 1s
    	/if (${Window[LootWnd].Open}) {
   	/itemnotify loot1 rightmouseup
	/notify LootWnd DoneButton leftmouseup
	  }
	/delay 5s
/tar corpse Quill
/warp target
/lootnodrop never 
/autoinventory
/if (${Target.Type.Equal["Corpse"]}  /loot
/autoinventory
/delay 1s
    		/if (${Window[LootWnd].Open}) {
   		 /itemnotify loot1 rightmouseup
	  	 /notify LootWnd DoneButton leftmouseup
	  }
	  
	/delay 5s

/keypress I
	/delay 1s
	/if (${InvSlot[22].Item.Container}) /itemnotify 22 rightmouseup
	/if (${InvSlot[23].Item.Container}) /itemnotify 23 rightmouseup
	/if (${InvSlot[24].Item.Container}) /itemnotify 24 rightmouseup
	/if (${InvSlot[25].Item.Container}) /itemnotify 25 rightmouseup
	/if (${InvSlot[26].Item.Container}) /itemnotify 26 rightmouseup
	/if (${InvSlot[27].Item.Container}) /itemnotify 27 rightmouseup
	/if (${InvSlot[28].Item.Container}) /itemnotify 28 rightmouseup
	/if (${InvSlot[29].Item.Container}) /itemnotify 29 rightmouseup
	/delay 1s
	/if (${FindItem[Pegasus Feather Cloak].InvSlot}) /call WOOT

/return


 
Sub ResetSub 

   /keypress esc 
   /keypress esc 
   /keypress esc 
   /keypress esc 
    
   /varset RV_HasTarget 0 
   /varset RV_TargetDead 0 
   /varset RV_Fighting 0 
    
/return 

 
Sub HitObstacle 

   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[100]}+1>50) { 
     /keypress strafe_right hold 
   } else { 
     /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
    
/return 


Sub GMCheck 

   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      
      /echo GM has entered the zone! 
      /echo ending the macro... 

      	/end
/unload 
      	/q 
    
/return 


Sub Woot
/echo FINALLY!!!
/endmac 
 	/unload 
	/camp desktop
/return

I would like to incorporate MQ2Tracker and use that to target the newest spawnss after Quill has been killed, but not sure how to incorporate it.

I'm thinking call a New Sub upon Quillmanes Death that overrides the hunter.ini but not sure how to get the tracking window to target the newest mob in the zone.
 
I'm thinking adding the event

#Event QuilDied "#*#You have slain Quillmane#*#"

and

Sub Event_Quildied

Which would include begin tracking the newest spawn in the zone. However, That's where I get stuck, not sure how to target the newest spawn.

Not sure if I can do it with a spawnid or if I can use a mouseup or something for the tracking window.

Any ideas?
 
Help on Named Spawn Macro

Users who are viewing this thread

Back
Top