Snippet? What do I do with a Snippet?

Third party software discussion goes here.
User avatar
Enrikk
Posts: 389

Snippet? What do I do with a Snippet?

Post#1 » Tue Feb 23, 2021 2:51 am

Hail All,

So, in my everquest (see what I did there??? :D ) to find an autoheal macro I cam across a SNIPPET that is apparently good.

Looking at it I can see it's missing some stuff from a macro, but I doubt it's so easy to just add what it's missing. I mean, each /sub needs a /return, correct? I can't just start pacing things in willy nilly, right?

So, what do I do with a SNIPPET?

Now, I plan to use this when I'm farming gems and such, as it often takes me longer to loot than it does to kill everything, and that's just boring.

Thanks all for your patience and support.

Enrikk
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

rmm10
Posts: 357

Re: Snippet? What do I do with a Snippet?

Post#2 » Tue Feb 23, 2021 8:16 am

Get with me in discord and I will send you a heal.mac that you only have to change spells names for, i.e, when you upgrade from Faithful Light Rk. I to Faithful Light Rk. II, you have to edit that. Its simple yet affective.

And yes, that means you'll have to get your Discord working. 8-)

User avatar
Enrikk
Posts: 389

Re: Snippet? What do I do with a Snippet?

Post#3 » Tue Feb 23, 2021 3:07 pm

I got it working.... :D
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

User avatar
Enrikk
Posts: 389

Re: Snippet? What do I do with a Snippet?

Post#4 » Wed Feb 24, 2021 11:19 pm

By this I mean,,, I got Discord working, not the snippet.

Still struggling with that.
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

User avatar
Enrikk
Posts: 389

Re: Snippet? What do I do with a Snippet?

Post#5 » Sat Feb 27, 2021 4:05 am

Hail All!

Ok, so in my efforts to find something to use I seem to have written something that is working for what I want it for. It quickly picks up everything from the corpses around me so I can have it looting while I'm pulling.

Several questions I think; I have it looping back upon itself and that works fine, but how do I stop the loop?

Loosely, everything runs in the sub main, using a :mainloop and the script runs through to the /goto :mainloop to start again, but I don't know how to end it other than typing /endm into the window.

It's written as:

Sub main

THE LOOP

/return

How would I incorporate an ending in the script?

Thanks in advance!
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

soandsoEQ
Posts: 39

Re: Snippet? What do I do with a Snippet?

Post#6 » Sat Feb 27, 2021 6:23 am

I guess the question is what are you trying to achieve here?

Is it an alt box that is picking up corpses?
If you have it looping to pick up corpses, do you want to reactivate it after each pull, loot, then once there are no corpses nearby end the macro?

The fun thing about programming is there are usually dozens or hundreds of ways of building solutions. That said, I have a couple ideas that might be sub-par, use at your own risk.

If you want it to end after it has looted all nearby corpses, put a wait in or a check for nearby corpses or something.

up above your :mainloop use a:

Code: Select all

/declare waitAfterLastLoot timer global 10s


then in your section of code where you found a corpse use:

Code: Select all

/varset waitAfterLastLoot 10s


then at the end of your loop before /goto :mainloop use something like this:

Code: Select all

/if (${waitAfterLastLoot}<=0) {
   /bcaa Hey you... I finished looting.  Now ready for combat!
   /endmacro
}


you could use that or use something that checks for nearby corpses at the end of your main loop, something like:

Code: Select all

/tar corpse
/if (${Target.Distance}>50) {
   /bcaa Hey you... I finished looting.  Now ready for combat!
   /endmacro
}

...replace 50 with whatever distance you want to be outside your nominal moveto/loot range

Just doing these off the top of my head, forgive me for any horrible mistakes!

User avatar
Enrikk
Posts: 389

Re: Snippet? What do I do with a Snippet?

Post#7 » Sat Feb 27, 2021 4:22 pm

soandsoEQ wrote:you could use that or use something that checks for nearby corpses at the end of your main loop, something like:

Code: Select all

/tar corpse
/if (${Target.Distance}>50) {
   /bcaa Hey you... I finished looting.  Now ready for combat!
   /endmacro
}

...replace 50 with whatever distance you want to be outside your nominal moveto/loot range


Thank you for this, first of all!

I'm trying to have an alt box do the looting while I'm pulling. For this all I'm interested in are the gems but I don't care if the box loots everything, I just clean it up later.

I haven't been able to get any of these suggestions to work yet, but I keep playtesting variations. But, this last suggestion is where I'm intrigued.

What is the syntax for "if target = 0, then /endmacro"? I'm not worried about DISTANCE as all corpses will be right at their feet. I want it to loot until there aren't any corpses left.

I tried:

/if (${Target}==0) {
/g I'm finished looting. Now ready for combat!
/endmacro
}

But it doesn't work as intended. I placed it right after the /tar command in the loop. I'm searching MQ Documentation for the correct argument but it's like looking for a needle in a haystack.

Appreciate ya!
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

soandsoEQ
Posts: 39

Re: Snippet? What do I do with a Snippet?

Post#8 » Sat Feb 27, 2021 4:33 pm

It is important to take into account the data type of what you are using.

http://macroquest.sourceforge.net/includes/manual.php

Thst is older but it gives you a lot of data in one page.

This is the data type for target.
https://www.macroquest2.com/wiki/index. ... targettype

If all you are calling is Target, that is a string that returns your current targets name. Look into NearestSpawn TLO for a solution.

User avatar
Enrikk
Posts: 389

Re: Snippet? What do I do with a Snippet?

Post#9 » Sun Feb 28, 2021 4:15 am

Thank you for your suggestions!

I've spent many hours researching and tweaking things, and in the end stumbled upon events.

I merely created an event with the string that pops up when there aren't any corpses, and in the event had an echo to tell me looting was done, and end the macro.

It seems to be working well. I'm sure someone else would make something more elegant, but I'm pretty happy with it.

Again, thank you for the nudges to the right information!
Lead, Follow, or get out of My Way!

Enrikk of the Few

With MANY voices Also in my head

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 1 guest

cron