roomexits = nil
for i,v in pairs(gmcp.Room.Info.exits) do
if not roomexits then
roomexits = string.upper(i)
else
roomexits = roomexits..","..string.upper(i)
end
end
roomexits = roomexits or "TRAPPED!"
roomlabel: setFgColor("red")
roomlabel:echo("Exits - <br>" ..roomexits, nil, "c")
roomLabel.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ADADAD, stop: 1 #9E9E9E);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;
]])
roomLabel.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #575757 stop: 1 #454545);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;
]])
end
roomlabel = Geyser.Label:new({name="Room Exits",x=1200, y=410,width=150, height=30,})
roomlabel : setFgColor("red")
registerAnonymousEventHandler("gmcp.Room.Info", "GetRoomExits")
Comments
Which client is it about? Which script language?
Looks like Mudlet/lua.
When you try to apply your stylesheet, you access roomLabel while you create roomlabel. Also labels only have setStyleSheet but no back or front members.
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
^ this.
Also
[spoiler] function GetRoomExits()
roomexits = nil
for i,v in pairs(gmcp.Room.Info.exits) do
if not roomexits then
roomexits = string.upper(i)
else
roomexits = roomexits..","..string.upper(i)
end [/spoiler]
That code can simply be shortened to:
roomexits = table.concat(gmcp.Room.Info.exits, ", ")
roomexits = string.upper(roomexits) (if you want it capitalised)