This is supposed to be a list of skill groups that the script does NOT pass to the SendGMCP function since these groups don't have any abilities. They are all passive.
Jonathan, you should recognize SendGMCP..you wrote it lol
function OnPluginTelnetSubnegotiation (opt, data)
if opt ~= 201 then
return
end
local msg, content = unpack(utils.split(data, " ", 1))
print (msg, content)
if not content or content:len() == 0 then
_G[msg:gsub("%.", "")]()
else
_G[msg:gsub("%.", "")](content)
end
end
function SendGMCP(message, content)
if type(message) ~= "string" then
return nil, "Message name must be a string."
end
if content ~= nil then
content = json.encode({content})
if content == nil then
return nil, "Invalid input."
end
message = ("%s %s"):format(message, content:sub(2, #content-1))
end
SendPkt(SB_GMCP:format(message))
return true
end
function CharSkillsGroups (content)
local EXCLUDED_GROUPS = {
"Antidotes",
"Avoidance",
"Constitution",
"Fitness",
"Frost",
"Galvanism",
"Philosophy",
"Thermology",
}
for k,v in ipairs (JSON.decode("[" .. content .. "]")[1]) do
system[system.char] = {
skills = {
[v.name] = {
rank = v.rank,
},
},
}
if not EXCLUDED_GROUPS [v.name] then
system[system.char]["skills"][v.name]["abilities"] = {}
local GROUP = {group = v.name}
SendGMCP ("Char.Skills.Get ", GROUP)
end
end
end
Run-time error
Plugin: The_System (called from world: Achaea)
Function/Sub: OnPluginTelnetSubnegotiation called by Plugin The_System
Reason: Executing plugin The_System sub OnPluginTelnetSubnegotiation
[string "Plugin"]:223: attempt to call local 'EXCLUDED_GROUPS' (a table value)
stack traceback:
[string "Plugin"]:223: in function '?'
[string "Plugin"]:560: in function <[string "Plugin"]:548>
Error context in script:
219 : },
220 :
221 : }
222 :
223*: if not EXCLUDED_GROUPS {v.name} then
224 :
225 : system[system.char]["skills"][v.name]["abilities"] = {}
226 :
227 : local GROUP = {group = v.name}
See my problem?
EDIT: Wow if that wasn't a rookie mistake. See if the top half works now
..also, while I'm on the subject. I don't remember having to do anything special to get the contents of the items field last time I used print to see the Char.Items.List data. All I'm getting now is..
Char.Items.List { "location": "inv", "items": [ ] }
using this
function CharItemsList (content)
print ("CharItemsList ", content)
end
EDIT: I think it was because I had Twisol's GMCP plugin running at the same time. Lemme check.
..I'll find out as soon as I stop getting Runtime errors in my plugin -sigh-
"x" variable does not exist because you are a retard and have not declared it yet LOL |