Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Spawning Windows Question! :)

Spawning Windows Question! :)

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


Posted by Cjh1481   (2 posts)  Bio
Date Sat 15 May 2010 03:41 PM (UTC)
Message
Hi, /long/ time user (10+ years), 1st time poster. Love the software, as far as I know it's the best telnet-orientated program (I use it for MUSHing & MOOing).

On a MUSH that I play on, it would make things a lot easier if I could create another window to see Out of character stuff (pages, channels, announcements) and have my main window devoted only to IC actions, room & PC descriptions. I do not know how to do this.

Can anyone offer any help?

Thank you.
Top

Posted by Chicomecoatl   USA  (25 posts)  Bio
Date Reply #1 on Sat 15 May 2010 08:38 PM (UTC)
Message
Sure, check out this page:

http://www.gammon.com.au/forum/?id=7991

Enjoy! :)
Top

Posted by Cjh1481   (2 posts)  Bio
Date Reply #2 on Sun 16 May 2010 02:44 PM (UTC)

Amended on Sun 16 May 2010 03:20 PM (UTC) by Cjh1481

Message
Thank you for the link. I had read that, and unfortunately, something I am doing isn't working. I know I am not parsing the code correctly, because I do not know how to do it. In addition, when I opened the world, the RoD Chats opened automatically -- for some reason, this is not the case anymore. I will paste the code I have tried to derive in entirety, but I would like to stipulate what I would like to be in the other window.

When I page (communicate across MUSH, as in whisper) someone, I get echo that reads:
You paged Tony with 'hello!'.

When they page me, I get echo that reads:
Tony pages: hello!

When I page-emote, I get echo that reads:
Long distance to Tony: Chris waves!

When they page-emote me, I get echo that reads:
From afar, Tony waves!

On this particular MUSH, we use a channel system. When we talk on it, it will read:
[Vampire] Chris waves!

We talk out of character a lot during scenes. When this happens, it will read:
<OOC> Chris waves!

In all of these listed events, I would like for these to show up in the RoD Window, or window that is not the main window. The below code has been edited (incorrectly) by me. Please let me know how to fix it? In addition, I messed something up, because now it is not even opening up the RoD Chats window like it used to. Thank you, again, for all your help.

<?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="1.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="^<OOC> ^[A-Za-z]+ \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>


<trigger
enabled="y"
match="^From afar, ^[A-Za-z]+ \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>


<trigger
enabled="y"
match="^[Vampire] ^[A-Za-z]+ \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>


<trigger
enabled="y"
match="^Long distance to ^[A-Za-z]+ \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>



</triggers>

<!-- Script -->


<script>
<![CDATA[
chat_world = "RoD Chats"
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

end -- world found

end -- function redirect

]]>
</script>


</muclient>

Top

Posted by Garrion   (21 posts)  Bio
Date Reply #3 on Mon 17 May 2010 09:34 AM (UTC)
Message
It looks like your regular expression matching is wrong.

To match:
You paged Tony with 'hello!'.

You would need something like:
match="^You paged (.*?) with \'(.*?)\'\.$"

and to match:
Tony pages: hello!

you could try:
match="^(.*?) pages\: (.*?)$"

You can find out more about regular expression matching in the documentation regular expressions section of this site.

Garrion.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 17 May 2010 09:22 PM (UTC)
Message
Template:regexp Regular expressions
  • Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
  • Also see how Lua string matching patterns work, as documented on the Lua string.find page.

- Nick Gammon

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


20,314 views.

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

Go to topic:           Search the forum


[Go to top] top

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