Hello to all. It has been a while since i came here.
I have a problem that i can't figure out. I have the mini-window public chatter plugin from Nick. It says that when a hyperlink come from a tell or some other thing, that you can click on the miniwindow and the link will follow to your web browser. That i can't do.
And besides, i use the Hyperlink plugin, and now, when someone sends me a link on a public chat, it appears duplicated.
Can anyone follow me to the part where the miniwindow is messing with the Hyperlink in order to fix it?
Hello Nick, again you are absolutely right, but i could swear i saw something like that. I've read so many posts yesterday, i should have confused myself.
Further, my problem still resides. When i have the mini window plugin installed, it duplicates the hyperlink, if i shut it down, no problem. Can you see why it is duplicated? Could be cause of the channel used? The Hyperlink plugin strips only the http://www.google.com thing, and the chat window, copies the all sentence, like:
Person A tells you 'http://www.google.com'
I've tried to omit from output, but like that, all the tells and other channels on the miniwindow are omitted.
There have been so many rather long threads on chat capture windows, I have no idea where you might have read about hyperlinks. But I do know that the Aardwolf version that I make both has that feature and also works fine with the Hyperlink2 plugin. Are you coming from Aardwolf?
Hi. I know that there where so many threads about this and perhaps i must be confused. I know that yours have Hyperlink, but unfortunately i don't play Aardwolf, it's for another MUD.
Months ago i started making the miniwindows, and you and Nick helped alot, i have everything working since March i think :).
I used Nick's chat window cause it is for a generic MUD, that's my case, but the only problem is that one, if i send this:
You tell Slash the Pony 'http://www.google.com'
The output on the MUD is:
You tell Slash the Pony 'http://www.google.com'
You tell Slash the Pony 'http://www.google.com'
The first one is the link, i can click on it and everything is fine, the second one is the one for the mini window. I can't figure why it sends 2.
It's the only thing that's happening, cause if the tells are simple, without links, only one appears.
Both plugins are using tell/note instead of simulate to print to the main window, and tell/note don't play well with a subsequent omit.
I make my chat echo script halt future trigger processing on the captured line and then echo in main output with simulate instead of tell/note so that later scripts can then do things on the echoed version instead of on the original one.
Thank you for your answer. So, if i understand correctly, there is no chance on changing something inside one or both of the plugins in order to make them work.
So i will have to live with that, there is no big deal, it was just to make things work correctly.
IMO, the easy solution is to stop further trigger processing and then call Simulate instead of ColourTell.
Quote: Thank you for your answer. So, if i understand correctly, there is no chance on changing something inside one or both of the plugins in order to make them work.
No, the changes are actually pretty simple. Nick just doesn't like to suggest that anyone use Simulate because he feels like it's not tested enough. I think it works great, though. Thousands of people have used it on Aardwolf for years now without complaint.
Hi. The changes that you are sugesting, i made them on the Hyperlink plugin? And where?
I'm sorry to be asking this, but i never made anything like it. I learned alot with the forum and with all of you, but i can't do this alone.
In each of your triggers that omits from output, for example
<trigger
enabled="y"
match="You say '*'"
script="chats"
omit_from_output="y"
sequence="100"
></trigger>
Change it to, for example
<trigger
enabled="y"
match="You say '*'"
script="chats"
omit_from_output="y"
sequence="100"
send_to="12"
><send>StopEvaluatingTriggers(true)</send></trigger>
Then change all ColourTell/ColourNote to use Simulate instead.
Instead of:
for _, v in ipairs(styles) do
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), v.text)
end -- for each style run
Note ("") -- wrap up line
We use:
Simulate(stylesToANSI(styles).."\r\n")
That part (the stylesToANSI function) unfortunately does not have built in support, because there is no MUSHclient function that properly converts from style runs to ansi. So I make my own. (The above part would be extra trivial if this next part were just built into MUSHclient. hint hint!)
function init_ansi()
ANSI_colours = {
[GetNormalColour (BLACK)] = ANSI(0,30),
[GetNormalColour (RED)] = ANSI(0,31),
[GetNormalColour (GREEN)] = ANSI(0,32),
[GetNormalColour (YELLOW)] = ANSI(0,33),
[GetNormalColour (BLUE)] = ANSI(0,34),
[GetNormalColour (MAGENTA)] = ANSI(0,35),
[GetNormalColour (CYAN)] = ANSI(0,36),
[GetNormalColour (WHITE)] = ANSI(0,37),
[GetBoldColour (BLACK)] = ANSI(1,30),
[GetBoldColour (RED)] = ANSI(1,31),
[GetBoldColour (GREEN)] = ANSI(1,32),
[GetBoldColour (YELLOW)] = ANSI(1,33),
[GetBoldColour (BLUE)] = ANSI(1,34),
[GetBoldColour (MAGENTA)] = ANSI(1,35),
[GetBoldColour (CYAN)] = ANSI(1,36),
[GetBoldColour (WHITE)] = ANSI(1,37)
} -- end conversion table
end
init_ansi()
-- also provide the reverse of the extended_colours global table
colours_extended = {}
for i,v in ipairs(extended_colours) do
colours_extended[v] = i
end
-- Returns a string with embedded ansi codes.
-- This can get confused if the player has redefined their color chart.
function stylesToANSI (styles)
local line = {}
local reinit = true
for _,v in ipairs (styles) do
if ANSI_colours[v.textcolour] then
table.insert(line, ANSI_colours[v.textcolour])
elseif colours_extended[v.textcolour] then -- use 256 color xterm ansi when necessary
table.insert(line, ANSI(38,5,colours_extended[v.textcolour]))
elseif reinit then -- limit performance damage
reinit = false
init_ansi()
end
table.insert(line, v.text)
end
table.insert(line, ANSI(0))
return table.concat(line)
end
Another problem. The buffer got filled, i lost count how many lines it was there, and the errors where these:
Run-time error
Plugin: Chat_Capture_Miniwindow (called from world: Legends of Krynn)
Function/Sub: chats called by trigger
Reason: processing trigger "" when matching line: "You tell Slash the Pony 'http://www.google.com'"
[string "Plugin"]:624: C stack overflow
stack traceback:
[string "Plugin"]:624: in function 'stylesToANSI'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
...
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
[C]: in function 'Simulate'
[string "Plugin"]:423: in function <[string "Plugin"]:419>
Error context in script:
620 : -- This can get confused if the player has redefined their color chart.
621 : function stylesToANSI (styles)
622 : local line = {}
623 : local reinit = true
624*: for _,v in ipairs (styles) do
625 : if ANSI_colours[v.textcolour] then
626 : table.insert(line, ANSI_colours[v.textcolour])
627 : elseif colours_extended[v.textcolour] then -- use 256 color xterm ansi when necessary
628 : table.insert(line, ANSI(38,5,colours_extended[v.textcolour]))
Nick, thank you. I checked on the World Properties and the colours where not default. I didn't knew that this was changed. I changed that to Default values.
On the first attempt to send a tell with an hyperlink, it gives me the same error. But if i typed again the tell, there is no more error.
Why only on the first try it gives those enormous error?
I'm pretty sure I tested this with changed colors (that's why it reinits the color table on missing value in the first place.) It definitely shouldn't be causing a stack overflow! Nick, thoughts?
It keeps that way, and now not even the second tell goes through.
I would try change yours, but i guess the changes are so many, and so many files to see and try to adapt.
No, I think you'd never be able to go and customize my current Aardwolf version now. Too many specific details.
Can you show me what your plugin currently looks like? I don't see any reason why stylesToANSI would cause a stack overflow, and that run of Simulates in your error message is sketchy.
-- doing it this way makes them default to true the first time around
timestamp = not (GetVariable("timestamp") == "false")
echo = not (GetVariable("echo") == "false")
theme = {
WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
WINDOW_BORDER = ColourNameToRGB("#E8E8E8"), -- for miniwindow body
HIGHLIGHT=ColourNameToRGB("#FFFFFF"), -- for 3D surfaces
FACE=ColourNameToRGB("#D4D0C8"), -- for 3D surfaces
INNERSHADOW=ColourNameToRGB("#808080"), -- for 3D surfaces
OUTERSHADOW = ColourNameToRGB("#404040"), -- for 3D surfaces
BACK_FACE = ColourNameToRGB ("#E8E8E8"), -- for contrasting details
DETAIL = ColourNameToRGB ("#000000"), -- for contrasting details
TITLE_HEIGHT = 17, -- for miniwindow title area
SUBTITLE_HEIGHT = 17, -- for miniwindow title area
TITLE_FONT_NAME = "Dina", -- for miniwindow title area
TITLE_FONT_SIZE = 8 -- for miniwindow title area
} -- end theme table
-- replacement for WindowRectOp action 5, which allows for a 3D look while maintaining color theme
-- Requires global theme.HIGHLIGHT, theme.FACE, theme.INNERSHADOW, and theme.OUTERSHADOW rgb colors to be set.
function DrawThemed3DRect(Window, left, top, right, bottom)
WindowRectOp(Window, miniwin.rect_fill, left, top, right, bottom, theme.FACE)
WindowLine(Window, left, top, right, top, theme.HIGHLIGHT,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
WindowLine(Window, left, top, left, bottom, theme.HIGHLIGHT,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
WindowLine(Window, left, bottom-2, right, bottom-2, theme.INNERSHADOW,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
WindowLine(Window, right-2, top, right-2, bottom-2, theme.INNERSHADOW,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
WindowLine(Window, left, bottom-1, right, bottom-1, theme.OUTERSHADOW,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
WindowLine(Window, right-1, top, right-1, bottom-1, theme.OUTERSHADOW,
miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
end
function DrawThemedResizeTag(Window, x1, y1, size)
local x2, y2 = x1+size, y1+size
DrawThemed3DRect(Window, x1, y1, x2, y2)
local m = 2
local n = 2
while (x1+m+2 <= x2-3 and y1+n+1 <= y2-4) do
WindowLine(Window, x1+m+1, y2-4, x2-3, y1+n, theme.HIGHLIGHT,
miniwin.pen_solid, 1)
WindowLine(Window, x1+m+2, y2-4, x2-3, y1+n+1, theme.INNERSHADOW,
miniwin.pen_solid, 1)
m = m+3
n = n+3
end
end -- function DrawThemedResizeTag
function ResizeMoveCallback()
posx, posy = WindowInfo (Win, 17), WindowInfo (Win, 18)
if (WindowTextWidth(Win, "titlefont"..Win, "WWWCOMMUNICATION")+2*SCROLL_BAR_WIDTH <= WINDOW_WIDTH+posx-startx) then
WINDOW_WIDTH = WINDOW_WIDTH+posx-startx
startx = posx
end -- if
if (3*SCROLL_BAR_WIDTH+10+line_height+theme.TITLE_HEIGHT <= WINDOW_HEIGHT+posy-starty) then
WINDOW_HEIGHT = WINDOW_HEIGHT+posy-starty
starty = posy
end -- if
init(false)
end -- function ResizeMoveCallback
function ResizeReleaseCallback()
WINDOW_HEIGHT = theme.TITLE_HEIGHT+(line_height*(WINDOW_LINES-1))+3
init(true)
end -- ResizeReleaseCallback
-- install the window movement handler, get back the window position
windowinfo = movewindow.install (Win, miniwin.pos_top_right, miniwin.create_absolute_location, true)
-- check for Echo/Timestamp/date_format/window size (in pixels) variables, if not there, set them
if date_format == nil then
date_format = "[%d %b %H:%M:%S] "
end -- if
if WINDOW_WIDTH == nil then
WINDOW_WIDTH = (font_width*80)+SCROLL_BAR_WIDTH -- 80 columns
end
if WINDOW_HEIGHT == nil then
WINDOW_HEIGHT = theme.TITLE_HEIGHT+(line_height*6)+2 -- 6 lines
end -- if
init(true)
OnPluginEnable () -- do initialization stuff
end -- function OnPluginInstall
function init(firstTime)
-- how many lines and columns will fit?
WINDOW_LINES = math.ceil((WINDOW_HEIGHT-theme.TITLE_HEIGHT)/line_height)
WINDOW_COLUMNS = math.ceil((WINDOW_WIDTH-SCROLL_BAR_WIDTH)/font_width)
if firstTime then
WindowCreate(Win, windowinfo.window_left, windowinfo.window_top, WINDOW_WIDTH, WINDOW_HEIGHT, windowinfo.window_mode, windowinfo.window_flags, theme.WINDOW_BACKGROUND)
-- catch for right-click menu and line selection
WindowAddHotspot(Win, "textarea", 0, theme.TITLE_HEIGHT, WINDOW_WIDTH-SCROLL_BAR_WIDTH,0,
"", "", "MouseDown", "CancelMouseDown", "MouseUp", "",
miniwin.cursor_ibeam, 0)
-- add the drag handler so they can move the window around
movewindow.add_drag_handler (Win, 0, 0, 0, theme.TITLE_HEIGHT)
function OnPluginClose ()
-- if enabled
if GetPluginInfo (GetPluginID(), 17) then
OnPluginDisable()
end -- if enabled
end -- function OnPluginClose
function OnPluginEnable ()
WindowShow (Win, true)
end -- function OnPluginEnable
function OnPluginSaveState ()
-- save window current location for next time
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID(), 17)))
movewindow.save_state (Win)
-- save echo/timestamp status
SetVariable ("echo", tostring (echo))
SetVariable ("timestamp", tostring (timestamp))
SetVariable("date_format", date_format)
SetVariable("WINDOW_WIDTH", WINDOW_WIDTH)
SetVariable("WINDOW_HEIGHT", WINDOW_HEIGHT)
end -- function OnPluginSaveState
function OnPluginDisable ()
WindowShow( Win, false )
end -- function OnPluginDisable
-- display one line
function Display_Line (line, styles)
local left = TEXT_INSET
local top = theme.TITLE_HEIGHT + (line * line_height) + 1
local bottom = top + line_height
local font = "bodyfont" .. Win
if backfill then
WindowRectOp (Win, miniwin.rect_fill, 1, top, WINDOW_WIDTH - SCROLL_BAR_WIDTH, bottom, ColourNameToRGB("#333333"))
end -- backfill
if (styles) then
for _, style in ipairs (styles) do
local width = WindowTextWidth (Win, font, style.text) -- get width of text
local right = left + width
WindowRectOp (Win, miniwin.rect_fill, left, top, right, bottom, style.backcolour) -- draw background
WindowText (Win, font, style.text, left, top, 0, 0, style.textcolour) -- draw text
left = left + width -- advance horizontally
end -- for each style run
end -- if styles
end -- Display_Line
-- display all visible lines
function writeLines()
for count = lineStart, lineEnd do
Display_Line( count-lineStart, lines[count][1], false )
end -- for each line
Redraw()
end -- function writeLines
-- clear and redraw
function refresh()
WindowRectOp(Win, miniwin.rect_fill, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, theme.WINDOW_BACKGROUND)
drawStuff()
end -- function refresh
function ScrollerReleaseCallback(flags, hotspot_id)
dragscrolling = false
refresh()
end -- function ScrollerReleaseCallback
function fillBuffer(rawstyles)
local avail = 0
local line_styles
local beginning = true
-- keep pulling out styles and trying to fit them on the current line
local styles = copytable.deep (rawstyles)
local remove = table.remove
local insert = table.insert
while #styles > 0 do
if avail <= 0 then -- no room available? start new line
-- remove first line if filled up
if #lines >= MAX_LINES then
remove (lines, 1)
end -- if
avail = WINDOW_WIDTH - (TEXT_INSET * 2) - 9
line_styles = {}
add_line( line_styles, beginning )
beginning = false
end -- line full
-- get next style, work out how long it is
local style = remove (styles, 1)
local width = WindowTextWidth (Win, "bodyfont"..Win, style.text)
-- if it fits, copy whole style in
if width <= avail then
insert (line_styles, style)
avail = avail - width
else -- otherwise, have to split style
-- look for trailing space (work backwards). remember where space is
local col = style.length - 1
local split_col
-- keep going until out of columns
while col > 1 do
width = WindowTextWidth (Win, "bodyfont"..Win, style.text:sub (1, col))
if width <= avail then
if not split_col then
split_col = col -- in case no space found, this is where we can split
end -- if
-- see if space here
if style.text:sub (col, col) == " " then
split_col = col
break
end -- if space
end -- if will now fit
col = col - 1
end -- while
-- if we found a place to split, use old style, and make it shorter. Also make a copy and put the rest in that
if split_col then
insert (line_styles, style)
local style_copy = copytable.shallow (style)
style.text = style.text:sub (1, split_col)
style.length = split_col
style_copy.text = style_copy.text:sub (split_col + 1)
style_copy.length = #style_copy.text
insert (styles, 1, style_copy)
elseif next (line_styles) == nil then
insert (line_styles, style)
else
insert (styles, 1, style)
end -- if
avail = 0 -- now we need to wrap
end -- if could not fit whole thing in
end -- while we still have styles over
end -- function fillBuffer
function GetLineText (styles)
local t = {}
for _, style in ipairs (styles) do
table.insert (t, style.text)
end -- for
return table.concat (t)
end -- function GetLineText
function GetAllBufferedMessages()
local t = {}
for _,styles in ipairs(rawlines) do
table.insert (t, GetLineText (styles))
end -- for
SetClipboard(table.concat(t,"\r\n"))
end -- function GetAllBufferedMessages
function GetBufferedMessage(xpos, ypos)
windowline = math.floor(((ypos-theme.TITLE_HEIGHT)/line_height)+1)-1
text = ""
if (#lines > windowline) then
local line = windowline+lineStart
-- go to beginning of message
while lines[line][2] ~= true and line > 1 do
line = line - 1
end -- while
-- first line
local styles = copytable.deep(lines[line][1])
if (line-lineStart+1 > 0) then
Display_Line (line-lineStart, styles, true)
end -- if
text = GetLineText (styles)
-- remaining lines
line = line + 1
while line <= #lines and lines[line][2] ~= true do
local styles = copytable.deep(lines[line][1])
if (line-lineStart+1 > 0 and line-lineStart < WINDOW_LINES) then
Display_Line (line-lineStart, styles, true)
end
text = text.. GetLineText (styles)
line = line + 1
end -- while
SetClipboard(text)
end -- if
Redraw()
end -- function GetBufferedMessage
function MouseOver(flags, hotspot_id)
keepscrolling = false
end -- function MouseOver
function CancelMouseOver(flags, hotspot_id)
keepscrolling = false
end -- function CancelMouseOver
function MouseDown(flags, hotspot_id)
if (hotspot_id == "resizer") then
startx, starty = WindowInfo (Win, 17), WindowInfo (Win, 18)
elseif (hotspot_id == "scroller") then
clickdelta = WindowHotspotInfo(Win, "scroller", 2)-WindowInfo (Win, 15)
dragscrolling = true
elseif (hotspot_id == "textarea" and flags == miniwin.hotspot_got_lh_mouse) then
GetBufferedMessage(WindowInfo(Win, 14), WindowInfo(Win,15))
else
keepscrolling = true
scrollbar(hotspot_id)
end -- if
end -- function MouseDown
function CancelMouseDown(flags, hotspot_id)
keepscrolling = false
refresh()
end -- function CancelMouseDown
function MouseUp(flags, hotspot_id)
if (hotspot_id == "textarea" and flags == miniwin.hotspot_got_rh_mouse) then
-- build menu for current state
right_click_menu()
else
refresh()
end -- if
keepscrolling = false
end -- function MouseUp
function init_ansi()
ANSI_colours = {
[GetNormalColour (BLACK)] = ANSI(0,30),
[GetNormalColour (RED)] = ANSI(0,31),
[GetNormalColour (GREEN)] = ANSI(0,32),
[GetNormalColour (YELLOW)] = ANSI(0,33),
[GetNormalColour (BLUE)] = ANSI(0,34),
[GetNormalColour (MAGENTA)] = ANSI(0,35),
[GetNormalColour (CYAN)] = ANSI(0,36),
[GetNormalColour (WHITE)] = ANSI(0,37),
[GetBoldColour (BLACK)] = ANSI(1,30),
[GetBoldColour (RED)] = ANSI(1,31),
[GetBoldColour (GREEN)] = ANSI(1,32),
[GetBoldColour (YELLOW)] = ANSI(1,33),
[GetBoldColour (BLUE)] = ANSI(1,34),
[GetBoldColour (MAGENTA)] = ANSI(1,35),
[GetBoldColour (CYAN)] = ANSI(1,36),
[GetBoldColour (WHITE)] = ANSI(1,37)
} -- end conversion table
end
init_ansi()
-- also provide the reverse of the extended_colours global table
colours_extended = {}
for i,v in ipairs(extended_colours) do
colours_extended[v] = i
end
-- Returns a string with embedded ansi codes.
-- This can get confused if the player has redefined their color chart.
function stylesToANSI (styles)
local line = {}
local reinit = true
for _,v in ipairs (styles) do
if ANSI_colours[v.textcolour] then
table.insert(line, ANSI_colours[v.textcolour])
elseif colours_extended[v.textcolour] then -- use 256 color xterm ansi when necessary
table.insert(line, ANSI(38,5,colours_extended[v.textcolour]))
elseif reinit then -- limit performance damage
reinit = false
init_ansi()
end
table.insert(line, v.text)
end
table.insert(line, ANSI(0))
return table.concat(line)
end
function chat_echo (name, line, wildcards)
if wildcards [1] == false then
echo = not echo -- toggle
else
echo = wildcards [1]:lower () == " on"
end -- if
if echo then
ColourNote ("yellow", "", "Echoing chats in main window ENABLED.")
else
ColourNote ("yellow", "", "Echoing chats in main window DISABLED.")
end -- if
end -- function chat_echo
function chat_show (name, line, wildcards)
WindowShow( Win, true )
ColourNote ("yellow", "", "Chats window now shown. Type 'chats hide' to hide it.")
end -- function chat_show
function chat_hide (name, line, wildcards)
WindowShow( Win, false )
ColourNote ("yellow", "", "Chats window now hidden. Type 'chats show' to see it again.")
end -- function chat_hide
-- right click menu
function right_click_menu ()
menustring ="Copy All To Clipboard|Change Font|Turn Echo "
if echo then
menustring = menustring .. "Off"
else
menustring = menustring .. "On"
end -- if
menustring = menustring.."|>Timestamp|No Timestamps|30 Aug 13:29:49|30 Aug 01:20:12PM|13:29:08|1:22:06 PM"
result = WindowMenu (Win,
WindowInfo (Win, 14), -- x position
WindowInfo (Win, 15), -- y position
menustring) -- content
if result == "Copy All To Clipboard" then
GetAllBufferedMessages()
ColourNote ("yellow", "", "All buffered messages copied to clipboard.")
elseif result == "Change Font" then
wanted_font = utils.fontpicker (BODY_FONT_NAME, BODY_FONT_SIZE) --font dialog
if wanted_font then
BODY_FONT_NAME = wanted_font.name
BODY_FONT_SIZE = wanted_font.size
SetVariable ("bodyfont", BODY_FONT_NAME)
SetVariable ("font_size", BODY_FONT_SIZE)
OnPluginInstall()
end
elseif result == "Turn Echo Off" then
echo = false
ColourNote ("yellow", "", "Echoing chats in main window DISABLED.")
elseif result == "Turn Echo On" then
echo = true
ColourNote ("yellow", "", "Echoing chats in main window ENABLED.")
elseif result == "No Timestamps" then
timestamp = false
ColourNote ("yellow", "", "Timestamps in communication window DISABLED.")
elseif result == "30 Aug 13:29:49" then
timestamp = true
date_format = "[%d %b %H:%M:%S] "
ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '30 Aug 13:29:49'.")
elseif result == "30 Aug 01:20:12PM" then
timestamp = true
date_format = "[%d %b %I:%M:%S%p] "
ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '30 Aug 01:20:12PM'.")
elseif result == "13:29:08" then
timestamp = true
date_format = "[%H:%M:%S] "
ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '13:29:08'.")
elseif result == "1:22:06 PM" then
timestamp = true
date_format = "[%I:%M:%S%p] "
ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '1:22:06 PM'.")
end -- if
end -- function right_click_menu
]]>
</script>
</muclient>
On Aardwolf, channels come in with some extra information on the front of the line, so that our triggers would never fire again on the new output because our output doesn't have that extra information, so our triggers don't match our output. But your output looks exactly like your input! So the trigger fires over and over and over...
Let's go back to the beginning. Technically, on your game it is just not safe to use omit_from_output with any of your chat triggers because there seems to be no apparent way to reliably differentiate them from other text. What you should actually be doing is not using any of the echo code at all because you should not be omitting from output.
But if you like where we're going so far and just want this to work and you're also really set on having the "echo off" feature, then you'll need to build into your triggers a little bit of memory so that you don't keep spitting out the same line over and over again.
Something like...
previous_line = nil
blocked_previous = false
-- Main capture routine
function chats (name, line, wildcards, styles)
if not blocked_previous and previous_line == line then
blocked_previous = true
return
end
blocked_previous = false
previous_line = line
... etc.
-- Main capture routine
function chats (name, line, wildcards, styles)
With
previous_line = nil
blocked_previous = false
-- Main capture routine
function chats (name, line, wildcards, styles)
if not blocked_previous and previous_line == line then
blocked_previous = true
return
end
blocked_previous = false
previous_line = line
I did something wrong. Removed everything of the echo, and now nothing works. I then got the file back, with the echo, and now, it omits the chats on the main window and the hyperlinks go duplicated again.
Jesus, don't know what is wrong.
I did something wrong. Removed everything of the echo, and now nothing works.
Wasn't it working before? Were you just engaging in an academic exercise? :)
Quote: I then got the file back, with the echo, and now, it omits the chats on the main window and the hyperlinks go duplicated again.
Jesus, don't know what is wrong.
I think you have two options:
1) Redo the process up to the point where it was working, as before. This preserves the (technically unsafe in your MUD's case) option to omit from output.
2) Start with the original file, delete the ColourTell section instead of replacing it with the Simulate stuff, and then remove all the "omit_from_output" lines from your triggers. This eliminates the (technically unsafe in your MUD's case) option to omit from output.
You're the man. I removed the omit_from_output from the triggers, and everything is fine now, and managed to get the echos off.
Now i will try to make a mini-window with some other information. Now i have the chat, the logins (when a player logs, it saves the name and the time) and another one that shows me all the players online, it refreshes from 5 minutes to 5 minutes.