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.
 Entire forum ➜ MUSHclient ➜ General ➜ 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 page


Posted by Lilac   (24 posts)  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"
Top

Posted by Fiendish   USA  (2,533 posts)  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
Top

Posted by Lilac   (24 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,120 posts)  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
Top

Posted by Lilac   (24 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,120 posts)  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
Top

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


14,422 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.