I have some code that deletes the ingame exit line and replaces it with one that I can more easily read as things are happening. The base code works, but what I want to do now is have it that when I hover over each exit, it will show me the room name and the area of the room. It is overall imperfect right now, but does what I need it to for now. For the hover text, I've been attempting to use echoLink, but have run into multiple issues. I have the new exit look as such:
Exits: ne(1970) in(6834) se(1971) d(1964) sw(1972) nw(1973) n(1969)
with a lot of fiddling with echoLink, the best I get is this, with the hover part working as intended:
Exits: <DarkTurquoise>ne<SpringGreen>(<red>1970<SpringGreen>)
with it then erroring after any following exits.
Base code that works:
deleteLine()
local exits = gmcp.Room.Info.exits
local exit = ""
for e,n in pairs(exits) do
exit = exit .. string.format("<DarkTurquoise>%s<SpringGreen>(<red>%d<SpringGreen>) ", e, n)
end
cecho(string.format("\n<CadetBlue>Exits: %s", exit))
current form of testing code that doesn't work:
function showExits()
local exits = gmcp.Room.Info.exits
local exit = ""
cecho(string.format("\n<CadetBlue>Exits: "))
for e,n in pairs(exits) do
echoLink(cecho(string.format("<DarkTurquoise>%s<SpringGreen>(<red>%d<SpringGreen>) ", e, n), [[send(]].. e .. [[)]], string.format("%s - %s", getRoomName(n), mmp.areatabler[getRoomArea(n)]), false))
end
end
Various errors I've gotten:
[ERROR:] object:<run lua code> function:<Alias6>
<mudlet-lua/lua/GUIUtils.lua:812: bad argument #1 to 'split' (string, table or userdata
expected, got nil)>
[ERROR:] object:<run lua code> function:<Alias6>
<mudlet-lua/lua/GUIUtils.lua:812: bad argument #1 to 'split' (string, table or userdata
expected, got nil)>
[ERROR:] object:<run lua code> function:<Alias6>
<echoLink: wrong argument type>
[ERROR:] object:<run lua code> function:<Alias6>
<echoLink: wrong argument type>