Variables Data in Profile save file located and read after Lua code that may use them is compiled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mudlet |
Opinion
|
Undecided
|
Unassigned |
Bug Description
The <VariablePackag
However in simple experimenting which attempted to save and thus load the variables BEFORE the other elements of a Mudlet profile - which will be the method to correct this - I encountered an odd error which I could not determine the cause of. In that situation, installed packages would fail to show up in the Editor. The package manager confirmed the presence of the packages but they never seemed to be loaded from the save file, even though a manual inspection showed them present in the file. Note that this refers to packages, in both a single/group of one type of aliases and scripts and presumably (but not checked) buttons/menu/items, keys, timers or triggers, NOT modules.
Although the presentation is very like https:/
Note that after a profile has been loaded once, variables and compiled functions persist in the Lua system I think; so if a profile is reloaded there is likely to be wanted variables/functions still/already in the system and thus the odd effects and problems are only likely to show up during session start-up.
description: | updated |
There is a related issue, "Scripts" ought to be read/parsed BEFORE other elements that might refer to them, e.g. Aliases/ Actions/ Keys/Triggers and Timers can all use functions/variables defined in a script so scripts should be loaded AFTER Variables but before these others...
For example the built-in Alias "delete old profiles" makes use of the "deleteOldProfi les(keepdays_ arg, delete_maps)" defined in the Script "deleteOldProfiles script" it may be that for *compilation* the parser does not go looking for Lua elements that look like functions that are not "built-in" {I am not a Lua Wizard!} but if it does than I'd expect issues if a "forward reference" to a function that has not yet been defined - OTOH I may have got completely the wrong idea about this...