• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

AFK Melee Macro v3.1 (02/15/2011)

Joined
Feb 8, 2005
RedCents
8,901¢
AFK Melee Macro 4.0 Updated 5-24-11

VERSION 4.0 (UPDATED 5/24/11)
Description:
This runs out to the Y, X location that is saved in SpawnXLOC[1]/SpawnYLOC[1]. Upon reaching said location it targets nearest NPC and if it is within 160 units it will use Monk Ability Vigorous Shurikun. There is a PLAYERCHECK in this macro. Declare any bots in the ini. If any player is within 300 units of your camp you will just sit there and do nothing, but as soon as they get further away it will continue.

4.0 brings .INI file support (Thanks Maskoi)

This Macro requires the following pre-requisites
-MQ2Melee and all dependents loaded
-Get LOC of pull location by typing /loc and filling in SpawnXLoc SpawnYLoc
loc.jpg


Rich (BB code):
|----------------
|- AFKMELEE v4.0 -
|----------------
|Required Plugins: MQ2Melee Loaded (Dependant plugins MQ2Moveutils, MQ2Cast, MQ2Exchange, MQ2Bagwindow)
|Setup:
|-Set SpawnXLoc/YLoc for to pull spots
|-Set # of pull spots into locstospot
|-Set HealerName to any friend that wants to attend
|-Set Loot Array information on what you want
|---------------------------------------------------------------
|-Notes: MQ2Melee setup to do all combat and heals, and Feign Death on low health. 
|
|-Version 4.0
|------------
|-INI Support Added (Thanks Maskoi for Code)
|-Removed all Monk Stuff (Please use MQ2Melee holyshits for special abilities)

#event Stunned "You are too distracted to use a skill.#*#" 
#event Stunned "You are stunned#*#" 
#event Stunned "You can't cast spells while stunned!#*#" 
#event Stunned "You can't attack while stunned!#*#" 
#event Stunned "You cannot use a skill while stunned!#*#" 
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#" 
#event TargetSight "You cannot see your target.#*#" 

Sub Main 
   /declare MacroName       string outer afkmelee
   /declare IniFileName     string outer ${MacroName}_${Me.CleanName}.ini
   /declare myzone             int outer ${Zone.ID}
   /call LoadIni General HealerName    string outer NULL
   /call LoadIni General locstospot    int outer 6
   /call LoadIni General dolootz       int outer 0
   /declare RV_LootArray[10] string outer
   /call LoadIni Lootz RV_LootArray string NULL RV_LootArray
   /declare SpawnXloc[10] int outer
   /call LoadIni XLocs SpawnXloc int 0 SpawnXloc
   /declare SpawnYloc[10] int outer
   /call LoadIni YLocs SpawnYloc int 0 SpawnYloc

   /declare targetspotted       int outer 1
   /declare targetwait        timer outer 0
   /declare lootwait	      timer outer 0

   |------------------------------------------------------------
   |Declare Safe Players.
   |------------------------------------------------------------
   /alert add 2 pc ${HealerName}
   /alert add 2 pc ${Me}

/if (${Me.Pet}) /echo WARNING! Player Pet Detected...

:mainwatch
/if (${Me.Casting}) /delay 2s
/if (${myzone}!=${Zone.ID}) {
	/doability "Feign Death"
	/end
	}
/call AquireTarget
/if (${Me.CombatState.Equal[COMBAT]}) /call Combatmelee
/call playercheck

/goto :mainwatch

/return

|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub AquireTarget

/if (${targetspotted}>${locstospot}) /varset targetspotted 1
/call MoveToLoc ${SpawnYloc[${targetspotted}]} ${SpawnXloc[${targetspotted}]}
/if ((${Me.State.Equal[STAND]}) && (!${Spawn[NPC los targetable].ID}) && (${targetspotted}==1)) /sit
:Waitforspawn
/delay 1s
/if ((!${Spawn[NPC los targetable].ID}) && (${targetspotted}==1)) /goto :Waitforspawn
/if (${NearestSpawn[NPC los targetable].Distance}<160) /target ${NearestSpawn[NPC los targetable]}


/if (${Target.ID}) {	
/face
/doability "Vigorous Shuriken Rk. III"
/varset targetwait 30s
:waitfortarget
/doevents
/delay 1s
	/if ((${Target.Distance}<30) || (${targetwait}==0)) {
	  /attack on
	  /return
	  }
/goto :waitfortarget
} else {
/varset targetspotted ${Math.Calc[${targetspotted}+1]}
}
/return

|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub Combatmelee
:combatstart
/doevents
/call playercheck
/if (${Me.CombatState.Equal[COMBAT]} && !${Me.Combat}) {
	/keypress esc
	/delay 1s
	/attack on
	}
/if (${Target.Type.Equal[Corpse]}) /keypress esc
/if (${Target.Distance}>70) /keypress esc
/if ((${Me.CombatAbilityReady["Fifth Wind Rk. II"]}) && (${Me.Endurance}<30000)) /doability "Fifth Wind Rk. II"
   /if (!${Target.ID}) { 
	/keypress esc 
	/if (${Spawn[NPC los targetable radius 50].ID}) {
	  /target ${NearestSpawn[NPC los targetable]}
	  /attack on
	  /goto :combatstart
	  }
	/attack off 
        /if (${Me.AbilityReady["Mend"]}) /doability "Mend" |----DOES MEND IF UP AT END OF FIGHTS
	/if (${dolootz}==1) /call Loot
	/return
	}
   } 

/goto :combatstart
/return

Sub Event_Stunned 
   /delay 1s
/return 

Sub Event_TargetSight
/if (${Me.CombatState.NotEqual[COMBAT]}) {
   /varset targetspotted ${Math.Calc[${targetspotted}+1]}
   /call AquireTarget
}
/return 

|--------------------------------------------------------------------------------
|SUB: Playercheck
|--------------------------------------------------------------------------------
Sub playercheck
   /if (${Spawn[pc noalert 2 radius 300].ID}) { 
	:playerhold
	/if (${Me.State.NotEqual[FEIGN]}) /doability "Feign Death"
	/if (!${Spawn[pc noalert 2 radius 350].ID}) {
		/stand
		/return
	}
	/goto :playerhold
	}
   /return

Sub MoveToLoc(MoveToY, MoveToX) 
    /moveto loc ${MoveToY} ${MoveToX}|on 
  :moveToLocation 
    /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} > 20) { 
        /delay 5 
        /goto :moveToLocation 
    } 

/return

|--------------------------------------------------------------------------------
|SUB: Loot w/ Array
|--------------------------------------------------------------------------------
Sub Loot 
   /declare LootSlot    int inner  0
   /declare LootCheck   int inner  0
   /declare LootTotal   int inner  0
   /lootnodrop never
   /target corpse los radius 100 
   /stick 5 hold 
   /varset lootwait 1m

  :Moveto 
    /if (${Target.Distance} > 15) { 
        /delay 1s 
        /goto :Moveto 
    } 

    /stick off 
    /loot 
    /delay 1s 
 
    /if (!${Corpse.Items}) {
      /goto :endofloot
    }

    /varset LootTotal ${Corpse.Items}
    /for LootSlot 1 to ${LootTotal}
      /nomodkey /shift /itemnotify ${Corpse.Item[${LootSlot}].InvSlot} leftmouseup
      /delay 1s

|---------Keep Good Stuff---------------------
         /for LootCheck 1 to ${RV_LootArray.Size}
            /if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
		/timed 5 /autoinventory
		/delay 2s !${Cursor.ID}
            }
         /next LootCheck    

|---------Destroy Bad Stuff-------------------
      /if (${Cursor.ID}) {
         /echo Destroying a ${Cursor.Name}...
         /destroy
         /delay 1s
      } 	
   /next LootSlot

:endofloot
   /nomodkey /notify LootWnd LW_DoneButton leftmouseup
   /delay 1s
	/if (${Spawn[corpse los targetable radius 100].ID}) /target corpse los radius 100 
	/if  (${lootwait}==0) /return
	/if (${Target.ID}) {
	/stick 5 hold 
	/goto :Moveto
	}	

/return

|----------------------------------------------------------------------------
| SUB: Load Ini
|----------------------------------------------------------------------------
    Sub LoadIni(string sectionName, string varName, string varType, string varValue, string varArray)
        /if (${${varArray}.Size}>0) {
            /declare i int local
                /for i 1 to ${${varArray}.Size}
                    /if (!${Ini[${IniFileName},${sectionName},${varArray}${i}].Length}) /ini "${IniFileName}" "${sectionName}" "${varArray}${i}" "${varValue}"
                    /if (${Ini[${IniFileName},${sectionName},${varArray}${i}].Length}) /varset ${varArray}[${i}]  ${Ini[${IniFileName},${sectionName},${varArray}${i}]}
                /next i
            /return
        } else {
            /if (!${Defined[${varName}]} && ${Defined[varType]}) /declare ${varName} ${varType} outer
            /if (!${Ini[${IniFileName},${sectionName},${varName}].Length}) {
                /if (${varValue.Length}) {
                    /ini "${IniFileName}" "${sectionName}" "${varName}" "${varValue}"
                    /varset ${varName} ${varValue}
                    DEBUG Sub Loadini /varset ${varName} ${varValue}
                }
            } else {
                /varset ${varName} ${Ini[${IniFileName},${sectionName},${varName}]} 
            }
        }
    /return

afkmelee_charactername.ini
Rich (BB code):
[General]
dolootz=1
locstospot=9
HealerName=NameofSecondPlayer

[Lootz]
RV_LootArray1=Diamond
RV_LootArray2=Spell
RV_LootArray3=Geode
RV_LootArray4=Powder
RV_LootArray5=Ore
RV_LootArray6=Paper
RV_LootArray7=Vellum
RV_LootArray8=Parchment
RV_LootArray9=Arcanum
RV_LootArray10=Taaffeite

[XLocs]
SpawnXloc1=-443
SpawnXloc2=-443
SpawnXloc3=-443
SpawnXloc4=-251
SpawnXloc5=-251
SpawnXloc6=-251
SpawnXloc7=-347
SpawnXloc8=-347
SpawnXloc9=-347
SpawnXloc10=0

[YLocs]
SpawnYloc1=1391
SpawnYloc2=1515
SpawnYloc3=1714
SpawnYloc4=1714
SpawnYloc5=1515
SpawnYloc6=1391
SpawnYloc7=1280
SpawnYloc8=1122
SpawnYloc9=1280
SpawnYloc10=0
Hook me up with a red cent if you enjoy the macro ;)
 
Last edited:
Re: AFK Melee Macro

In Devolpment:
-Multiple Target Aggro Control.
-Possible Spawn ID targeting. Playing with this idea. I would estabilish Target nearest npc logic and compare with list of IDs. This would make for more precise pulling.
 
Last edited:
Re: AFK Melee Macro

Release History:
v2.0
-First release of AFK style melee macroing. Beta at this point and only has had a couple hours of testing.
v2.1 (Big compatibility release)
-Added mq2melee toggle. (Any melee class can use this)
-code consolidation. (mq2moveutils now handles movement)
-Added loot capability (loots all items on corpse)
v2.2
-Added multiple pull spot loc capability
v2.3
-Added Array Selective Looting
v3.0
-Added NPC Pet Logic
-Added Multi-Corpse Loot
-Revamped Corpse Loot and added ON/OFF Functionality
-Code Optimization (More ${Spawn}, less targets)
-New Acquire Target Sub-Routine (Scrapped old one)
-Removed Fight Timer
-Added logic to sit after entire camp is cleared
-Added Line of Sight Logic (Can be used in Dungeons now, not limited to open spaces)
v3.1
-Added Mend after Fights
-Defer Death at 40 percent
-Epic 2.0 at 30 Percent
-Line of Sight event logic addition
v3.2
-Added Playerchecks while fighting
-Added Target Pull Timer (Prevents a pull going wrong and macro goes into endless loop)
-Added Loot Timer (Prevents a second no drop item endless loop. Note: It will still attempt to loot it, but after 1 min it will stop and return to finding mobs.)
-Added Line of Sight Checks on Corpse (Prevents you from going after a corpse on the otherside of a wall)
v3.3
-Cleaned up code and did some optimization (No longer sits after reaching each waypoint, and doesn't do /target command unless target present)
v4.0
-Removed all Monk Specials from code (use holyshits from mq2melee plugin instead)
-added INI support
-retooled a couple calls to be more effeciant
-Only sits and meds at first loc now
-fixed sit logic
 
Last edited:
Re: AFK Melee Macro

Looks great gonna try this when servers come up woot :) Will red cent you of course.
 
Re: AFK Melee Macro

I'm very proud of the 2.1 modifications and think you all will enjoy them. Please report any bugs to me, because I have only done limited testing.
 
Re: AFK Melee Macro

It will be intresting to see where this is used, because i've used it successfully in 3 zones without a hitch now. It is probably the most versitale afk macro out there right now, so if you find a good spot to use it and want to share post it!

Thanks,
Noobhaxor
 
Re: AFK Melee Macro

Just a couple probs.. I edited out the line for looting on the char I'm using to run this mac. So he's not looting, like I want. I'm thinking he might be hung up there, but I can't be sure. Also, I've added a 3rd character to be in the area. But not sure if I've done it right. Mind just throwing in a snippet of code in a reply, to see if I've done .. at least the 3rd character part right.
 
Last edited:
Re: AFK Melee Macro

To add a 3rd player add this line
/alert add 2 pc Iamthirdname

To remove looting in the Combat SUB remove this line
/call Loot
 
Re: AFK Melee Macro

k, that got it fixed. Now I just need to get the other char's assist mac fixed. Thanks
 
Re: AFK Melee Macro

any suggestions on where a 72 monk could use this with a heal merc?
 
Re: AFK Melee Macro

Cleaned out the "off-topic" posts.

Great macro noob!
 
Re: AFK Melee Macro

This one is setup for Vlad atm. Smith camp... about once every 30 minutes there is a roamer and if you are unlucky with the spawn timing you could get 2 mobs that would probably kill you. However, other than that it runs pretty much unassisted. I haven't put it to work in any other zones atm. I am working on Caster macros next. (Still tring to grasp a good idea to make it work.)
 
Re: AFK Melee Macro

Oh, I've also used this in Plane of Fire.... Works pretty good too. for those late 60s to early 70s. You could probably do PoFire with good afk exp til around lvl 79.
 
Re: AFK Melee Macro

if u get adds does it deal with them? i have a 85 monk 85 war 81 shaman and can prob take adds easy in pof i was thinking it would be good to pl my alt wiz and bard
 
Re: AFK Melee Macro

yes it deals with adds before going back out. Does a check to make sure no NPC is with 50 units of you before exiting combat. Otherwise, it will retarget new mob and reengage.
 
Re: AFK Melee Macro

how would you add this to your current compilation (sorry guys i dont really know much about putting this stuff together)
 
Re: AFK Melee Macro

Copy and paste the code into notepad (wordwrap off) save as Macronamehere.mac in your "Macros" Directory and follow the instructions for setting it up.
 
Re: AFK Melee Macro

how come its not attacking the adds for me ? it will target them but wont attack. and how do i get to to not use monk epic 1.0
 
Re: AFK Melee Macro

i dont know why i have so much trouble its not attacking from the start now it has the mob targeted but he just stands there
 
Re: AFK Melee Macro

Change this line to 1... this will skip all the monk checks and use MQ2melee for all Special attacks.

Rich (BB code):
   |------------------------------------------------------------
   |Change usemq2mel to 1 for use with MQ2melee 
   |------------------------------------------------------------
   /declare usemq2mel      int outer 0

This will clear up your add problem as well... It is getting stuck trying to put epic effect on.
 
Re: AFK Melee Macro

aight, I seem to have run in to the same problem, as you Noob.. I'm using a warrior, so I'd like to have him switch between both mobs within the 50 radius and taunt / jeer / bellow each one, so the mercs don't get eaten. If there is anything that you can do to help out.. I'd appreciate it
 
Re: AFK Melee Macro

first of all i absolutely love this macro just a couple of small issues ive noticed with looting. Is there any way to make it skip over lore items? anytime it tries to loot a lore item you already have it hangs. And when adds come after you kill all mobs it only seems to loot one of the corpses. Appreciate any help :)
 
Re: AFK Melee Macro

Tribal: that is going to be difficult to code a merc. If you were boxing i could write another macro to notify the tank what mob is attacking him and then the tank could take him. However, If you must use a merc, I will look into writing a alternating target add-on. (Couple obsticles I foresee. 1. Range of merc to you 2. Accedentially pulling more mobs)

Slandara: This should be an easy fix. I will work on writing a loot table portion of the program. This will only loot items you want. (Solving LORE problem) Also the multiple corpses add-on i will look into as well.
 
Re: AFK Melee Macro

Just had a second thought on the merc Tribal... Set extra health watch on merc's health and when it decreases shift macro to a diffrent sub routine that would move to the merc then target nearest npc. (Got a rough idea in my head, but will see if I can make this happen.)
 
Re: AFK Melee Macro

Ok added the loot tables in. Try that out. Adding multiple corpse checking should be easy, and will probably look like this on the end of the Loot Subroutine. I will test this out late tonight.
Rich (BB code):
/delay 1s
/target corpse radius 200
/if {Target.ID} /goto :lootstart
/return
 
Re: AFK Melee Macro

Tribal: that is going to be difficult to code a merc. If you were boxing i could write another macro to notify the tank what mob is attacking him and then the tank could take him. However, If you must use a merc, I will look into writing a alternating target add-on. (Couple obsticles I foresee. 1. Range of merc to you 2. Accedentially pulling more mobs)

Slandara: This should be an easy fix. I will work on writing a loot table portion of the program. This will only loot items you want. (Solving LORE problem) Also the multiple corpses add-on i will look into as well.


I'm using a boxed warrior... not merc'd.. if 2 mobs are in camp, the warrior doesn't auto switch back and forth, so the healer mercs are getting eaten.

Also, I'm looking through the loot subroutine, in your array.. when you define the below code.. do you input what you want to keep, or things things you want to destroy.. i.e. you have diamonds/legends in the first part, and junk in the 3 other spots.

Rich (BB code):
/declare RV_LootArray[5] string outer
   /varset RV_LootArray[1] "Diamond"
   /varset RV_LootArray[2] "Legends"
   /varset RV_LootArray[3] "Junkx"
   /varset RV_LootArray[4] "Junky"
   /varset RV_LootArray[5] "Junkz"
 
Re: AFK Melee Macro

I can get the macro to run through a few spawn cycles and then it just stops. If I come back and just hit the esc key it'll start up again. Nothing is targeted when I come back to check in. Any thoughts?


Glory
 
Re: AFK Melee Macro

so having a merc there will fuck with this macro? might explain glory and my problem
 
Re: AFK Melee Macro

Ok added the loot tables in. Try that out. Adding multiple corpse checking should be easy, and will probably look like this on the end of the Loot Subroutine. I will test this out late tonight.
Rich (BB code):
/delay 1s
/target corpse radius 200
/if {Target.ID} /goto :lootstart
/return

so where do i put this code at exactly?
 
Re: AFK Melee Macro

Hi i needed it to loot the multiple corpses so i went off what you said to do and fucked with it a little this is prob not the best way to make it work but it does if anyone wants to use it for now. I know nothing about writing code for mq2 so sorry for chopping your stuff up. I did not really change anything lol just put in what you said took some messing around to get it right. not sure how to make the code show up like you guys do never posted any before
Rich (BB code):
|--------------------------------------------------------------------------------
|SUB: Loot w/ Array
|--------------------------------------------------------------------------------
Sub Loot 

   /declare LootSlot    int inner  0
   /declare LootCheck   int inner  0
   /declare LootTotal   int inner  0

  :lootstart
    /target corpse radius 50 
    /stick 5 hold 
  :Moveto 
    /if (${Target.Distance} > 5) { 
        /delay 1s 
        /goto :Moveto 
    } 

    /stick off 
    /loot 
    /delay 1s 
   
    /face fast
   
    /keypress forward
    /keypress back
   
    /fastdrop on
    /lootn never
    /delay 1s
    /loot
    /delay 1s
    /if (!${Corpse.Items}) {
      /echo NO LOOT! Cheap Bastard!
      /goto :endofloot
    }

    /varset LootTotal ${Corpse.Items}
    /for LootSlot 1 to ${LootTotal}
     /nomodkey /shiftkey /itemnotify loot${LootSlot} leftmouseup 
      /delay 1s
|---------Keep Good Stuff---------------------
         /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    
|---------Destroy Bad Stuff-------------------
      /if (${Cursor.ID}) {
         /echo Destroying a ${Cursor.Name}...
         /destroy
         /delay 1s
      } 	
   /next LootSlot



:endofloot
   /notify LootWnd DoneButton leftmouseup
   /delay 1s
   
   /delay 1s
   /target corpse radius 200
     /if (${Target.Type.Equal[Corpse]}) /goto :lootstart

   /call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC} 
   /return

Sub MoveToLoc(MoveToY, MoveToX) 
    /moveto loc ${MoveToY} ${MoveToX}|on 
  :moveToLocation 
    /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} > 10) { 
        /delay 5 
        /goto :moveToLocation 
    } 

/return
 
Last edited:
Re: AFK Melee Macro

Same as [ QUOTE] [ /QUOTE] just use [ CODE] [ /CODE] tags instead minus the spaces of course :)
 
Re: AFK Melee Macro

As for the merc compatibility that is definitally what is causing the hang in the macro. I just got back, and will work on adding this capability.
 
Re: AFK Melee Macro

Not working for me. I will go to the loc one time, then he doesn't do anything after the one mob. I even took the playercheck out.

I figured out why it won't run. I have something on my target, and the macro doesn't seem to recognize that target is too far away to attack. Any advice?
 
Re: AFK Melee Macro

I'd recommend a better loc path... I.E. He isn't runing to a spot that is populated with mobs to pull. Also Remember he pulls mobs using your Ranged Attack...

So here is what you need to do before running macro:
1. Make sure you have a full stock of items in your ranged slot
2. Run to your "pull spots" and /loc and right it down... You need to record this in the mac
3. Remember the mobs HAVE to be within 160 units from your pull spot.

Last... never ever take out the playercheck... you will get banned if the zone is populated. It is painfully obvious when someone is using this macro for movement and other players will be upset that you have more AA than them with a fraction of the time invested.

Hope this helps,
Noobhaxxor
 
Re: AFK Melee Macro

Been trying to use this in MG- but havin an issue, when it moves to pull it agros mobs through the floor which is bad hehe- any way to avoid that?
 
Re: AFK Melee Macro

How can I make the macro only wait 5 seconds before pulling the next mob? Or 30 seconds. Where I fight 1 minute is a long wait.

Hoecus
 
Re: AFK Melee Macro

How can I make the macro only wait 5 seconds before pulling the next mob? Or 30 seconds. Where I fight 1 minute is a long wait.

Hoecus

Not sure but!
Rich (BB code):
|---------Run at end of fight---------------|
   /if (!${Target.ID}) { 
	/keypress back 
	/varset StickFighting 0
	/delay 3s
	/if (${NearestSpawn[NPC].Distance}<40) {
	  /target ${NearestSpawn[NPC]}
	  /attack on
	  /goto :combatstart
	  }
	/varset FightTimer 1m
	/varset targetspotted 1
	/attack off 
	/call Loot
	/return
I would alter the part in bold/Itallic - maybe 30s!!
 
Re: AFK Melee Macro

Thanks,

I will try that . I was thinking a variable called FightTimer may be the time it waits during a fight to call the next routine. (IE .. giving you 1 minute to kill that mob)

Hoecus
 
AFK Melee Macro v3.1 (02/15/2011)

Users who are viewing this thread

Back
Top
Cart