• 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

Problem - AltAbility does not work

Soandso2

Well-known member
Joined
Mar 13, 2023
RedCents
937¢
[CODE lang="Lua" highlight="23-28"]local hostOfTheElements = false
local servantOfRo = false
local companionsFury = false
local mendCompanion = false

while true do
if me.CombatState() == "COMBAT" and target() and utils.goodToGo() then
if me.AltAbilityReady('Host of the Elements')() and not hostOfTheElements then
mq.cmd("/alt act 207")
--mq.cmd("/g Sost of the Elements!")
print("Host of the Elements!")
hostOfTheElements = true
elseif me.AltAbilityReady('Servant of Ro')() and not servantOfRo then
mq.cmd("/alt act 174")
--mq.cmd("/g Servant of Ro!")
print("Servant of Ro!")
servantOfRo = true
elseif me.AltAbilityReady('Mend Companion')() and not mendCompanion and pet.PctHPs() < 20 then
mq.cmd("/alt act 58")
--mq.cmd("/g Mend Companion!")
print("Mend Companiona!")
mendCompanion = true
elseif me.AltAbilityReady("Companion's Fury")() and not companionsFury then
mq.cmd("/alt act 60")
--mq.cmd("/g Companion's Fury!")
print("Companion's Fury!")
companionsFury = true
end
end

if me.CombatState() ~= "COMBAT" then
hostOfTheElements = false
servantOfRo = false
companionsFury = false
mendCompanion = false
end
end[/CODE]

In the above snippet, Host of the Elements and Servant of Ro work as intended and expected. They activate just fine.

However Companion's Fury does not. (Mend Companion has never had a chance to trigger at the time of writing this, so I dont know about that one.)

I don't think this is a programming issue, but some other kind of strange wierdness. I think the issue concerns the actual Alternative Ability and not the code. The AA is listed as Companion's Fury, but the hot button is called Frenzied Burnout, and the effect I get is Frenzied Burnout I. I have tried to change Companion's Fury to Frenzied Burnout and Frenzied Burnout I in the code, but neither works. Does anyone know what is wrong and how it should be?
 
No its your code, if that is the full sources then I am amazed it even runs.

This means nothing
me.AltAbilityReady

do you have
local mq = require('mq')

Then it should be
mq.TLO.Me.AltAbilityReady("Companion's Fury")
1707815873990.png

you could have done this, your code simply does not show the me assignment.
could also use the altability number to check against
[code lang="Lua"]
local mq = require('mq')

local me = mq.TLO.Me

print(me.AltAbilityReady("Companion's Fury")())
print(me.AltAbilityReady(60)())

print(mq.TLO.Me.AltAbilityReady("Companion's Fury")())
print(mq.TLO.Me.AltAbilityReady(60)())
[/code]
 
No its your code

This means nothing


do you have


Then it should be
Sorry, I only posted the part of the code that casues problems.

Further up in the code I have local me = mq.TLO.Me (in the required utility script) and naturally, I also have local mq = require("mq")

Like I said, the Servant of Ro and Host of Elements work as intended. Let me clarify by posting the entire Lua.

Lua:
mq = require('mq')

printf("\nStarting MAM (dev) at %s",os.date('%H:%M:%S'))

require("../includes/utils")

local burnout = true
local guard = true
local strength = true

function checkPet()

    if not pet.Buff("Burnout VI")() and burnout then
        print ("\arPet does not have Burnout VI")
        burnout = false
    elseif pet.Buff("Burnout VI")() and not burnout then
        print ("\agPet has Burnout VI")
        burnout = true
    end
  
    if not pet.Buff("Iceflame Guard")() and guard then
        print ("\arPet does not have Iceflame Guard")
        guard = false
    elseif pet.Buff("Iceflame Guard")() and not guard then
        print ("\agPet has Iceflame Guard")
        guard = true
    end
  
    if not pet.Buff("Rathe's Strength")() and strength then
        print ("\arPet does not have Rathe's Strength")
        strength = false
    elseif pet.Buff("Rathe's Strength")() and not strength then
        print ("\agPet has Rathe's Strength")
        strength = true
    end

end

local hostOfTheElements = false
local servantOfRo = false
local companionsFury = false
local mendCompanion = false

while true do
    mq.doevents()
    if pet.ID() > 0 and not me.Moving() and not me.Invis() and me.Casting.ID() == nil then
        checkPet()
    end
  
    if me.CombatState() == "COMBAT" and target() and utils.goodToGo() then
        if me.AltAbilityReady('Host of the Elements')() and not hostOfTheElements then
            mq.cmd("/alt act 207")
            --mq.cmd("/g Sost of  the Elements!")
            print("Host of the Elements!")
            hostOfTheElements = true
        elseif me.AltAbilityReady('Servant of Ro')() and not servantOfRo then
            mq.cmd("/alt act 174")
            --mq.cmd("/g Servant of Ro!")
            print("Servant of Ro!")
            servantOfRo = true
        elseif me.AltAbilityReady('Mend Companion')() and not mendCompanion and pet.PctHPs() < 20 then
            mq.cmd("/alt act 58")
            --mq.cmd("/g Mend Companion!")
            print("Mend Companiona!")
            mendCompanion = true
        elseif me.AltAbilityReady("Companion's Fury")() and not companionsFury then
            mq.cmd("/alt act 60")
            --mq.cmd("/g Companion's Fury!")
            print("Companion's Fury!")
            companionsFury = true
        end
    end
  
    if me.CombatState() ~= "COMBAT"  then
        hostOfTheElements = false
        servantOfRo = false
        companionsFury = false
        mendCompanion = false
    end
  

end
 
Run that Lua code I showed, Companion's Fury or 60 is the correct way to test if the AA is ready, you have a problem somewhere else.

PS I logged a mage in and tested it before posting
 
I added print(me.AltAbilityReady(60)()) and print(me.AltAbilityReady("Companion's Fury")()) outside the while-loop and both prints TRUE (as expected).
And just as a test I changed Companion's Fury to Frenzied Burnout, which gives FALSE (again, as expected).

Which leads to the question, why it does not work when I play and enter combat. There are not syntax errors, no warnings, the Lua does not crash or anything.
And I would like to stress that the Servant of Ro and Host of the Elements AAs fire exactly as they should.
I do not see anything wrong, still something must be wrong. I just dont see it.
 
Try moving the companions fury to its own if and just before it print the 2 conditions.
I tried and here is what happened.
This time ONLY companion's fury triggered, but not the Servant of Ro and Host of the Elements. However, the PRINT-part for both Servant and Host printed their texts. But the AAs were not activated.

Only posting the relevant part of the Lua this time, to show the change I made. The highlighted parts "happened".

[CODE lang="Lua" highlight="2-8,13,18"]if me.CombatState() == "COMBAT" and target() and utils.goodToGo() then
if me.AltAbilityReady("Companion's Fury")() and not companionsFury then
-- Seems you can use the alt act ID instead of the name of the ability. Let's see if that works.
mq.cmd("/alt act 60")
--mq.cmd("/g Companion's Fury!")
print("Companion's Fury!")
companionsFury = true
end

if me.AltAbilityReady('Host of the Elements')() and not hostOfTheElements then
mq.cmd("/alt act 207")
--mq.cmd("/g Sost of the Elements!")
print("Host of the Elements!")
hostOfTheElements = true
elseif me.AltAbilityReady('Servant of Ro')() and not servantOfRo then
mq.cmd("/alt act 174")
--mq.cmd("/g Servant of Ro!")
print("Servant of Ro!")
servantOfRo = true
elseif me.AltAbilityReady('Mend Companion')() and not mendCompanion and pet.PctHPs() < 20 then
mq.cmd("/alt act 58")
--mq.cmd("/g Mend Companion!")
print("Mend Companion!")
mendCompanion = true
end
end

if me.CombatState() ~= "COMBAT" then
hostOfTheElements = false
servantOfRo = false
companionsFury = false
mendCompanion = false
end[/CODE]
 
I do not see a mq.delay in that loop ?
No there is none. Is that required? I have a similar, much longer version of this on my bard and there is no delay there either, but it works flawlessly.

(Only relevant snippet from the bard Lua)

Lua:
if me.AltAbilityReady('Cacophony')() and not cacophony then
            mq.cmd("/alt act 553")
            mq.cmd("/g Cacophpny!")
            cacophony = true
        elseif me.AltAbilityReady('Funeral Dirge')() and not funeral then
            mq.cmd("/alt act 777")
            mq.cmd("/g Funeral Dirge!")
            funeral = true
        elseif me.AltAbilityReady('Spire of the Minstrels')() and not spire then
            mq.cmd("/alt act 1420")
            mq.cmd("/g Spire of the Minstrels!!")
            spire = true
        elseif me.AltAbilityReady('Dance of Blades')() and not dance then
            mq.cmd("/alt act 359")
            mq.cmd("/g Dance of Blades")
            dance = true
        elseif me.AltAbilityReady('Quick Time')() and not quicktime then
            mq.cmd("/alt act 3702")
            mq.cmd("/g Quick Time!")
            quicktime = true
        elseif me.AltAbilityReady('Fierce Eye')() and not fierceeye then
            mq.cmd("/alt act 3506")
            mq.cmd("/g Fierce Eye!")
            fierceeye = true
        elseif me.AltAbilityReady('Bladed Song')() and not bladedsong then
            mq.cmd("/alt act 669")
            mq.cmd("/g Bladed Song!")
            bladedsong = true
        elseif me.AltAbilityReady('Flurry of Notes')() and not flurry then
            mq.cmd("/alt act 899")
            mq.cmd("/g Flurry of Notes!")
            flurry = true
        elseif me.AltAbilityReady('Frenzied Kicks')() and not frenzy then
            mq.cmd("/alt act 910")
            mq.cmd("/g Frenzied Kicks!")
            frenzy = true
        elseif me.AltAbilityReady('Lyrical Prankster')() and not prankster then
            mq.cmd("/alt act 8204")
            mq.cmd("/g Lyrical Prankster!")
            prankster = true
        elseif me.AltAbilityReady('Song of Stone')() and not songofstone then
            mq.cmd("/alt act 544")
            mq.cmd("/g Song of Stone!")
            songofstone = true
        elseif me.CombatAbilityReady('Reflexive Rebuttal')() and not reflexive then
            mq.cmdf('/doability "%s"',"Reflexive Rebuttal")
            mq.cmd("/g Reflexive Rebuttal!")
            reflexive = true
        elseif me.CombatAbilityReady('Thousand Blades')() and not thousandblades then
            mq.cmdf('/doability "%s"',"Thousand Blades")
            mq.cmd("/g Thousand Blades!")
            thousandblades = true
        end
 
I tried and here is what happened.
This time ONLY companion's fury triggered, but not the Servant of Ro and Host of the Elements. However, the PRINT-part for both Servant and Host printed their texts. But the AAs were not activated.

Only posting the relevant part of the LUA this time, to show the change I made. The highlighted parts "happened".
Highlights don't show up
Just remember there is casting cooldowns that a bard doesn't have.

So what is happening is you
check the aa and the boolean,
.. global cooldown is not ready but you set the boolean as if it casted,
.. next time check AA is ready but boolean says it is already used.

Why have a boolean there anyway ? drop that and it should work as expected, Probably the root problem
 
If I want to be fairly certain an AA is cast, if possible, I do this:
Also, Host of Elements is sort of a problem child, unloading the clown car has a bit of a delay.

Condensed from MageKill
[CODE title="Condensed from MageKill"]
--[[
Created by Pricklygoat723
--]]
---@type Mq
mq = require('mq')

local COMPANIONS_FURY = 60
local HOST_OF_ELEMENTS = 207
local SERVANT_OF_RO = 174

function AAEmpty(index)
return mq.TLO.Me.AltAbility(index)() == nil
end

function AAReadyToCast(index)
if AAEmpty(index) then
return false
end
if mq.TLO.Me.Casting() then
return false
end
if not mq.TLO.Me.AltAbilityReady(index)() then
return false
end
local ticks = mq.TLO.Me.AltAbilityTimer(index)()
return (ticks == 0)
end

function WaitCastAA(index, ms)
local wait = 50
if AAEmpty(index) then
return false
end
local total_ms = 0
while not AAReadyToCast(index) do
mq.delay(wait)
total_ms = total_ms + wait
if total_ms > ms then
print('WaitCastAA LIMIT EXCEED: ', ms)
return false
end
end
print('Wait ' .. total_ms .. ' AA ' .. mq.TLO.Me.AltAbility(index).Name())
mq.cmdf('/alt activate "%s"', index)
mq.delay(wait*10)
return true
end

WaitCastAA(SERVANT_OF_RO, 10000)
WaitCastAA(HOST_OF_ELEMENTS, 10000)
WaitCastAA(COMPANIONS_FURY, 10000)
[/CODE]
 
No there is none. Is that required? I have a similar, much longer version of this on my bard and there is no delay there either, but it works flawlessly.

(Only relevant snippet from the bard lua)
Required no, Here is the catch you need to give the game time to actually do what you asked. Look at your loop, you are asking the game to do actions but never giving it time to do the action or even checking if the action completed before asking for the next action to be done. Pricklygoat723 snippet is perfect. it checks if aa exist/check if ready/cast/wait for cast to complete/giving the game time to do the action, all without trying to manage the use through boolean flags in a loop.


PS just tested the casttime on Fury, about 1.5 seconds, how many times did that loop of yours repeat while casting was still going on, probably a whole bunch ! thereby setting the other aa as used.


This all is based on the assumption utils.goodToGo() doesnt have delays/casting checks built in.

Stepping off this now, think you have the information to fix your problem.
 
Why are you setting a bool when you fire the AA as opposed to checking the current state of the AA and firing it when you can / need it?
 
Why are you setting a bool when you fire the AA as opposed to checking the current state of the AA and firing it when you can / need it?
If that was directed toward my post, then it serves no purpose here.
However, i use these in more complicated logic that often calls them as the condition of if-then-else statements.
So i want to know if WaitCastAA attempted to cast the AA.
But I wanted to paste into my answer tested code and not write new stuff.
 
Problem - AltAbility does not work

Users who are viewing this thread

Back
Top
Cart