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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Colors for chat
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Colors for chat

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


Posted by Rinor   (16 posts)  [Biography] bio
Date Sat 19 Jun 2004 04:42 AM (UTC)
Message
Is it possible to customize chat so that it can have colors? Chat messages from me are cyann atm, I would like to change the color.
[Go to top] top

Posted by Nick Gammon   Australia  (21,405 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 19 Jun 2004 05:35 AM (UTC)
Message
In the chat configuration window you can customise the chat colour.

The chat protocol is designed for colours to be sent with chats, so it is possible that the sender is sending their own colours.

You can turn that off by checking "ignore incoming colours".

You could also modify the chat plugin to change the way incoming chat messages appear by making (say) poses and chats come out in different colours.

- Nick Gammon

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

Posted by Rinor   (16 posts)  [Biography] bio
Date Reply #2 on Sat 19 Jun 2004 03:16 PM (UTC)
Message
What about chaging color for outgoing chat messages? People on my chat see my chat messages in cyan. I would like to try another color if that is possible.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Sat 19 Jun 2004 10:39 PM (UTC)
Message
I had that question too, how can you chat something with colors in it?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,405 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sat 19 Jun 2004 11:38 PM (UTC)
Message
There are ways ... :)

First thing you can do in scripting is to simply do chats directly via ChatMessage, like this:

/world.chatmessage 1, 5, vbCrLf & "aha - aha" & vbCrLf

What this does is send to chat session 1, chat message type 5 (Text_personal - these are documented in the Chat plugin), a message which does not have colour codes in it.

To do it to a person you could do:

/world.chatmessage ChatGetID ("nick"), 5, vbCrLf & "aha - aha" & vbCrLf

To do it to a group you would have to get a list of connected chat sessions using GetChatList and iterate through it (see the plugin for an example).

The linefeeds are part of the expected protocol, it may work to leave them out but not recommended, depending on what client the other player is using.




Probably more simply, just imbed the colour codes in your message using the Ansi function. eg. to chat in green:


mymessage = Ansi (32) & "hi there everyone"
world.execute "#chatall " & mymessage


What would happen here is that the chat system will set the message to cyan, but then you have immediately changed it to green, so the other player will see green.

This method has the benefit that you are using the existing aliases (eg. chatall, emote etc.) and are simply colouring the message it sends. Thus you don't have to muck around working out the correct chat code for each message type, and work through lists of connections.




What you could do to simplify things a bit more, if you don't mind changing the chat plugin itself, is to put in the codes (colours) you want into the various aliases in it.

eg.

Before ...

<aliases>
<alias
   match="&prefix;chatall *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>ChatEverybody "%1", 0</send>
  </alias>
</aliases>


After ...

<aliases>
<alias
   match="&prefix;chatall *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>ChatEverybody Ansi (32) & "%1", 0</send>
  </alias>
</aliases>


What this has done is put the "green" code into just before the message that is sent to ChatEverybody.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


4,203 views.

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 FutureQuest]