GSE: Sequences, Variables, Macros

GSE: Sequences, Variables, Macros

6M Downloads

[BUG] Lua Error while saving, when Repeat is left empty for Loop

Opened this issue ยท 0 comments

commented

Describe the bug
Saving a macro causes a Lua Error, when Repeat is left empty for a Loop.

To Reproduce
Steps to reproduce the behavior:

  1. Type '/gse' in Chat Frame
  2. Click on 'New'
  3. Click on '1'
  4. Add loop
  5. Remove 2 from Repeat
  6. Click on 'Save"
  7. Lua Error
  8. Macro is still saved
  9. Can't edit or create new macros
  10. Deleting the macro and reloading UI resolves issue

Expected behavior
Prohibit leaving Repeat empty for a Loop when saving a macro.

Desktop (please complete the following information):

  • OS: Windows 10 (19043)
  • Game Version: 9.1.0 (39262)

GSE Version

  • Version: 3.0.11
  • Downloaded From: Ajour (Curse)

Additional context

{
    ["Variables"] = {
        
    },
    ["Actions"] = {
        [1] = {
            [1] = "/say Hello",
            ["Type"] = "Action"
        },
        [2] = {
            [1] = {
                [1] = "/say Hello",
                ["Type"] = "Action"
            },
            ["Type"] = "Loop",
            ["Repeat"] = "",
            ["StepFunction"] = "Sequential"
        }
    },
    ["InbuiltVariables"] = {
        
    }
}

Message: Interface\AddOns\GSE\API\Storage.lua:1315: 'for' limit must be a number
Time: Fri Jul 2 11:08:19 2021
Count: 1
Stack: Interface\AddOns\GSE\API\Storage.lua:1315: 'for' limit must be a number
[string "@interface\AddOns\GSE\API\Storage.lua"]:1315: in function <Interface\AddOns\GSE\API\Storage.lua:1297>
[string "=(tail call)"]: ?
[string "@interface\AddOns\GSE\API\Storage.lua"]:1427: in function CompileTemplate' [string "@Interface\AddOns\GSE\API\Storage.lua"]:512: in function OOCUpdateSequence'
[string "@interface\AddOns\GSE\API\Events.lua"]:439: in function `?'
[string "@interface\AddOns\Details\Libs\AceTimer-3.0\AceTimer-3.0.lua"]:55: in function <...ce\AddOns\Details\Libs\AceTimer-3.0\AceTimer-3.0.lua:50>

Locals: action =

{
1 =
{
}
Type = "Loop"
Repeat = ""
StepFunction = "Sequential"
}
metaData =
{
}
actionList =
{
1 = "/say Hello"
}
returnActions =
{
}
loop = nil
(for index) = 1
(for limit) = nil
(for step) = 1
(*temporary) = 1
(*temporary) = 2
(*temporary) = nil
(*temporary) = "/say Hello"
(*temporary) =
{
1 = "/say Hello"
Type = "Action"
}
(*temporary) = "
"
(*temporary) = "/say Hello"
(*temporary) = nil
(*temporary) = 1
(*temporary) = 2
(*temporary) = nil
(*temporary) = "'for' limit must be a number"
Statics =
{
StringFormatEscapes =
{
}
Patrons =
{
}
CastCmds =
{
}
TranslationShadow = "SHADOW"
CommPrefix = "GSE"
Priority = "Priority"
TranslationHash = "HASH"
SpecIDClassList =
{
}
CoreLoadedMessage = "GS-CoreLoaded"
MacroResetSkeleton = "if %s then
self:SetAttribute('step', 1)
self:SetAttribute('loopiter', 1)
end
"
SpecIDHashList =
{
}
StringReset = ""
CleanStrings =
{
}
Class = "Class"
ReloadMessage = "Reload"
DebugModules =
{
}
SourceLocal = "Local"
TranslationKey = "KEY"
Sequential = "Sequential"
Actions =
{
}
TranslatorMode =
{
}
GSE3OnClick = "local step = self:GetAttribute('step')
step = tonumber(step)
self:SetAttribute('macrotext', macros[step] )
step = step % #macros + 1
if not step or not macros[step] then -- User attempted to write a step method that doesn't work, reset to 1
print('Invalid step assigned by custom step sequence', self:GetName(), step or 'nil', '')
step = 1
end
self:SetAttribute('step', step)
self:CallMethod('UpdateIcon')
"
ActionsIcons =
{
}
Global = "Global"
BaseSpellTable =
{
}
QuestionMark = "INV_MISC_QUESTIONMARK"
Spec = "Spec"
SystemVariableDescriptions =
{
}
MacroCommands =
{
}
TableMetadataFunction =
{
}
All = "All"
PrintKeyModifiers = "print("Right alt key " .. tostring(IsRightAltKeyDown()))
print("Left alt key " .. tostring(IsLeftAltKeyDown()))
print("Any alt key " .. tostring(IsAltKeyDown()))
print("Right ctrl key " .. tostring(IsRightControlKeyDown()))
print("Left ctrl key " .. tostring(IsLeftControlKeyDown()))
print("Any ctrl key " .. tostring(IsControlKeyDown()))
print("Right shft key " .. tostring(IsRightShiftKeyDown()))
print("Left shft key " .. tostring(IsLeftShiftKeyDown()))
print("Any shft key " .. tostring(IsShiftKeyDown()))
print("Any mod key " .. tostring(IsModifierKeyDown()))
print("GetMouseButtonClicked() " .. GetMouseButtonClicked() )
"
SampleMacros =
{
}
SourceTransmission = "Transmission"
SequenceDebug = "SEQUENCEDEBUG"
SpecIDList =
{
}
SystemVariables =
{
}
}
buildAction = defined @interface\AddOns\GSE\API\Storage.lua:1229
GSE =
{
ResetButtons = defined @interface\AddOns\GSE\API\Storage.lua:473
StartOOCTimer = defined @interface\AddOns\GSE\API\Events.lua:425
ReportTargetProtection = defined @interface\AddOns\GSE\API\Options.lua:876
RequestSequence = defined @interface\AddOns\GSE\API\Serialisation.lua:306
CloneSequence = defined @interface\AddOns\GSE\API\Storage.lua:38
modules =
{
}
CancelTimer = defin