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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  How to make a separate chats window

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: How to make a separate chats window
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2  3  4  5 6  7  

Posted by Alkain   (4 posts)  [Biography] bio
Date Thu 28 Mar 2013 03:11 AM (UTC)  quote  ]

Amended on Thu 28 Mar 2013 09:23 AM (UTC) by Alkain

Message
Soooo, it's been a while... Any help would be appreciated, I'm also looking for how to make a clock or something similar.


EDIT: Thanks to a friend, I was able to get it working. THanks for the help though
[Go to top] top

Posted by Alkain   (4 posts)  [Biography] bio
Date Tue 19 Mar 2013 12:43 AM (UTC)  quote  ]
Message
I would, but I really have no idea what I'm doing. I'm new to Mushclient and have no coding experience :/
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Mon 18 Mar 2013 03:51 AM (UTC)  quote  ]
Message
I think there are a few versions over the life of this thread. Take then one you tried, try to get it working, and then post what you have.

- Nick Gammon

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

Posted by Alkain   (4 posts)  [Biography] bio
Date Sun 17 Mar 2013 08:55 PM (UTC)  quote  ]
Message
Nick Gammon said:


@Alkain - can you post what you tried?



Sadly I erased it all, but I tried several of the fixes listed here with slight modifications.

I did set up the chat world as specified and made sure the script pointed to it.

I just fiddled with the match= line though, but I can't remember what I did exactly :/
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Sun 17 Mar 2013 08:43 PM (UTC)  quote  ]
Message
@Squeegy - sorry, I missed this question.

You need to identify what is different about the line that is not the chat line, so it can stop when it hits it. Perhaps post an example chat with an example of what follows it?




@Alkain - can you post what you tried?

- Nick Gammon

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

Posted by Alkain   (4 posts)  [Biography] bio
Date Sun 17 Mar 2013 04:20 PM (UTC)  quote  ]

Amended on Sun 17 Mar 2013 04:25 PM (UTC) by Alkain

Message
Hi, I'm trying(And failing) to adapt this to a MUCK I play on. Sadly, I can't get anything to show up on the "Chat World"

The standard channels are;

<OOC> <name> says
<OOC> <name> <does something>
[Public] <name> says
[Public] <name> <does something>
says
page

If anyone can help, it'd be greatly appreciated :)


EDIT: With exception to the <OOC> itself, the things in <> are variables, just in case it isn't clear :P
[Go to top] top

Posted by Squeegy   (1 post)  [Biography] bio
Date Thu 03 Jan 2013 09:45 PM (UTC)  quote  ]
Message
Having a slight problem; I'm trying to filter out emotes on channels as well, but it isn't catching them because they don't end with '. How would I capture that with this?

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:48 -->
<!-- MuClient version 4.13 -->

<!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->

<!--
Edit plugin and change "chat_world" variable to be the name of the
world you want chats to go to.
-->

<muclient>
<plugin
name="Chat_Redirector"
author="Nick Gammon"
id="cb84a526b476f69f403517da"
language="Lua"
purpose="Redirects chat messages to another world"
date_written="2007-06-30 10:45:35"
requires="4.08"
version="2.0"
>
<description trim="y">
<![CDATA[
Redirects chats to the specified world.

Add or modify "chat" triggers to capture different sorts of message.

Change the variable "chat_world" to be the name of the world chats are to go to.
]]>
</description>

</plugin>

<!-- Triggers -->

<triggers>

<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z +]+ (CHATS|GOSSIPS|GRATZS|WIZS|QUESTCHATS|INFOS|IMCCHATS|AUCTIONS|WIZINFOS|CLANTALKS) '"
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>

<trigger
enabled="y"
match="^[(CHAT|GOSSIP|GRATZ|WIZ|QUESTCHAT|INFO|IMCCHAT|AUCTION|WIZINFO|CLANTALK)] "
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>

<trigger
enabled="y"
match="^You (CHAT|GOSSIP|GRATZ|WIZ|QUESTCHAT|INFO|IMCCHAT|AUCTION|WIZINFO|CLANTALK) '"
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>

<trigger
enabled="n"
match="*"
omit_from_output="y"
script="chat_redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>

<trigger
enabled="n"
match="*"
omit_from_output="y"
script="chat_redirect"
name="prompt"
sequence="10"
>
</trigger>

</triggers>

<!-- Script -->


<script>
<![CDATA[
chat_world = "Chat"
who_world = "Who List"

require "getworld" -- handles finding the world, and sending the line

-- chat redirector
function chat_redirect (name, line, wildcards, styles)

send_to_world (chat_world, styles)

-- if ends with quote, end of multi-line chat
if line:sub (-1) == "'" then
EnableTrigger ("multi_line_chat", false) -- no more lines to go
else
EnableTrigger ("multi_line_chat", true) -- capture subsequent lines
end -- if

end -- function chat_redirect

]]>
</script>
</muclient>


Example:
[CHAT] Blackjack just wants things to work as close to perfectly as possible,
is that really too much to ask

It will catch it, but it will also catch the newline after it, or even both the newline and the prompt, which I don't want cluttering up the place. Any advice?
[Go to top] top

Posted by Quinas   (2 posts)  [Biography] bio
Date Fri 01 Jun 2012 04:32 AM (UTC)  quote  ]
Message
Perfect. That fixed it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 01 Jun 2012 03:17 AM (UTC)  quote  ]
Message

  if line:sub (-1) == '==============================================================================' then


Testing this:


line = "=============================================================================="
print (line:sub(-1))


This prints "=".

You are comparing the last character of the line to a whole lot of equals signs, which won't match.

Maybe:


  if line == '==============================================================================' then


- Nick Gammon

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

Posted by Quinas   (2 posts)  [Biography] bio
Date Fri 01 Jun 2012 12:01 AM (UTC)  quote  ]
Message
Hi, I'm trying to filter out the following to a new window:

Quote:
=====================<+CDB Info for Jan (1473) - Male PC>=====================
Fullname: Jan Marbrand
Family: Son of Ser Joslan Marbrand and Janysa Falwell. Unmarried.

Age: 22 (b. 9-11-140) Religion: The Seven
House: Marbrand Allegiance: Marbrand
Region: The Westerlands Location: King's Landing
------------------------------------------------------------------------------
Status: A scion of a lesser lordly house.
Title: Knight
------------------------------------------------------------------------------
Hair: Dark Auburn Height: 1.88m/6'02"
Eyes: Grey Weight: 80kg/176lbs

Shortdesc: A rangy young man with dark auburn hair and grey eyes, clad in
simple but fine clothing.
==============================================================================


This is my code:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, May 31, 2012, 4:48 PM -->
<!-- MuClient version 4.73 -->

<!-- Plugin "CBDRedirect" generated by Plugin Wizard -->

<muclient>
<plugin
   name="CBDRedirect"
   author="NY"
   id="2a58766aa2f7611113dbbcbc"
   language="Lua"
   purpose="To redirect CDB"
   date_written="2012-05-31 16:48:13"
   requires="4.73"
   version="1.0"
   >

</plugin>


<!--  Triggers  -->

<triggers>

  <trigger
   enabled="y"
   match="CDB"
   omit_from_output="y"
   regexp="y"
   script="redirect"
   sequence="100"
  >
  </trigger>
  
  <trigger
   enabled="n"
   match="*"
   omit_from_output="y"
   script="redirect"
   name="multi_line_chat"
   sequence="10"
  >
  </trigger>
  
</triggers>

<!--  Script  -->


<script>
<![CDATA[
chat_world = "BoD cdb"
local first_time = true

function redirect (name, line, wildcards, styles)

  -- try to find "chat" world
  local w = GetWorld (chat_world)  -- get "chat" world

  -- if not found, try to open it
  if first_time and not w then
    local filename = GetInfo (67) .. chat_world .. ".mcl"
    Open (filename)
    w = GetWorld (chat_world)  -- try again
    if not w then
      ColourNote ("white", "red", "Can't open chat world file: " .. filename)
      first_time = false  -- don't repeatedly show failure message
    end -- can't find world 
  end -- can't find world first time around

  if w then  -- if present
    for _, v in ipairs (styles) do
      w:ColourTell (RGBColourToName (v.textcolour), 
                    RGBColourToName (v.backcolour), 
                    v.text)  
    end -- for each style run
    w:Note ("")  -- wrap up line
	
-- if ends with quote, end of multi-line chat
  if line:sub (-1) == '==============================================================================' then
    EnableTrigger ("multi_line_chat", false)  -- no more lines to go
  else
    EnableTrigger ("multi_line_chat", true)  -- capture subsequent lines
  end -- if	

  end -- world found

end -- function redirect 

]]>
</script>




</muclient>


I can get it to filter the text I want, but after that it filters everything else coming from the 'main' world. Am I missing a command to switch the multi-line filter off?

Thanks
[Go to top] top

Posted by FruitSmoothie   (3 posts)  [Biography] bio
Date Sun 04 Mar 2012 02:39 AM (UTC)  quote  ]
Message
FruitSmoothie said:

If needed, better examples:

[zotnet] Bobby asks, "Have you ever met a gangster that wasn't cool?"

On your wristpad radio: [cam-Apt 321] On the CRT television: This just in: A rioting mob of indigenous mutants is growing in numbers in the Necropolis!


They're also different colors and such, if possible, though it seems complicated to do with this system. Example:

On your wristpad radio: [yellow][cam-Apt 101][/yellow] [green]On the CRT television: This just in: A rioting mob of indigenous mutants is growing in numbers in the Necropolis![/green]

On your wristpad radio: [yellow][cam-Apt 101][/yellow] The [B]ham radio: [red][FCPD][/red]The scrawny hound earned 8 stars at Fourth and Grand.[B]

[red][zotnet][/red] Bobby asks, "Have you ever met a gangster that wasn't cool?"

Brackets and colors are the colors they appears as normally, [B] is bolded white text.
[Go to top] top

Posted by FruitSmoothie   (3 posts)  [Biography] bio
Date Sun 04 Mar 2012 02:17 AM (UTC)  quote  ]
Message
If needed, better examples:

[zotnet] Bobby asks, "Have you ever met a gangster that wasn't cool?"

On your wristpad radio: [cam-Apt 321] On the CRT television: This just in: A rioting mob of indigenous mutants is growing in numbers in the Necropolis!
[Go to top] top

Posted by FruitSmoothie   (3 posts)  [Biography] bio
Date Sun 04 Mar 2012 02:13 AM (UTC)  quote  ]
Message
I'm trying to get all messages starting with:

On your wristpad radio:
and
[zotnet]

to be transferred to the other window, playing Hatemoo. I don't want them shown on the main window either. How can I accomplish this? It's not working too well...
[Go to top] top

Posted by Curtis_D   (22 posts)  [Biography] bio
Date Fri 24 Feb 2012 01:45 PM (UTC)  quote  ]
Message
Alright, that's what it was. Everything works fine now! So that's one goal on my profile that I can check off, now to move on to the next one.
[Go to top] top

Posted by Curtis_D   (22 posts)  [Biography] bio
Date Fri 24 Feb 2012 02:17 AM (UTC)  quote  ]

Amended on Fri 24 Feb 2012 02:23 AM (UTC) by Curtis_D

Message
I think I figured it out- The "chat world" name wasn't "RoD chats", I think when I saw this part I thought it was the file name. I've been working on this late at night when I actually have time, so I'm bound to make mistakes like that.
I'm at work right now so when I get home I'll modify the code so that the line: chat_world = "PKFusion" is added replacing the "RoD chats".

I'll let you know how it goes,
Thanks for the response,

Nick Gammon said:

•Enter a "chat" world name ... I used "RoD chats", but you can use anything, provided you modify the plugin slightly.


•Enter "0.0.0.0" for the TCP/IP address - this stops MUSHclient from trying to actually connect to this world.


•Hit OK to create this world.


•Press Ctrl+G or Alt+Enter to enter the world configuration, and change the font size (in Appearance -> Output) to be small enough to fit the chat window on your screen alongside the main world. Maybe change the "wrap column" to be smaller if necessary.


•Go to the File menu -> Save World Details (Ctrl+S).


•Save as the suggested name "RoD chats.mcl".


On a side note, I'm very excited about using this program once I can learn how it works.
Thanks,
[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.


52,708 views.

This is page 5, subject is 7 pages long:  [Previous page]  1  2  3  4  5 6  7  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]