GSE: Sequences, Variables, Macros

GSE: Sequences, Variables, Macros

7M Downloads

[BUG] Unable to Edit/Delete/Save a variable with lua error

dennisaschmidt opened this issue Β· 5 comments

commented

πŸ”΅ Describe the bug:
If your lua code in a variable has an error in it, the delete/save buttons are not available. This makes the variable perpetually in an error state and uneditable, unremovable, and GSE now in constant error.

πŸ”΅ To reproduce: (Steps to reproduce the behavior)

  1. Go to Variables
  2. Add any variable, and insert lua code and put a simple syntax error in it, save it

For example:
function()
local SpellBookSlot = C_SpellBook.FindSpellBookSlotForSpell(432459)
return SpellBookSlot > 0
end
The example code on this wiki for finding if a spell is known I think is old and produces an error (FindSpellBookSlotForSpell may return nil and can't compare to 0)

πŸ”΅ The error:
Paste the error message in this blockquote.

24x [string "return function(spellID)..."]:3: attempt to compare number with nil
[string "return function(spellID)
    local SpellBookSlot = C_SpellBook.FindSpellBookSlotForSpell(432459)
    return SpellBookSlot > 0
end"]:3: in function `?'
[string "@GSE/API/Storage.lua"]:1138: in function `UpdateVariable'
[string "@GSE/API/Events.lua"]:653: in function `?'
[string "@Decursive/Libs/AceTimer-3.0-17/AceTimer-3.0.lua"]:55: in function <Decursive/Libs/AceTimer-3.0/AceTimer-3.0.lua:50>

πŸ”΅ Screenshots:
See screenshot with no save/delete buttons

πŸ”΅ Expected behavior:
Regardless of the validity of the lua for a variable code, it shouldn't remove the buttons and shouldn't to make corrective action. Effectively now, you better get your lua code correct the first time, or the bad code is stuck in there forever.

πŸ”΅ GSE.lua file:
Don't think this is needed? Problem is with variables and not a specific sequence.

πŸ”΅ Desktop (please complete the following information):

  • OS: Windows 10 Home
  • Game Version 11.0.5

πŸ”΅ GSE Version:

  • Version: 3.2.17
  • Downloaded From: Curse

πŸ”΅ Additional context:
GSE No Variable Buttons

commented

I will add, the contagion of a bad lua variable will spread to any sequences that utilize that variable and the sequence will be uneditable also.

commented

This isn’t a bug. It prevents you from bricking your GSE install by not letting you save a broken variable.

if you go to the minimap icon you need to remove the Updatw Variable lines from the Out of Combat Queue by clicking on them. Once you do and correct the variable you will be able to save.

commented

This particular example was also updated yesterday but I hadn’t updated the Wiki to reflect it. You can import it from https://wago.io/IHWwUk5_t

Blizzard changed C_SpellBook.FindSpellBookSlotForSpell( to report a nil instead of a 0 when a spell isn’t known.

commented

I have updated the Wiki and also put in a check that the variable compiles before attempting to save it.

commented

This is available as part of the alpha GSE-3.2.17-1-g6980164 or later

It will be released as part of Tuesdays GSE-3.2.18