The next problem. I'm not getting everything in the miniwindow.
Here's the output while using the script.
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area> look
Before the Great Q Temple
Before you stands the mighty hall of the Q clan. I certainly hope you
are supposed to be here, because the rumours say that intruders are not
treated kindly inside the compound. As you gaze upon the mighty structure,
your mind is warped and twisted in such strange ways... How the HELL does
this thing stand without toppling over?! Chances are, your mind will never
be free enough to be able to comprehend the answer.
[Exits: north down]
(Drunk) A drunken funny man is here, telling jokes.
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area> wholist
[IMP Djinn Mag ] [Discordia-GoS] Commander Astark Caldazar
[GOD Dryad Asn k] [Q-een] [AFK] * Lady Engel Shadowwalker
[ 92 Mantis Gla ] [Q-ool] Dozer.
[ 91 Orc Asn K] [Q-ool] Prince Dracmas <<Stalkingwolf>>
[ 15 Gholam Asn k] [Discordia-FoD] Zion I
Players found: 5
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area>
I type wholist, which is echoed on the end of the prompt. before the who list starts. The problem is that I'm not seeing everyone on the list. I sometimes miss 2 people in the plugin if I use a trigger to catch people logging on and send to:execute wholist.
Using the Alias. The first name that shows up on the wholist miniwindow is Lady Engel. She disappears from the list when executing "wholist alias" from another trigger.
Here's the Alias:
<aliases>
<alias
match="wholist"
enabled="y"
send_to="12"
sequence="100"
>
<send>require "wait"
wait.make (function () -- coroutine starts here
local win = GetPluginID () .. ":who"
local font = "f"
if not WindowInfo (win, 1) then
WindowCreate (win, 0, 0, 0, 0, 6, 0, 0)
WindowFont (win, font, "Lucida Console", 9)
end -- if
-- request who list
Execute "who"
-- waiting to recieve who list
local x = wait.match ("[*", 10)
if not x then
ColourNote ("white","blue","No who list recieved within 10 seconds")
return
end -- if statement
local whol = {} -- whol is who list as a table
local max_width = WindowTextWidth (win, font, "WhoList")
-- loop until end of who list
while true do
local line, wildcards, styles = wait.match ("*")
-- see if end of who list
if not string.match (line, "^%[") then
break
end -- if
-- save who list
table.insert (whol, styles)
--work out max width
max_width = math.max (max_width, WindowTextWidth (win, font, line))
end -- while loop
local font_height = WindowFontInfo (win, font, 1)
local window_width = max_width + 10
local window_height = font_height * (#whol + 2) + 10
-- make window correct size
WindowCreate (win, 0, 0, window_width, window_height, 6, 0, ColourNameToRGB "#g373737")
WindowRectOp (win, 5, 0, 0, 0, 0, 5, 15 + 0x1000)
-- heading line
WindowText (win, font, "WhoList", 5, 5, 0, 0, ColourNameToRGB "yellow")
-- draw each who line
local y = font_height * 2 + 5
for i, styles in ipairs (whol) do
local x = 5
for _, style in ipairs (styles) do
x = x + WindowText (win, font, style.text, x, y, 0, 0, style.textcolour)
end -- for
y = y + font_height
end -- for each person in who
WindowShow (win, true)
end) -- end of coroutine</send>
</alias>
</aliases>
Edit: the trigger calling the alias where another name disappears off the miniwindow, being two players not showing instead of one is here:
<triggers>
<trigger
enabled="y"
group="IM"
match="[INFO]: * has decided to join us."
send_to="10"
sequence="100"
sound="C:\Program Files (x86)\MUSHclient\sounds\Buddy In.mp3"
>
<send>wholist</send>
</trigger>
</triggers>
I dont know if the who list right on the next line is causing it to miss the top player on here.
In the trigger that calls the alias when someone logs in, my command echo ends up on the info line, so my who list I need captureing, the first name ends up starting on the end of the prompt, then the 2nd name isnt shown.
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area>
You disappear into the void.look
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Limbo> Before the Great Q Temple
Before you stands the mighty hall of the Q clan. I certainly hope you
are supposed to be here, because the rumours say that intruders are not
treated kindly inside the compound. As you gaze upon the mighty structure,
your mind is warped and twisted in such strange ways... How the HELL does
this thing stand without toppling over?! Chances are, your mind will never
be free enough to be able to comprehend the answer.
[Exits: north down]
(Drunk) A drunken funny man is here, telling jokes.
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area>
[INFO]: Sasuke has decided to join us.who
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area> [IMP Djinn Mag ] [Discordia-GoS] Commander Astark Caldazar
[GOD Dryad Asn k] [Q-een] [AFK] * Lady Engel Shadowwalker
[ 97 Djinn Ran ] [Q-ool] Rojas
[ 92 Cyclop Gla K] [Q-ool] Sasuke the Gladiator Hero
[ 91 Orc Asn K] [Q-ool] Prince Dracmas <<Stalkingwolf>>
[ 15 Gholam Asn k] [Discordia-FoD] Zion I
Players found: 6
<4465/4465hp 1083/1083mn 2063/2063mv 359etl Q Clan Area>
|