Thanks for explaining, Byrth.
Thanks for explaining, Byrth.
i believe this is the issue you are having
when doing a spell from gearsap likeCode:Advanced string building when using a string value you have a choice between using '<string>' and "<string>" but there are some things you need to know when using a string and your string includes another "or' it will cause an error Example: "How are you" --correct 'How are you' --correct "How "are" you" --incorrect 'How 'are' you' --incorrect string do have special characters for use the specific situations like \ Example: "How \"are\" you" --correct 'How \'are\' you' --correct "How 'are' you" --correct 'How "are" you' --correct
/ma "Enlight II" <me>
when in text these are the only valid ways
'/ma "Enlight II" <me>'
"/ma 'Enlight II' <me>"
In client,
/ma 'Enlight II' <me>
is a valid command that will cast Enlight II on yourself. The command wasn't malformed, it's just a syntax Gearswap evidently wasn't built to consider.
And since I'm asking stupid questions anyway, does anyone know what the M in front of most state variable assignments means? The LUA language documentation isn't really giving me what I'm looking for.
I would like to know if its possible to determine, within gearswap, if a specific Blue Magic spell is actually set to use.
For example, lets say I want to make a Blue Mage sleeping macro. But I only set one of the two spells at a time, so instead of making a macro for both Sheep Song and a macro for Dream Flower, I want to make one macro which uses a command like:
And within that command have it check:Code:/con gs c blusleep
is there a piece of script like how "windower.ffxi.get_spell_recasts()[678] < 1"Code:if command == 'blusleep' then if "dream flower is set" and "recast ready" then send_command('dreamflower') elseif "sheep song is set" and "recast ready" then send_command('sheepsong') end end
determines if Dream Flower recast is ready, that will determine if a spell is set?
Or maybe if its a better solution to make a function like blusleep_set()
and call it at the start of the command and have it check:
and the function:Code:if command == 'blusleep' then blusleep_set() if "dreamflower recast ready" and dreamflowerset then send_command('dreamflower') elseif "sheepsong recast ready" and sheepsongset then send_command('sheepsong') end end
If there is a way, I just need the part of the script that would determine if the spell is set to use. The rest I can figure out on my own. In the above code anything bold is placeholder for the actual code that works.Code:function blusleep_set() if "STUFF THAT DETERMINES DREAM FLOWER IS SET" then dreamflowerset = true else dreamflowerset = false end if "STUFF THAT DETERMINES SHEEP SONG IS SET" then sheepsongset = true else sheepsongset = false end end
For normal spells on BLU main:
Dream Flower is spell.id 678 and sheep song is spell.id 584Code:table.contains(windower.ffxi.get_mjob_data().spells,spell.id)
For UL spells, just check for the UL buff.
I think mounts are technically job abilities, so:
I would imagine that get_abilty_recasts has the recasts.Code:local available = windower.ffxi.get_abilities().job_abilities if not table.contains(available,action.id) then bool,err = false,"Unable to execute command. You do not have access to that job ability." end
im assuming this will give me an ID of an ability when used? where do i put this code at? i put it in precast and it give me a "attempt to index global 'action' (a nil value)" error. I honestly thought it was a ability recast too, but i didnt see it in the resources ability recast file.
My next question is: in the "function buff_change(buff,gain)" I used to have chatmon play sounds when i got certain debuffs like encumberance, silence, petrify, ect... helps when i dual box so i know to switch over to fix it or i just dont notice the debuffs. These sounds arent working anymore. I take the code and switch in the buff name haste in place of the debuff name and the sound plays properly (so the code should work). So before i continue to try and get it to work (already spent a few days), did someone disable the ability to do things when gaining a debuff only and specifically? so far any debuff from charm to sleep to hp max down doesnt give me a sound. But for buffs (like sneak attack) that i want to trigger a variable for, or like Reive Mark, it can still put on adoulin's refuge +1 and lock the neck piece when gained and unlock when lost. I dont know what im doing wrong so i just thought id check.
Code:function buff_change(buff,gain) -- DOES NOT WORK BELOW if buff == 'Charm' and gain then send_command('chatmon play c:/chatmon/charm.wav') end if buff == 'Doom' and gain then send_command('chatmon play c:/chatmon/doom.wav') end if buff == 'Sleep' and gain then send_command('chatmon play c:/chatmon/sleep.wav') end if buff == 'Petrification' and gain then send_command('chatmon play c:/chatmon/petrify.wav') end if buff == 'Paralysis' and gain then send_command('chatmon play c:/chatmon/paralyze.wav') end if ( buff == 'Silence' or buff == 'Mute' ) and gain then send_command('chatmon play c:/chatmon/silence.wav') end if ( buff == 'Stun' or buff == 'Terror' ) and gain then send_command('chatmon play c:/chatmon/stun.wav') end if buff == 'Amnesia' and gain then send_command('chatmon play c:/chatmon/amnesia.wav') end if buff == 'Encumbrance' and gain then send_command('chatmon play c:/chatmon/encumbrance.wav') end -- WORKS BELOW if buff == 'Haste' and gain then send_command('chatmon play c:/chatmon/charm.wav') end if buff == 'Dedication' and not gain then send_command('chatmon play c:/chatmon/commitment.wav') end if buff == 'Commitment' and not gain then send_command('chatmon play c:/chatmon/commitment.wav') end if buff == "Divine Emblem" and not gain then emblem = 1 end if buff == "Protect" and not gain then protect = false end if buff == 'Reive Mark' then if gain then equip(sets.reive) send_command('gs disable neck') send_command('timers d "Reive Mark"') else send_command('gs enable neck') send_command('timers c "Reive Mark" 300 down') end end end
Use `spell` (or whatever you name the first argument to precast) instead of `action`
Do the files you are trying to play exist?
Yeah they exist. Like I said I can copy and paste the code from a debuff and simply replace the name of the debuff "sleep" or whatever with "haste" and it will trigger anytime I get haste. So it feels like something debuff specific.
Working on a THF gearswap for myself, and it broke after messing with it for awhile. Long story short, I undid every change back to the functional state it had been before I started.
Yet I keep getting:
GearSwap: Lua runtime error: GearSwap/refresh.lua.174: GearSwap: File failed to load:
... Files <my lua directory path>/THF.lua: 1377: attempt to index global 'spell' (a nil value)
EDIT: Just in case, here is a temp paste of the lua.
This THF Lua is just a copy paste and edit of my DRG Lua. Which is a copy paste of my RUN. Which is a copy paste of my BLU.
When I get on those 3 jobs I don't get the error, which only suddenly popped up and remains despite, as far as I know, undoing any changes. When I get on THF I get that error. I keep going over a side by side view of the THF Lua with my BLU and DRG and the difference hasn't jumped out at me.
All of those are in my Pastebin.
Just delete the function "mc_JA" on line 1376 and line 1474 since it does nothing. Or change it from this:
mc_JA(spell, act)
to this:
mc_JA(act)
The files do exist, and it works with pretty much any buff name in place of the debuff. any luck or chance you might be able to look at the gearswap code if there is something preventing debuffs from triggering things in the buff_change function? it also doesnt allow for things like using opo opo necklace for sleep, gear that enhances cursna effects (one might wear while doomed for example) and other gear that does things with certain debuffs, assuming people did these things.
But also i wanted to mention the black mage ability "Cascade" seems to be missing from the resources file for ability_recasts, maybe some other file as well. i googled "cascade ability_recast" and the first result was someone reporting it on the github for windower on Mar 17, 2019. so its been forgotten or something.
With a superficial glance, I don't see how the error is possible. It is nominally throwing the error for mc_JA, which contains no indexing. Also, even if it was indexing in there it should be indexing the local variable spell, not the global variable spell. Given that, the only options are that either the line number in your paste / on your computer don't correspond or that the function definition itself is being interpreted as referencing the global variable.
I'm guessing that there are some scoping problems. The only weird things I see in the paste are the:
statements.Code:do return end
Could you please change them to
and see if it fixes it?Code:return
Do blocks in Lua are not something I use frequently and while there shouldn't *really* be a problem with that code as I understand it, I'm also not entirely sure about it.