So here is my plugin:
function OnPluginTelnetOption (option)
local t = {} -- incoming server variables will go into table t
setfenv (assert (loadstring (option)), t) () -- compile and load into t
if t.tt ~= "Tel_Group" then
return
end
require "tprint"
tprint (t)
local background_colour = ColourNameToRGB "clear"
-- fill entire box to clear it
WindowRectOp (win, 2, 0, 0, 0, 0, background_colour) -- fill entire box
-- Edge around box rectangle
WindowCircleOp (win, 3, 0, 0, 0, 0, ColourNameToRGB "clear", 0, 2, 0, 1)
--
if t.GroupNum == 1 then
--DoGauge ("HP: ", t.hp, t.maxhp, ColourNameToRGB "darkred")
WindowText (win, FONT_ID_2, string.format ("%s", t.name), 125, 0, 0, 0, ColourNameToRGB "white")
WindowText (win, FONT_ID_2, string.format ("%7i/%7i", t.hp, t.maxhp), 125, 11, 0, 0, ColourNameToRGB "white")
WindowShow (win, true)
else
WindowShow (win, false)
end --if
if t.GroupNum == 2 then
--DoGauge ("HP: ", t.hp, t.maxhp, ColourNameToRGB "darkred")
WindowText (win, FONT_ID_2, string.format ("%s", t.name), 125, 0, 0, 0, ColourNameToRGB "white")
WindowText (win, FONT_ID_2, string.format ("%7i/%7i", t.hp, t.maxhp), 125, 11, 0, 0, ColourNameToRGB "white")
WindowShow (win, true)
else
WindowShow (win, false)
end --if
--
end -- function OnPluginTelnetOption
It's only showing my characters stats rather then my second person in group.
Here's what is being sent:
"maxmove"=1120
"chname"="Bob"
"name"="Joe"
"move"=1120
"GroupNum"=1
"maxhp"=1337
"hp"=1337
"tt"="Tel_Group"
"maxmove"=1040
"chname"="Bob"
"name"="Bob"
"move"=1040
"GroupNum"=2
"maxhp"=2406
"hp"=2406
"tt"="Tel_Group"
And only Bob's stats are showing. It looks like it's completely bypassing the first if statement and going straight for GroupNum 2.
Any thoughts? |