achaea chat redirecting

Posted by Brothfeder on Sat 11 Jul 2015 07:29 AM — 10 posts, 34,753 views.

#0
I hate to throw this issue on you, but I can't get this chat redirecting miniwindow to work. I'm using the chat redirecting miniwindow by fiendish. The window pops up after the plugin is installed, however it will not capture anything. Furthermore I thought the triggers were made for achaea but aren't working.

Some output examples...
You say in a confident, yet reserved voice, "Test."
You tell Ula, "Didn't work, but thanks."
Ula tells you, "Nope, i use the nexus client."
Jonesey's voice sizzles as he tells you, "Sorry, mudlet."
(Ashtan): Ula says, "So, what the hell is happening now?!"
(Fledglings): Jonesey says, "Bye."


<triggers>
<trigger
enabled="y"
match="^((.+): )?[A-Za-z]+ (says|yells|tells you), &quot;.+&quot;"
script="chats"
omit_from_output="y"
sequence="100"
>
</trigger>

<trigger
enabled="y"
match="^You (say|tell|whisper) .+, &quot;.+&quot;"
script="chats"
omit_from_output="y"
sequence="100"
>
</trigger>

</triggers>



There was a $ symbol somewhere at the end of the match= lines that I may have butchered. Like everyone says on these forums - i'm not a coder, ect. I'm just tired of trying but really need something to capture all communication.
Amended on Sun 12 Jul 2015 04:11 AM by Brothfeder
#1
I've been working on the Say|tell|whisper part and tried this. I feel this should capture my says. But no dice.

<trigger
enabled="y"
match="^You (say|tell|whisper) .+, &quot;.+&quot;$"
script="chats"
omit_from_output="y"
sequence="100"
>
</trigger>

example say:
You say in a confident, yet reserved voice, "Test."
Australia Forum Administrator #2
That looks like a regular expression, but you have not checked the "regexp" box.
#3
The 2nd trigger never had one to my knowledge.
USA Global Moderator #4
Well you need it now, because you made a regexp pattern.
Australia Forum Administrator #5
With "regexp" not checked:


^You (say|tell|whisper) .+, &quot;.+&quot;$


That only matches on literally receiving that from the MUD, which probably won't happen.
#6
First of all thank you for your input. I actually didn't know what/how to set regular expressions. I've now read up on them. Even after making them regular expressions they still needed work. I got it to work, MOSTLY with this:



<triggers>
    <trigger
    enabled="y"
    match="^(\(.+\)\: )?[A-Za-z]+ ? (say|says|yells|tells you), &quot;.+&quot;$"
    script="chats"
    omit_from_output="y"
    sequence="100"
    regexp="y"
    >
    </trigger>

    <trigger
    enabled="y"
    match="^You  (say|tell|whisper) .+ &quot;.+&quot;$"
    script="chats"
    omit_from_output="y"
    sequence="100"
    regexp="y"
    >
    </trigger>


I say MOSTLY because if someone adds an adverb it doesn't catch it, and I can't figure how to get it to do it. Example output:

Ronit helpfully tells you, "Sure."

You happily tell Ronit, "Ooops sorry that didn't work."

I know you guys don't want to do my work for me - I get that. But your experts! If someone could just suggest a change that might work..it would be SOO helpful and time saving.

BTW the addition of the ? on the first trigger is not necessary for it to function. I just put it in to try to get adverbs to show up. It seems to be doing nothing noticeable. I've tried many other regular expressions too...

Thank you.

[EDIT] Code tags added.
Amended on Tue 14 Jul 2015 08:44 PM by Nick Gammon
Australia Forum Administrator #7
In the case of " ? " that means:

  • Zero or one spaces
  • Followed by one space


That could probably be better written as:

" +" - meaning one or more spaces.

As for the adverb, and I assume you don't want to list them all, you could make an optional "word", eg.


[A-Za-z]+(?: +[A-Za-z]+)? +(say|says|yells|tells you)


That makes the "word" in the brackets, with a preceding space, be optional (it has a "?" after the whole bracket).

The ?: stops it being turned into a capture (in case you already have capture numbers in use, which you don't appear to in this case).
#8
I'll be damned that worked, but I want to learn from this. Let me just break it apart.

match="^(\(.+\)\: )?[A-Za-z]+(?: +[A-Za-z]+)? +(say|says|yells|tells you|says to|asks), &quot;.+&quot;$"

(\(.+\)\: )?

says match a channel name with format (channel:) 0 or more times.

[A-Za-z]+

Match any string of letters/words at least once - its for the character's name in this case.


(?: +[A-Za-z]+)? +

The (?: +) says match this pattern but don't 'capture' for later use. The + says match the space before me at least once. The rest of the line says match any worlds/letters at least once. Finally, match whatever is in the ( ) 0 or more times and the last + says match the preceding 'space' 1 or more times.

Kinda crazy post, hope its understandable :P. Am I starting to get the hang of interpreting these regular expressions?


So if I wanted to trigger on this:
Acknu says in a deep, raspy voice, "Take a passage there.".

Id have to write under match= :
"^[A-Za-z]+(says)+(?: +[A-Za-za])?,?(?:[A-Za-z]), &quot;.+&quot;$"

Look right?
Amended on Fri 17 Jul 2015 03:56 AM by Brothfeder
#9
eer actually I think I mean:

match="^[A-Za-z]+ +(says) +(?: +[A-Za-za])?, +(?:[A-Za-z]), &quot;.+&quot;$"

for Acknu says in a deep, raspy voice, "Take a passage there."