Editing Chat Redirect Script For Specifics

Posted by Lilac on Tue 23 Feb 2021 03:47 PM — 7 posts, 22,889 views.

#0
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"
USA Global Moderator #1
Your match pattern has gotten quite silly. Break it apart into separate triggers.
#2
Silly how? That's the original script, I just added in the channel names I need to redirect to the ones already there.
Australia Forum Administrator #3
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.
#4
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.
Amended on Wed 24 Feb 2021 01:55 PM by Lilac
Australia Forum Administrator #5

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.

#6
Will give it a try, thank you!