[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Mini-Window chatter

Mini-Window chatter

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  3  

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Fri 23 Oct 2015 09:50 AM (UTC)
Message
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?

Thank you.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Fri 23 Oct 2015 10:12 AM (UTC)
Message
Quote:
the mini-window public chatter plugin from Nick
Can you be more specific by providing a link to it?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #2 on Fri 23 Oct 2015 05:52 PM (UTC)
Message
Hi man, here is the link.

http://mushclient.com/forum/?id=10728&reply=5#reply5

It says there that the hyperlink will be available on the mini-window, but it is not and it screws the Hyperlink2 plugin.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 23 Oct 2015 08:56 PM (UTC)
Message
Halig said:

Hi man, here is the link.

http://mushclient.com/forum/?id=10728&reply=5#reply5

It says there that the hyperlink will be available on the mini-window, but it is not and it screws the Hyperlink2 plugin.


I can't see the word "hyperlink" anywhere in that post. Can you point to which reply it is in?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #4 on Fri 23 Oct 2015 09:09 PM (UTC)
Message
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.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #5 on Sat 24 Oct 2015 07:54 AM (UTC)
Message
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?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #6 on Sat 24 Oct 2015 09:47 AM (UTC)
Message
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.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #7 on Sat 24 Oct 2015 12:12 PM (UTC)

Amended on Sat 24 Oct 2015 12:13 PM (UTC) by Fiendish

Message
The answer is pretty technical.

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.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #8 on Sat 24 Oct 2015 08:19 PM (UTC)
Message
Hi Fiendish,

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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sat 24 Oct 2015 10:47 PM (UTC)
Message
Both plugins, as I understand it, match on something, omit it from output, and then redisplay it. Thus you get some lines appearing twice.

I can't think of any easy solution, except to incorporate the hyperlink stuff into the chat plugin.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #10 on Sun 25 Oct 2015 10:49 AM (UTC)

Amended on Sun 25 Oct 2015 10:53 AM (UTC) by Fiendish

Message
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.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #11 on Sun 25 Oct 2015 11:09 AM (UTC)
Message
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.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #12 on Sun 25 Oct 2015 12:16 PM (UTC)

Amended on Sun 25 Oct 2015 12:20 PM (UTC) by Fiendish

Message
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

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Halig   Portugal  (123 posts)  [Biography] bio
Date Reply #13 on Sun 25 Oct 2015 03:31 PM (UTC)
Message
Hi Fiendish,

Got this when i changed the things you said:

Run-time error
Plugin: Chat_Capture_Miniwindow (called from world: Legends of Krynn)
Immediate execution
[string "Plugin"]:585: bad argument #1 to 'GetNormalColour' (number expected, got nil)
stack traceback:
[C]: in function 'GetNormalColour'
[string "Plugin"]:585: in function 'init_ansi'
[string "Plugin"]:604: in main chunk
Error context in script:
581 : end -- function MouseUp
582 :
583 : function init_ansi()
584 : ANSI_colours = {
585*: [GetNormalColour (BLACK)] = ANSI(0,30),
586 : [GetNormalColour (RED)] = ANSI(0,31),
587 : [GetNormalColour (GREEN)] = ANSI(0,32),
588 : [GetNormalColour (YELLOW)] = ANSI(0,33),
589 : [GetNormalColour (BLUE)] = ANSI(0,34),


I put the function init_ansi(), inside the chat plugin.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #14 on Sun 25 Oct 2015 06:26 PM (UTC)
Message
Oops, sorry. I missed a piece.


local BLACK = 1
local RED = 2
local GREEN = 3  
local YELLOW = 4 
local BLUE = 5 
local MAGENTA = 6 
local CYAN = 7 
local WHITE = 8

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


78,282 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]