• 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 - Shouldn't Rankname reply with the full spell name including rank?

Joined
Oct 31, 2019
RedCents
1,695¢
stringRankNameReturns the spell/combat ability name rank character has.

I have a mage with a spell named 'Scorching Skin Rk. II' in its spellbook.
Debugging my lem, I found an unexpected behavior:
Code:
/lua parse print(mq.TLO.Spell('Scorching Skin').RankName())
replies : Scorching Skin
Code:
/lua parse print(mq.TLO.Spell(tostring('Scorching Skin')).RankName())
replies : Scorching Skin
Code:
/lua parse print(mq.TLO.Spell(tostring('Scorching Skin Rk. II')).RankName())
replies: Scorching Skin Rk. II

I understood that Rankname should give me the the full spell name including the Rankname of the actual spell in my spellbook.
Did I misunderstood that, or is there a syntax error?

My expectation is, that all 3, or atleast the last two lines should reply: Scorching Skin Rk. II, if that's the version in the spellbook.
 
Solution
well you're specifically looking up that specific spell

TLO.Spell[blah] says "grab the specific spell 'blah' and then let me do stuff with it

are you sure you're not trying to see what spell you have - because that sounds like what you're trying to do.

Me.Spell[blah].RankName

/lua parse print(mq.TLO.Me.Spell('Scorching Skin').RankName())
which because me.spell is returning the spell you have, you can do it without .RankName

Less:
> /lua parse print(mq.TLO.Me.Spell('Touch of Txiki')())
Touch of Txiki Rk. III
> /lua parse print(mq.TLO.Me.Spell('Touch of Txiki').RankName())
Touch of Txiki Rk. III
well you're specifically looking up that specific spell

TLO.Spell[blah] says "grab the specific spell 'blah' and then let me do stuff with it

are you sure you're not trying to see what spell you have - because that sounds like what you're trying to do.

Me.Spell[blah].RankName

/lua parse print(mq.TLO.Me.Spell('Scorching Skin').RankName())
which because me.spell is returning the spell you have, you can do it without .RankName

Less:
> /lua parse print(mq.TLO.Me.Spell('Touch of Txiki')())
Touch of Txiki Rk. III
> /lua parse print(mq.TLO.Me.Spell('Touch of Txiki').RankName())
Touch of Txiki Rk. III
 
Solution
you are right, ".Me" missing but now it gets more curious either:

checked the following on 2 different mages, both having the RK. II version in the spellbook:


Code:
/lua parse print(mq.TLO.Me.Spell('Scorching Skin').RankName())
/lua parse print(mq.TLO.Me.Spell(tostring('Scorching Skin')).RankName())

where one mage replies ok with the RK. II spell name, the other one insists to reply without RK. II.
I copy paste both lines from a text editor to both mages, in order to be shure to not type any differences.
 
you are right, ".Me" missing but now it gets more curious either:

checked the following on 2 different mages, both having the RK. II version in the spellbook:


Code:
/lua parse print(mq.TLO.Me.Spell('Scorching Skin').RankName())
/lua parse print(mq.TLO.Me.Spell(tostring('Scorching Skin')).RankName())

where one mage replies ok with the RK. II spell name, the other one insists to reply without RK. II.
I copy paste both lines from a text editor to both mages, in order to be shure to not type any differences.
did one go silver?
 
rereaded the thread and tried the suggested:
"Good Mage" working as intended
1667067353266.png


bugged mage:
1667067499327.png

I have no clue, why the "bugged mage" does not reply the right full name of the spell, nor how to circumvent the problem within my lem.

[CODE title="ChainDS"]---@type Mq
---@type ImGui

local mq = require('mq')
local Spellname=''
local bPetAttack=false

-- if XTarNr == 0 then no targeting shall be needed
-- important to make this work: insert the slot in XTargetWindow where the Tank resides who shell get the ds'es
local XTarNr = 11 -- ATTN: set your Tank to a specific Xtended Target Slot and insert number here
local XtarGATNr = 13 -- Attn: set "Group Assist Target" Xtarget Number here, if you want pet assist; set 0 if no Petassist wanted

local dsSpells = {
MAG={name='Scorching Skin Rk. II',type='spell'},
DRU={name='Daggerthorn',type='spell'}
}

local function StopDPS()
mq.cmd('/squelch /mqp on')
mq.delay(10)
if mq.TLO.Me.Class.ShortName() == 'BRD' then
mq.cmd('/squelch /twist off')
mq.delay(10)
mq.cmd('/squelch /stopsong')
mq.delay(10)
end
--mq.cmd('/attack off')
--mq.delay(10)
mq.cmd('/squelch /boxr pause')
mq.delay(10)
while mq.TLO.Me.Casting.ID() do
mq.delay(100)
end
end

local function ResumeDPS()
mq.cmd('/squelch /mqp off')
mq.delay(10)
if mq.TLO.Me.Class.ShortName() == 'BRD' then
mq.cmd('/squelch /twist on')
mq.delay(10)
end
mq.cmd('/squelch /boxr unpause')
mq.delay(10)
end

local function on_load()
local dsSpell = dsSpells[mq.TLO.Me.Class.ShortName()]
Spellname = mq.TLO.Spell(tostring(dsSpell.name)).RankName()
if dsSpell and dsSpell.type == 'spell' and XTarNr > 0 then
if mq.TLO.Me.Gem(Spellname)() > 0 then return end -- Should be memmed already
StopDPS()
print('memming spell "%s"', Spellname)
mq.cmdf('/memspell 13 "%s"', Spellname)
mq.delay('4s')
mq.TLO.Window('SpellBookWnd').DoClose()
ResumeDPS()
end
end

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
---@diagnostic disable-next-line: undefined-field
if mq.TLO.XAssist.XTFullHaterCount() > 0 then return true end
return true
--return mq.TLO.Me.Combat() --or XTarget
end

local function target_Tank()
if XTarNr > 0 then
mq.cmdf('/squelch /xtar %i', XTarNr)
mq.delay(20)
end
end

local function petAssist()
if XtarGATNr > 0 then
mq.cmdf('/squelch /xtar %i', XtarGATNr)
mq.delay(20)
mq.cmd('/squelch /pet attack')
mq.delay(20)
end
end

local function cast(spell)
--print('casting ', spell.RankName())
mq.cmdf('/cast %s', spell.RankName())
mq.delay(20)
mq.doevents()
---@diagnostic disable-next-line: undefined-field
mq.delay(20+mq.TLO.Me.CastTimeLeft.Raw())
-- mq.delay(20+mq.TLO.Spell(spell).MyCastTime.Raw)
end

local function use_aa(aa)
mq.cmdf('/alt activate %s', aa.ID())
mq.delay(20)
mq.doevents()
---@diagnostic disable-next-line: undefined-field
mq.delay(20+mq.TLO.Me.CastTimeLeft.Raw())
end

local function ds_ready(ds)
if ds.type == 'spell' then
return mq.TLO.Me.SpellReady(Spellname) and not mq.TLO.Me.Casting()
elseif ds.type == 'aa' then
return mq.TLO.Me.AltAbilityReady(tostring(ds.name)) and not mq.TLO.Me.Casting()
end
end

local function action()
local my_class = mq.TLO.Me.Class.ShortName()
local ds = dsSpells[my_class]
-- if ds ability isn't ready, return
if not ds then
print('no ds found for my class')
return
end
if my_class ~= 'BRD' and not ds_ready(ds) then return end
StopDPS()
--print('targeting tank')
target_Tank()
if ds.type == 'spell' then
cast(mq.TLO.Spell(ds.name))
else
use_aa(mq.TLO.Me.AltAbility(ds.name))
end
petAssist()
while mq.TLO.Me.Casting() do
mq.doevents()
mq.delay(50)
end
ResumeDPS()
end

return {onload=on_load, condfunc=condition, actionfunc=action}[/CODE]


I have Issues within the function: "on_load()" as this lem will unmemm slot 13 attempting to mem the 'scorching skin' without "RK. II".
 
Last edited:
I have no clue, why the "bugged mage" does not reply the right full name of the spell, nor how to circumvent the problem within my lem.

This is likely due to the order of the spells in your spell book. I didn’t read your code though.
 
Not exactly on topic, but wanted to comment on the code above.
The annotations for type, are incorrectly used.
They are designed to annotate the line directly below them as seen in the example. Otherwise, auto-complete in VS Code won't work correctly.

[CODE lang="Lua" title="Annotation Example"]---@type Mq
local mq = require('mq')

---@type ImGui
require('ImGui')
[/CODE]
 
You don’t need to print the results of parse. It already does that for you

Calling tostring on a string does nothing and is just noise. You don’t need to call tostring anywhere in this thread

Also I still see mq.TLO.Spell in your script
 
@Coldblooded : many thanks, changed it in all my lems
@brainiac :
- "tostring" I added, as II found these in samples of others, in hope to get a better result, will erase it.
- mq.TLO.Spell(ds.name) for my understanding should be a legit command, to get an "spelll" object to pass to the cast-routine. Is there anything wrong?
 
@brainiac: rereading Sic's post didn't brought me any closer to the core of the issue. A senctence with a more specific hint would might have been more useful.

Presume I found the Issue:
The hint from @Knightly brought me to the core of the issue. @Knightly many thanks, now I understand what's going on.
My thought was, that you can not have the RK.I and the RK.II version of same spell in your spellbook.
Nevertheless I searched manually the spellbook of the seemingly bugged mage site after site and surprisingly found "scorching skin" without RK .II.

Than I checked with allakhazam:
1667924411173.png

The identic spell name exisits twice, once for the spell lvl 73, once for the spell lvl 118.
The seemingly bugged mage is missing the RK.II of the lvl 73 version.
I moved the lvl 73 Spell to page 140 of the spellbook.
Nevertheless it's found first and I could't fix it that way.

As a workaround I am going to get the RK.II of the lvl 73 version as well.
 
Last edited by a moderator:
@brainiac: rereading Sic's post didn't brought me any closer to the core of the issue. A senctence with a more specific hint would might have been more useful.

Presume I found the Issue:
The hint from @Knightly brought me to the core of the issue. @Knightly many thanks, now I understand what's going on.
My thought was, that you can not have the RK.I and the RK.II version of same spell in your spellbook.
Nevertheless I searched manually the spellbook of the seemingly bugged mage site after site and surprisingly found "scorching skin" without RK .II.

Than I checked with allakhazam:
View attachment 43318

The identic spell name exisits twice, once for the spell lvl 73, once for the spell lvl 118.
The seemingly bugged mage is missing the RK.II of the lvl 73 version.
I moved the lvl 73 Spell to page 140 of the spellbook.
Nevertheless it's found first and I could't fix it that way.

As a workaround I am going to get the RK.II of the lvl 73 version as well.
there are many spells in everquest that have the exact same name. searching for the spell by name is going to return the first spell it finds by the name. If there are duplicates in your spell book - it is going to return the first one that it finds

try searching by spell ID instead, if that is posing a problem for you

some examples include:
bst
growl of the leopard lvl 104 and lvl 61
spiritual vigor 117 and lvl 62
natural cooperation 106 and 96

mage
scorching skin 118, 73

shd
last breath 90, 75

pal
protective devotion 110, 90

re: the information i provided - please make sure to use your words to express that something someone spent time writing up didn't make sense to you. What I addressed - the missing "Me" is a hugely important part of the original puzzle here and fundamental to any resolution at all, and if you don't understand what i said around that, please ask questions so you can gain understanding.
 
@Sic: your Information about the missing "Me" was very helpful. I changed my code immediately after I understood this information. I confirmed that I understood this in post #3.
All you wrote was helpful to me, I had no intension to be disrespectful towards you.
What did not made much sense to me was @braniacs: "Read Sic’s first post again" without any further information or deatails.
 
@Sic: your Information about the missing "Me" was very helpful. I changed my code immediately after I understood this information. I confirmed that I understood this in post #3.
All you wrote was helpful to me, I had no intension to be disrespectful towards you.
What did not made much sense to me was @braniacs: "Read Sic’s first post again" without any further information or deatails.
yup you did, which is likely why brain responded how he did, because you appeared to go back the original thing, instead of the new found information.

brain was responding to where you said mq.TLO.Spell(ds.name) for my understanding should be a legit command, to get an "spelll" object to pass to the cast-routine. Is there anything wrong?" - brain was pointing you towards using what i posted about the missing Me

I don't think you were being disrespectful, I was just letting you know that communicating wants/needs/confusion is far more useful than not
 
Question - Shouldn't Rankname reply with the full spell name including rank?

Users who are viewing this thread

Back
Top
Cart