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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  achaea chat redirecting
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

achaea chat redirecting

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


Posted by Brothfeder   (16 posts)  [Biography] bio
Date Sat 11 Jul 2015 07:29 AM (UTC)

Amended on Sun 12 Jul 2015 04:11 AM (UTC) by Brothfeder

Message
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.
[Go to top] top

Posted by Brothfeder   (16 posts)  [Biography] bio
Date Reply #1 on Sat 11 Jul 2015 12:08 PM (UTC)
Message
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."
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 11 Jul 2015 09:46 PM (UTC)
Message
That looks like a regular expression, but you have not checked the "regexp" box.

- Nick Gammon

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

Posted by Brothfeder   (16 posts)  [Biography] bio
Date Reply #3 on Sun 12 Jul 2015 04:27 AM (UTC)
Message
The 2nd trigger never had one to my knowledge.
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Mon 13 Jul 2015 02:22 PM (UTC)
Message
Well you need it now, because you made a regexp pattern.

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Mon 13 Jul 2015 08:28 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Brothfeder   (16 posts)  [Biography] bio
Date Reply #6 on Mon 13 Jul 2015 09:35 PM (UTC)

Amended on Tue 14 Jul 2015 08:44 PM (UTC) by Nick Gammon

Message
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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Tue 14 Jul 2015 08:49 PM (UTC)
Message
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).

- Nick Gammon

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

Posted by Brothfeder   (16 posts)  [Biography] bio
Date Reply #8 on Fri 17 Jul 2015 03:46 AM (UTC)

Amended on Fri 17 Jul 2015 03:56 AM (UTC) by Brothfeder

Message
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?
[Go to top] top

Posted by Brothfeder   (16 posts)  [Biography] bio
Date Reply #9 on Fri 17 Jul 2015 03:57 AM (UTC)
Message
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."
[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.


4,218 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 FutureQuest]