• 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

Question - Remove one out of two buffs with the same name

Soandso2

Well-known member
Joined
Mar 13, 2023
RedCents
937¢
I have the Fungal Underbulk clicky. Clicking this item summons an underbulk familiar and places two buffs in the buff window. The buffs have different icons and IDs, but share the same name. (Both are called Summon Familiar: Fungal Underbulk) One of these buffs simply keeps the familiar in the game and this one can be removed, without losing the familiar's benefits. (The underbulk is large and I never want to see it.) The other buff is the one that actually gives you the benefits, which you obviously want to keep. I am coding the Lua now, without ability to test the code, and since you guys are usually quick to reply, I am throwing this out here for your judgement (/shiver)

Is this right for checking if I have the buff that gives the benefits (it has ID 54949)?
Edit: Rather, is this right for checking if I do NOT have a buff by it's ID rather than it's name.

[CODE lang="Lua" title="Summon Familiar: Fungal Underbulk"] if not mq.TLO.Me.Buff("Summon Familiar: Fungal Underbulk").ID(54949)() and not mq.TLO.Me.Moving() then
-- some code goes here
end[/CODE]
 
I have the Fungal Underbulk clicky. Clicking this item summons an underbulk familiar and places two buffs in the buff window. The buffs have different icons and IDs, but share the same name. (Both are called Summon Familiar: Fungal Underbulk) One of these buffs simply keeps the familiar in the game and this one can be removed, without losing the familiar's benefits. (The underbulk is large and I never want to see it.) The other buff is the one that actually gives you the benefits, which you obviously want to keep. I am coding the Lua now, without ability to test the code, and since you guys are usually quick to reply, I am throwing this out here for your judgement (/shiver)

Is this right for checking if I have the buff that gives the benefits (it has ID 54949)?
Edit: Rather, is this right for checking if I do NOT have a buff by it's ID rather than it's name.

[CODE lang="lua" title="Summon Familiar: Fungal Underbulk"] if not mq.TLO.Me.Buff("Summon Familiar: Fungal Underbulk").ID(54949)() and not mq.TLO.Me.Moving() then
-- some code goes here
end[/CODE]
/familiar leave
Or check the key ring settings for familiar, I think you can set it there.
 
/familiar leave
Or check the key ring settings for familiar, I think you can set it there.
Oh, there actually is a command for specifically make familiars go away without losing the effects? I had no idea. Many thanks! (But the original question remains)
 
Last edited:
since you know the id of the buff just removebuff 3434324?

not sure if that works but it should?
 
since you know the id of the buff just removebuff 3434324?

not sure if that works but it should?
I guess I phrased my question poorly. Sorry about that.

The real question is "if two buffs have identical names, for example MyMegaBuff, but different IDs, for example ID 8888 and ID 9999, how do I...

a) check that I have the buff with ID 9999, and if I don't, use the clicky.
b) remove the one with ID 8888 after having used the clicky

Since mq.TLO.Me.Buff["Whatever"].ID() gives me the buff slot number, not the ID of the actual spell.

The reason for asking was that when I wrote the question I did not know that I could easily remove the familiar without having to care about which one of the buffs it was.

The solution to my predicament seems to be to make the script always remove the familliar by using /familiar remove command after having used the clicky.
Then I will always only have one buff and can check for it by name, like so:
Code:
    if mq.TLO.Me.Buff("Summon Familiar: Fungal Underbulk").ID() == nil and not mq.TLO.Me.Moving() then
      useClickys("Fungal Underbulk")
      mq.delay(5050)
      mq.cmd("/familiar leave")
    end
 
Last edited:
The solution to my predicament seems to be to make the script always remove the familliar by using /familiar remove command after having used the clicky.
Then I will always only have one buff and can check for it by name.
there is a checkbox in your familiar keyring, just check that and you will never see that familiar.
 
Since mq.TLO.Me.Buff["Whatever"].ID() gives me the buff slot number, not the ID of the actual spell.

Translate for your needs.

[CODE title="Example in Macroscript"]/for i 1 to 40

/if (${Me.Buff[${i}].ID}) {

/echo "Buff ${i} is ${Me.Buff[${i}].Name} with ID: ${Me.Buff[${i}].ID}"

}

/next i[/CODE]

Basically you can iterate through the list. The index here can be either a string or a number, in the event it's a number it will go to that index in the array of buffs. So you don't need to be looking for a specific buff to find out what buffs you have. You can simply iterate through them. Then you can query the relevant information about the buff that you want to check and determine what to do with it based on your findings.

[CODE lang="cpp" title="Buff and Song members" highlight="7, 34"]case CharacterMembers::Buff:
Dest.Type = pBuffType;
Dest.HighPart = SpellDisplayType_BuffWnd;
if (!Index[0])
return false;

if (IsNumber(Index))
{
int nBuff = GetIntFromString(Index, 0) - 1;
if (nBuff < 0 || nBuff > NUM_LONG_BUFFS || pProfile->GetEffect(nBuff).SpellID <= 0)
return false;

Dest.Int = nBuff;
return true;
}

{
int buffID = FindBuffIndex(Index, 0, NUM_LONG_BUFFS);
if (buffID >= 0 && buffID < NUM_LONG_BUFFS)
{
Dest.Int = buffID;
return true;
}
}

return false;

case CharacterMembers::Song:
Dest.Type = pBuffType;
Dest.HighPart = SpellDisplayType_None;
if (!Index[0])
return false;

if (IsNumber(Index))
{
int nBuff = GetIntFromString(Index, 0) - 1;
if (nBuff < 0 || nBuff >= NUM_SHORT_BUFFS || pProfile->GetTempEffect(nBuff).SpellID <= 0)
return false;

Dest.Int = nBuff + NUM_LONG_BUFFS;
return true;
}

{
int buffID = FindBuffIndex(Index, NUM_LONG_BUFFS, MAX_TOTAL_BUFFS);
if (buffID >= NUM_LONG_BUFFS && buffID < MAX_TOTAL_BUFFS)
{
Dest.Int = buffID;
return true;
}
}

return false;[/CODE]

The results are of pBuffType, and that contains members for the following.

[CODE lang="cpp" title="pBuffType members"]enum class BuffMembers
{
ID,
Level,
Spell,
Mod,
Duration,
Dar,
TotalCounters,
HitCount,
CountersDisease,
CountersPoison,
CountersCurse,
CountersCorruption,
Caster,
};[/CODE]

Now while that will get you information specific to the buff you may want more information about the spell itself, in which case you can do a .Spell} and then the members of spell are as follows.

[CODE lang="cpp" title="pSpellType members"]enum class SpellMembers
{
ID = 1,
Name,
Level,
Skill,
Mana,
ResistAdj,
Range,
AERange,
PushBack,
CastTime,
FizzleTime,
MyCastTime,
RecoveryTime,
RecastTime,
Duration,
SpellType,
TargetType,
ResistType,
CastOnYou,
CastOnAnother,
WearOff,
CounterType,
CounterNumber,
Stacks,
WillLand,
StacksPet,
WillLandPet,
WillStack,
MyRange,
EnduranceCost,
MaxLevel,
Category,
Subcategory,
Restrictions,
Base,
Base2,
Max,
Calc,
Attrib,
AutoCast,
Extra,
RecastTimerID,
ReagentID,
ReagentCount,
CastByOther,
TimeOfDay,
DurationWindow,
CanMGB,
Deletable,
BookIcon,
ActorTagId,
Description,
StacksWith,
Rank,
RankName,
SpellGroup,
SubSpellGroup,
Beneficial,
IsActiveAA,
CalcIndex,
NumEffects,
Location,
IsSwarmSpell,
IsSkill,
DurationValue1,
NewStacks,
NewStacksWith,
StacksTarget,
StacksWithDiscs,
IllusionOkWhenMounted,
EQSpellDuration,
CastByMe,
HasSPA,
Trigger,
BaseName,
NoExpendReagentID,
StacksSpawn,
SpellIcon,
GemIcon,
SlowPct,
HastePct,
MyDuration,
BaseEffectsFocusCap,
CategoryID,
SubcategoryID,
Dispellable,
Link,
};[/CODE]
 
Last edited:
Hmm I was under the impression that Me.Buff["buffname"].ID() gave the the buff slot number, not the ID of the spell. Oh well, you always learn something new. Many thanks :)
 
well when you put .ID you're specifically saying you want the ID, so it should give you the ID of the buff.
Right. I think I got it. Thanks again. :)

Actually, I have a follow-up question.
Are IDs always Integers? Will mq.TLO.Something.ID() ALWAYS give me 0 or a higher value? Or will it sometimes give nil rather than 0?

if not mq.TLO.Something.ID() then would not work if ID gives 0, I think.
 
Last edited:
Question - Remove one out of two buffs with the same name

Users who are viewing this thread

Back
Top
Cart