• 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

Request - Fiind target, kill, repeat macro

Badbyte

Member
Joined
Jul 6, 2013
RedCents
20¢
How would I get something like this to loop back to the top when the mob i am currently killing is dead? Currently, I have to restart the macro every time something dies. All I need it to do is when my target dies, move back to the start of the macro and get a new target. I dont need it to navigate, loot, or anything else. All it has to do is clear everything that is attacking me.


Sub Main


/if (!${Me.CombatState.Equal[Combat]}) {
/target ${NearestSpawn[npc range 1 100]}
/delay 10
/stick 12
/attack on
 
You'd want a while loop. And a bunch of other stuff really.

Have you looked at some of the hunter styla macros like pocketfarm?
 
You'd want a while loop. And a bunch of other stuff really.

Have you looked at some of the hunter styla macros like pocketfarm?

Those do way more than I would like it to do. I want to keep it very simple. Pretty much jsut to reconize when the target I have dies, then loop back to the top of the macro.
 
I asked for such a simple request awhile back but using pet attack. I ended up receiving huge help which resulted in PetBot being born.

Your request is simple, but theres so many variables you'll end up with pocketfarm.

Pocketfarm allows you to have a pull list and ignore list. Super easy to use.
 
I asked for such a simple request awhile back but using pet attack. I ended up receiving huge help which resulted in PetBot being born.

Your request is simple, but theres so many variables you'll end up with pocketfarm.

Pocketfarm allows you to have a pull list and ignore list. Super easy to use.


All I am asking for is a line that says "if current target is dead, then loop to the top of the macro" It honestly can be that simple. I dont need anything but that. Only issue is that even being so simple for people who write these, I dont have the skills to figure it out.
 
Code:
Sub Main
    /while (1) {
        /do this

        /if (blah) {
            /do this
        }

        if (blah2) {
            /do that
        }
    }
/return

a while loop allows you to continually go top to bottom doing the things you want to do.

any time someone (including me) has said "just need a super simple thing" there are other things that end up being needed.
like /delay while moving to a mob, checking that your target is on, addressing that you're not trying to attack something that is invalid, maybe handle being stuck, stopping to med, etc.

and that's not to say that you dont, in fact, really want something that simple - it just "never is just i need a while loop" :)

it might be easier to strip off what you don't need/want rather than building from scratch

but you can slap your snippet inside a while loop, and when you are no longer in combat, grab a new mob and go fight it.

word of advice - it is a bad idea to target something you can't see - I would suggest using mq2nav to /nav spawn blah and then target and it and attack it when you get there

here's something i put together in like 2019 (i was super new and didn't know shit so it's probably trash, and i'm not going to clean it up because it is near useless, but it might give you something to work with). If i remember right they were using mq2melee, so once they turned on attack they were sticking automagically.

this obviously is because someone wanted to kill only rats - again it isn't specifically what you asked for but might give you something to work with.

rat.mac
Code:
| You can change "rat" to "whatevermob"

Sub Main
    /declare Mob string outer "rat"
    /while (1) {
        /if (${SpawnCount[npc ${Mob} radius 60]} >=1) /call NavToSpawnName ${Mob}
        /if (${Target.ID} && ${Target.Distance3D} < 5) /call BustEmUp
        /delay 1s
    }
/return

Sub NavToSpawnName(Mob)
    /|echo In NavToSpawn
    /nav spawn ${Mob}
    /delay 2s ${Navigation.Active}
    /while (${Navigation.Active}) {
        /if (${Spawn[npc ${Mob}].Distance3D} > 15) {
            /delay 1s
        } else {
            /break
        }
    }
    /if (${Spawn[npc ${Mob}].Distance3D} < 5) {
        /target npc ${Mob}
        /face fast
    }
/return

Sub BustEmUp
    |/echo Bust Em Up
    /if (!${Me.Combat}) {
        /attack on
        /while (${Target.PctHPs} > 1) {
            /delay 1s
            /if (${Target.Distance3D} > 30) {
                /break
            }
        }
    }
/return
 
Code:
Sub Main
    /while (1) {
        /do this

        /if (blah) {
            /do this
        }

        if (blah2) {
            /do that
        }
    }
/return

a while loop allows you to continually go top to bottom doing the things you want to do.

any time someone (including me) has said "just need a super simple thing" there are other things that end up being needed.
like /delay while moving to a mob, checking that your target is on, addressing that you're not trying to attack something that is invalid, maybe handle being stuck, stopping to med, etc.

and that's not to say that you dont, in fact, really want something that simple - it just "never is just i need a while loop" :)

it might be easier to strip off what you don't need/want rather than building from scratch

but you can slap your snippet inside a while loop, and when you are no longer in combat, grab a new mob and go fight it.

word of advice - it is a bad idea to target something you can't see - I would suggest using mq2nav to /nav spawn blah and then target and it and attack it when you get there

here's something i put together in like 2019 (i was super new and didn't know shit so it's probably trash, and i'm not going to clean it up because it is near useless, but it might give you something to work with)
rat.mac
Code:
| You can change "rat" to "whatevermob"

Sub Main
    /declare Mob string outer "rat"
    /while (1) {
        /if (${SpawnCount[npc ${Mob} radius 60]} >=1) /call NavToSpawnName ${Mob}
        /if (${Target.ID} && ${Target.Distance3D} < 5) /call BustEmUp
        /delay 1s
    }
/return

Sub NavToSpawnName(Mob)
    /|echo In NavToSpawn
    /nav spawn ${Mob}
    /delay 2s ${Navigation.Active}
    /while (${Navigation.Active}) {
        /if (${Spawn[npc ${Mob}].Distance3D} > 15) {
            /delay 1s
        } else {
            /break
        }
    }
    /if (${Spawn[npc ${Mob}].Distance3D} < 5) {
        /target npc ${Mob}
        /face fast
    }
/return

Sub BustEmUp
    |/echo Bust Em Up
    /if (!${Me.Combat}) {
        /attack on
        /while (${Target.PctHPs} > 1) {
            /delay 1s
            /if (${Target.Distance3D} > 30) {
                /break
            }
        }
    }
/return
 
That gives me a good base to work with. I will see if I can get that to work. I appreciate your help. I have tried taking away from other macros what I dont need, but I end up breaking it somehow becuase they are so long and I do not fully understand everything. I understand about the LOS, delay, non-targetable things, ect. I just wanted a good simple base to start with and I can always grow from there once I further understand how the code works and what implications removing a bracket, or line will do.
 
Request - Fiind target, kill, repeat macro

Users who are viewing this thread

Back
Top
Cart