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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ How to gag annoying players
How to gag annoying players
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2 3
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #15 on Sun 11 Apr 2004 10:52 AM (UTC) |
Message
| Nick:
I've got an unusual variation on the gag problem. I need a trigger/gag that 'keys' on the character's name, but will truncate the pose/say after X characters.
Why a gag...?
I need to chop off mega-posers who are posting buffer-blowing poses (1024+) to annoy other users, and then going ~past~ that and then extending their poses by using the spoofs.
Why just a truncate, not an outright 'suppress'...?
I need to see short poses, as one person knows I put a supress/gag up, and therefore can't see their comments. They are using that to talk 'behind my back' and their talk amounts to character assassination. I need to see/log those to report them.
Why will a truncate work...?
A friend dupe'd me his log of one instance I caught by overheard comments from others. From what I'd missed, the 'comments' are short enough to be caught within a 400 char buffer (adjustable would be good)
No scripts please, I have trouble enough with simple expression use. If you can post ~exact~ format using my name, I'd be grateful (I'm a poor programmer) We can't trigger on DBref#, thats why I'm using char-names to trigger (Tapestries)
This is what I am using for a full gag/supress: (using my name to replace the 'target')
WhiteWolf*
- Ignore Case, Keep Evaluating, & Omit from Output are set.
- covers say/pose/OOC comments.
* ) [ WhiteWolf ]
- Ignore Case, Keep Evaluating, & Omit from Output are set.
- this trigger'd on the spoof id area at end of spoofs (had to get the exact format/spacing)
And with permission, I'd like to post the 'format' to Tapestries Forum so others can use it (its a growing problem)
WhiteWolf | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #16 on Sun 11 Apr 2004 12:13 PM (UTC) |
Message
| can you gag the long lines? Or do you want anything longer to be truncated? I suppose itd be easy enough to trigger the long lines
a Regexp:
^[name and other stuff].{##1,##2}$
^ - start of a line
name - their name, plus any other formatting things.
. - regexp for 'any' character
##1 - Lower bound for the ammount of '.' (see above)
##2 - upper bound.
$ - End of a line
So, if you wanted to match on anything longer than say... 100 extra chars, but shorter than 200 (this is in addition to the name, etc, to figure your real length, just subtract)
you would have:
^Bob.{100,200}$
that would match on something that has Bob (yes it is K sens) and then 100-200 character after that.
you could use this to match on lines of length XX to YY (to remove a bound, simply dont put a number {,XX2} or {XX1,}.
If you wanted to remove the long lines completely, you could match, and then simply gag (perhaps write to a log file, or whatever, for later review).
If you wanted to truncate and still display, gag and then tell it back to the mud (youll lose color info, and the like). You COULD even truncate it with a regexp, rather than scripting.
^([name, etc])(.{100,200}).*$
and then you wouldnt need to truncate, as the .{100,200} would be a variable, with a certain length, and then the .* would be everything after that. Then youd just use the .{100,200} for your worldtell.
That last bit wasnt nessisarily supposed to make sense to you Whitewolf, just the next forum member who comes and actually writes a real trigger with a simple script. Im sure if I attempted it at 415am, it would cause more problems than its worth. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #17 on Sun 11 Apr 2004 11:21 PM (UTC) Amended on Sun 11 Apr 2004 11:22 PM (UTC) by Nick Gammon
|
Message
| What you need is a small script file, like this:
sub OnGagTrigger (name, line, wildcards)
ColourNote "white", "black", Left (line, 400)
end sub
Just those 3 lines, put into a file with notepad, and call it, say, "gag.vbs".
The "400" there is the number of characters that will be retained. The colours are the colour the line will be displayed, you can adjust those. Use the MUSHclient colour picker (Edit -> Colour Picker) to choose the names or codes for any other colours (eg. mistyrose on tomato).
Enable scripting in the script configuration tab, and browse for the script file above (gag.vbs). Language: VBscript.
Then paste this trigger in:
<triggers>
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="WhiteWolf"
omit_from_output="y"
regexp="y"
script="OnGagTrigger"
sequence="100"
>
</trigger>
</triggers>
This matches any line with WhiteWolf on it anywhere, omits it from the output, and then calls the script, which redisplays the first 400 characters.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #18 on Mon 12 Apr 2004 04:42 AM (UTC) Amended on Mon 12 Apr 2004 05:54 AM (UTC) by WhiteWolf
|
Message
| Uh, Nick... I said I aint a programmer.
Managed the gag.vbs file (placed in the scripts directory)
Found the Scripting Window, and got the 'enable' box toggled. That the only one I need to toggle?
From there I got confused, as I couldn't see where that second 'script' seemed to fit... but I realised it was just toggles for the Trigger window, as I'm using 3.42 (soon to be upgraded) and that must have been from an ancient version. There is no place to paste that in.
I've tested it, and it works perfectly. Now I just gotta adjust the colors (I use a white background...)
Thanks Nick.
One last Q:
OnGagTrigger is just the subroutine name, right? (starting to remember his Basic programming from HS) I could put any name in there? I've seen a few other possibilities for this... (making 200/300/400/etc. length ones)
And can I put all the subroutines in that selfsame 'gag.vbs' script? (thinking he's missed the possibilities of this client for too long)
-thinking he needs to go back & relearn some of this...
WhiteWolf | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #19 on Mon 12 Apr 2004 05:47 AM (UTC) |
Message
| Since you said you aren't a programmer I guessed you didn't already have a script file. Use the "Browse" button in the script configuration window to select your gag.vbs file, instead of any file that might already be listed there.
Quote:
OnGagTrigger is just the subroutine name, right? (starting to remember his Basic programming from HS) I could put any name in there?
Yes, any name, however it must agree between the script file and the trigger. Notice it appears in both places:
sub OnGagTrigger (name, line, wildcards)
ColourNote "white", "black", Left (line, 400)
end sub
... and in the trigger ...
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #20 on Mon 12 Apr 2004 05:49 AM (UTC) |
Message
|
Quote:
And can I put all the subroutines in that selfsame 'gag.vbs' script? (thinking he's missed the possibilities of this client for too long)
All the subroutines? How many do you have? The one I mentioned is the only one you need. However yes, if you are doing variations, they also go in that file. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #21 on Mon 12 Apr 2004 05:50 AM (UTC) |
Message
| Nick, why bother with a script file when it can be done in a regexp? Its cleaner, (and possibly faster?). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #22 on Mon 12 Apr 2004 06:08 AM (UTC) |
Message
| Mebbe I can answer that... even if I'm guessing.
I found the RegEx couldn't do a successful truncate AND do a color-flag at the same time, but the script can, as the trigger ~finds~ the target, but the sub does the truncate & color-flag. Don't ask me why...
I find flagging people I should ignore/avoid as grey on white helpful, just as I color-flag my pages & whispers, and a bunch of other items. I still haven't gotten the bugs out of the pages and whispers, as I need a generic 'name/word' wildcard.
As for Nick's question about 'all I need', I found I can 'clip' some of the annoying poses shorter than others, so could use a few 'clippers' with variable 'clip-buffer' lengths.
Yes, I could probably modify the existing sub a bit and do that, but lemme learn that slowly, 'k? Easier at this point to have a few very short 'clipper' subs.
Soon as I can scrape it up, I think I'm gonna get a reg key, as now that I've seen the ~distinct~ advantages (and the help) that 'support' offers for this client.
WhiteWolf | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #23 on Mon 12 Apr 2004 07:27 AM (UTC) |
Message
|
Quote:
Nick, why bother with a script file when it can be done in a regexp? Its cleaner, (and possibly faster?).
Er, using my approach of truncating in the script I needed to have it in a script file, however this trigger here will do it without scripting ...
<triggers>
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^(.*WhiteWolf.{1,200})"
omit_from_output="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%1</send>
</trigger>
</triggers>
What this does is match anything (any number of characters) before the word WhiteWolf, and then the first 200 characters *after* WhiteWolf, omits the line from output, and then sends to Output (the truncated bit).
So yes, this will do it without scripting.
The echoed line will be in the world.note colour, however you can change that in the scripting configuration tab.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #24 on Sun 02 May 2004 02:04 AM (UTC) Amended on Sun 02 May 2004 02:39 AM (UTC) by WhiteWolf
|
Message
| Nick, got another problem now.
My clipper-trigger hiccups every so often, and begin double-displaying the 'clipped' lines as two separate poses. I checked the trigger and the script subroutine, no changes.
When I turn the trigger off, the problem vanishes, so I know its trigger/sub related. Yes, the Omit From Output box is ticked.
Wait... should this be set 'Send To: Output', not 'send to World'? (all my triggers are set 'Send To: World'
And on the non-script Trigger:
match="^(.*WhiteWolf.{1,200})"
- nope, won't work, has to match name at beginning of line.
enabled="y"
custom_colour="2" (or whatever color I choose)
ignore_case="y"
keep_evaluating="y"
omit_from_output="y"
regexp="y"
- these are already set for the other scripted format.
send_to="2"
- no numbers, what does 2 relate to? Send To: Output?
sequence="100"
- I use another #...
<send>%1</send>
- totally lost here...
WhiteWolf
(using MushClient 3.47, wondering if it was 'recalled' as 3.45 is now back up...) | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #25 on Sun 02 May 2004 07:15 AM (UTC) |
Message
| Umm, Im not sure what youre asking exactly, but Ill go through your individual questions.
Yes, it should be send to output.
You SHOULD be able to copy/paste the trigger into MC to not have to worry about what each thing means, but here goes:
First one, If you want that trigger to match at the beginning of the line, remove the .* at the beginning. So, It'd be:
^(WhiteWolf.{1,2000})
Send to: 2
Yes, two is output. The number correlates to the position it is in the send to list (0 is the first).
Sequence: Triggers are evaluated in the order of their sequence. Lower numbers are evaluated before higher numbers. This is useful for having one trigger stop other triggers from firing.
the send thing, the <send></send> just delimits the stuff it sends. The %1 is the first wildcard of your match. (wildcards are surrounded by parenthesis, so in this case, its your whole trigger), %2 is the second, and so on. I believe you can have 999 wildcards now? It used to be 9.
Also, %0 is the WHOLE matching line.
|
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #26 on Sun 02 May 2004 07:42 AM (UTC) |
Message
| Thanks Flannel
Ok, that cleared a lot of it up, but I still don't see where the (send) %1 (/send) goes. It almost looks like HTML coding to me, and I dunno much HTML!
From Nick's formatting, it's still buried within the main Trigger edit/add window layout, but I cannot find a corresponding box... OH.
There are the three windows at the top:
Trigger: (where ya put the trigger sequence/expression)
Match: (not exactly sure what this does...)
Send: (put that HTML-like bit in here?)
WhiteWolf
(slowly catching on... I think) | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #27 on Sun 02 May 2004 07:49 AM (UTC) Amended on Sun 02 May 2004 07:57 AM (UTC) by Flannel
|
Message
| you JUST put the %1
the <send></send> isnt HTML, its XML, world files, and plugins are stored in it, it makes things easy.
The Match is for color matching (color) on (color).
you CAN just copy this:
<triggers>
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^(.*WhiteWolf.{1,200})"
omit_from_output="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%1</send>
</trigger>
</triggers>
all of that, from <triggers> to </triggers> and then go to the trigger page, and click paste. Itll add the trigger, just the same as adding it all by hand. Thats the beauty of the XML system.
This picture illustrates the paste button. (Yes, it is an alias, but Nick doesnt have one for a trigger)
http://www.gammon.com.au/images/alias_paste.gif |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| WhiteWolf
Canada (18 posts) Bio
|
Date
| Reply #28 on Sun 02 May 2004 08:00 AM (UTC) |
Message
| Ah... no-one told me that either.
Now the wierd format makes sense.
Oh: Is there a limit to the amount of triggers?
I ask as many are of the same type, just different names, and could be compiled with (name1|name2|name3|etc) right?
WhiteWolf
(his newbie beanie showing despite 3 years of use) | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #29 on Sun 02 May 2004 08:22 AM (UTC) |
Message
| No, there is no limit, well, your computers memory.
As for multiple triggers, If you mean can you paste multiple triggers with the | in between names, no.
Although, you can just have the matches be (X|Y|Z) (matches X, or Y, or Z)(regexp).
you could also do something like this:
<triggers>
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^(.*WhiteWolf.{1,200})"
omit_from_output="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%1</send>
</trigger>
***Copy From here***
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^(.*Flannel.{1,200})"
omit_from_output="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%1</send>
</trigger>
*** to here ***
</triggers>
You can just open a text file, paste out as many as you need (between <trigger and </trigger>, and edit them there, then copy the whole thing (<triggers> to </triggers>), and paste them. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | 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.
105,667 views.
This is page 2, subject is 3 pages long:
1
2 3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top