Trying to set up a Mini-Window

Posted by Rannick on Thu 03 Jan 2019 10:10 PM — 11 posts, 37,237 views.

USA #0
Hiya folks!

So I am trying to convert the mini-window plugin written by Fiendish to be able to work with the MUSH I am playing on, as found here: http://www.gammon.com.au/forum/bbshowpost.php?id=10728&page=1

The mush I am playing uses Chat Channels such as:
<General>, <Code>, <+Tech>

I am also trying to capture the Pages that get sent to me, and the ones I send out. All forms of communication have the ability to accept a "pose". Meaning that on the channel a person could do a pose, which would omit the usual: <General> Alfie says, "go Marlins!" and instead would be <General> Alfie cheers on the Marlins.

Pages are similar to that, but don't have the say/s portion for that direct communication.

If you need more examples of the Channels, I can post them.

What have I tried to do? Simple, convert the You say/tell/ooc to the channels. However, I am thinking that the open and close carrots <> are causing a problem with this. :S

Here is an example of the converted trigger:
<trigger
enabled="y"
match="<General>"
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

Any help you can give me, would be much appreciated!

Thanks in advance!
USA Global Moderator #1
You're correct about the <>. Plugins are XML files, so you have to play nice with the quirks of the XML parser.

Replace "<General>" with "&lt;General&gt;"

You'll also either want to throw * on the end of that or convert it to a regular expression match, because otherwise it won't fire if anything comes after the channel tag. MUSHclient's non-regex matching requires that the pattern matches the entire line, not just part of it.
Amended on Fri 04 Jan 2019 12:09 AM by Fiendish
USA #2
Thank you Fiendish, I thought that was the case, but LUA is vastly different in someways over zScript (zMud, cMud). :) I'll be tinkering with that when I get home and have access to the plugin I set up there. :)
Australia Forum Administrator #3
Strictly speaking these are different things. XML is used in MUSHclient to import/save world files, and also for copying things like triggers to the clipboard. Lua (not LUA - it is a name not an acronym) is one of the programming languages used to write scripts in.

Since XML has a special meaning for the characters "< > &" then any XML file needs to change those to &lt; &gt; and &amp; respectively.

There is an action in the inbuilt editor (press Ctrl+Alt+Space to get an editor window) which will do that for you. If you paste some text into an editor window, and then select it and choose Convert -> Convert HTML special, then those characters will be converted for you.
USA #4
Thank you very much Nick, I'll give that a shot! :D
USA #5
Now, with a Mush, you can pose into pages, and coming from a MUD, I guess it is similar to a Tell, but with the option for emoting an action. Still can't get the mini window to grab the chat channels, yet. On the subject of the pages though, I have no idea where I'm going wrong with it. I'm basically copying something that I know to work, finger for example, and trying to apply it to the pages like this:

<trigger
enabled="y"
match="* just fingered you."
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

<trigger
enabled="y"
match="Long distance to * "
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

<trigger
enabled="y"
match="From afar,"
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

<trigger
enabled="y"
match="* (*) pages:"
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

<trigger
enabled="y"
match="pages: *"
script="chats"
omit_from_output="y"
sequence="100"
></trigger>

<trigger
enabled="y"
match="You page *: * "
script="chats"
omit_from_output="y"
sequence="100"
></trigger>
Australia Forum Administrator #6
Can you post (copy/paste) examples of what you think should be matching those triggers, and doesn't?
Australia Forum Administrator #7
This one, for example:


match="From afar,"


That is only going to match "From afar," and not anything else, like "From afar, Nick smiles".
USA #8
For the pages with posing:
From afar, Rannick (Rannick) Test
Long distance to Rannick, Hoshi Test

For vanilla Paging:
Rannick (Rannick) pages: Test
You page Rannick: Test

Some people have an alias with their name set, and that will show up in the parenthesis. Most do not though.
USA Global Moderator #9
As Nick says, your trigger patterns are set up incorrectly for MUSHclient.
It looks like you hit a common trap for people coming from other clients.

Nick has a page here about how trigger patterns work (among other details):
https://www.mushclient.com/scripts/doc.php?general=triggers

My wiki also has a section specifically describing the conflict between different clients:
https://github.com/fiendish/aardwolfclientpackage/wiki/Writing-Triggers#i-tried-making-a-trigger-but-it-isnt-firing-what-did-i-do-wrong
Amended on Thu 17 Jan 2019 01:29 PM by Fiendish
Australia Forum Administrator #10
A simple thing to change for that trigger is to add a wildcard, eg.


From afar, *


That asterisk matches whatever follows "From afar, ". Similarly for other triggers. For example:


"* (*) pages:


Should be:


"* (*) pages: *