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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Editing Chat Redirect Script For Specifics

Editing Chat Redirect Script For Specifics

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 Tue 23 Feb 2021 03:47 PM (UTC)
Message
I'm using the chat redirect plugin, which works great and I've managed to edit for my purposes.

However, if someone speaks in a different language, it doesn't cross over.

For instance: BigBobBerry clan gossips (Dwarvish) 'Hardy har har!'

How do I edit the script to include (language) in all instances, and do so in a way that all languages are represented?

Here's my edited script:


<trigger
enabled="y"
match="^^((The ghost of [\w\']+|The Ghost of [\w\']+|[\w\']+|\(An Imm\)|\(Imm\) [\w\']+|A masked swashbuckler) )?(OOC )?(clan|clans|OOC clan:|OOC Clan:|Kingdom:|gossip|gossips|clan gossips|clan gossip|auction:|auctions:) \'.+\'$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
[Go to top] top

Posted by Fiendish   USA  (2,525 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Tue 23 Feb 2021 04:22 PM (UTC)
Message
Your match pattern has gotten quite silly. Break it apart into separate triggers.

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

Posted by Lilac   (24 posts)  [Biography] bio
Date Reply #2 on Tue 23 Feb 2021 06:28 PM (UTC)
Message
Silly how? That's the original script, I just added in the channel names I need to redirect to the ones already there.
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 24 Feb 2021 02:03 AM (UTC)
Message
The simple thing would be to add the language just before the thing that is gossiped. So, from this point on:


... |auctions:) '.+'$"


Change it to:


... |auctions:) (\(.*?\) )? '.+'$"



The outer brackets, with a ? at the end, make this an optional group (so it doesn't have to be there). The extra space after the language is part of that group.

The escaped brackets are just the brackets around the langugage, and .*? means anything, not greedy.

- Nick Gammon

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

Posted by Lilac   (24 posts)  [Biography] bio
Date Reply #4 on Wed 24 Feb 2021 01:48 PM (UTC)

Amended on Wed 24 Feb 2021 01:55 PM (UTC) by Lilac

Message
Okay. So I did the change you suggested, via copy and pasted it into the script.

Thing is, it makes some channels echo into both windows, now.

It does not seem to fix the language thing, that I can see, either.

Unless I'm missing something totally obvious, which could be the case, because I'm a potato. :)



BTW, thank you for your assistance in this. I'm super appreciative of your talent and your time.
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 25 Feb 2021 04:55 AM (UTC)
Message

OK, so you have two chat windows. I missed that bit.

Your words “it doesn’t cross over” didn’t really resonate with me in that way.

The simplest thing would be, as Fiendish suggested, to have multiple triggers. Trigger A matches the messages for one window (and when it matches, Trigger B won’t fire). Trigger B sends messages to the other window. Then each trigger can be simpler.

Make sure Trigger A has a lower sequence number than Trigger B so it fires first.

The more specific trigger should be Trigger A.


- Nick Gammon

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

Posted by Lilac   (24 posts)  [Biography] bio
Date Reply #6 on Thu 25 Feb 2021 01:19 PM (UTC)
Message
Will give it a try, thank you!
[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.


13,115 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]