So I'm guessing here:
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 ~= "status" then
return
end
-- require "tprint"
-- tprint (t)
local background_colour = ColourNameToRGB "lightgreen"
if t.dead then
background_colour = ColourNameToRGB "mistyrose"
elseif t.combat then
background_colour = ColourNameToRGB "rosybrown"
end -- if
-- fill entire box to clear it
WindowRectOp (win, 2, 0, 0, 0, 0, background_colour) -- fill entire box
-- a green inside border indicates you are poisoned
if t.poisoned then
WindowCircleOp(win, 2, -- draw rectangle
0, 0, 0, 0, -- entire window
ColourNameToRGB "olivedrab", 6, 4, -- pen, inside border, width 4
0, 1) -- no brush
end -- if
-- Edge around box rectangle
WindowCircleOp (win, 3, 0, 0, 0, 0, ColourNameToRGB "darkgray", 0, 2, 0, 1)
-- stats don't really matter if you are dead
if t.dead then
local dead_message = "<You are dead>"
local width = WindowTextWidth (win, FONT_ID, dead_message)
local left = (WINDOW_WIDTH - width) / 2
local top = (window_height - font_height) / 2
WindowText (win, FONT_ID, dead_message, left, top, 0, 0, ColourNameToRGB "darkred")
else
vertical = 6 -- pixel to start at
DoGauge ("HP: ", t.hp, t.maxhp, ColourNameToRGB "darkgreen")
DoGauge ("Mana: ", t.mana, t.maxmana, ColourNameToRGB "mediumblue")
DoGauge ("Move: ", t.move, t.maxmove, ColourNameToRGB "gold")
end -- if
Is where we are getting OUR hp/mana/move. How do I get t.hp to show the victim.hp?
After going over your posts again in the other topic I figure I don't change much in code since it has the show_status finding who the victim is, just need to figure out how to get the hp=%d for victim rather then my char.
I'll continue to look into this, any help or direction would be great. |