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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Adapting Nick's Chat Redirector Plugin

Adapting Nick's Chat Redirector Plugin

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


Posted by Lilac   (24 posts)  [Biography] bio
Date Wed 31 Mar 2021 04:31 PM (UTC)

Amended on Wed 31 Mar 2021 04:33 PM (UTC) by Lilac

Message
I use Nick's redirector plug in, and I'm trying to have PK toasts go over to the capture window, as well.

The trigger match will be as follows (for example):

[ BadGuys ] Bobby got ***DESTROYED*** by SallyMae [ GoodGuys ]

So, the first part I'm having trouble with is the damage. ***DESTROYED*** is only one variable, some have extraneous punctuation and some does not. For example, a simple "offed" or "killed" or "<<< ERADICATED >>>" or "=== OBLITERATED ==="


Second part is that stuff within the brackets and the character names will change, as well. Ergo, the only constant in the equation will be:

[ * ] * got * by [ * ]


I'm also assuming just * isn't enough for so many variables, but I'm a potato with no script talent.
[Go to top] top

Posted by Fiendish   USA  (2,525 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 31 Mar 2021 04:44 PM (UTC)

Amended on Wed 31 Mar 2021 04:47 PM (UTC) by Fiendish

Message
Quote:
I use Nick's redirector plug in

This isn't enough information for us to know which plugin you mean. Please link to either a copy of the plugin or the forum post where you got it from.

Quote:
[ * ] * got * by [ * ]

I think you mean [ * ] * got * by * [ * ]

Quote:
I'm also assuming just * isn't enough for so many variables, but I'm a potato with no script talent.

Did you try it? What did you try and what happened?

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

Posted by Lilac   (24 posts)  [Biography] bio
Date Reply #2 on Wed 31 Mar 2021 06:16 PM (UTC)

Amended on Wed 31 Mar 2021 06:27 PM (UTC) by Lilac

Message
Nick's Redirector:


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

<trigger
enabled="y"
match="^You (say|chat|yell) \'(.*?)\'$"
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>






The chat redirect works great, but I tried adding the below and it didn't work:


<trigger
enabled="y"
match="[ * ] * got * by * [ * ]"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 31 Mar 2021 08:43 PM (UTC)
Message

A link to the relevant page would be helpful rather than copy/pasting it. That way we can all refer back to the same page rather than the copy. Also, comments on that page may shed some light onto things. Please post the link to where you found it (I have done a few chat redirector plugins).


- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 31 Mar 2021 08:44 PM (UTC)
Message

I’m also assuming just * isn’t enough for so many variables, but I’m a potato with no script talent.

You can use around 100 wildcards, so that isn’t the issue. Fiendish seems to have spotted that you left one out.


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


11,367 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 HostDash]