|
Kronus Wanderer
Joined: 13 Jan 2002 Posts: 76 Location: USA
|
Posted: Sun Jan 13, 2002 5:34 pm
Spam protector scripting |
Ok, I don't know how many of you have ever tried the built in Spam protector, but for me, it has yet to work. So I attemtpting to script my own, and here is the concept. Make a #trigger that fires after a single phrase is repeated any number of times, when it fires it gags that phrase. Here's the problem. I don't know how to set up the trigger to do that. If any one can give me a push in the right direction, I would be most grateful.
|
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Sun Jan 13, 2002 9:09 pm |
1) Make a trigger that captures everything
2) Make a LastLine variable
3) The trigger should check to see if the current line is equal to the last line. If it is, increment a counter. If the counter is over some spam value then gag it. If not, reset the counter to zero and assign the lastline variable.
You could make it a little more sophisticated by ignoring prompt lines and maybe blank lines, for instance. Or by storing several recent lines and checking each of them.
-Tarn |
|
|
|
Kronus Wanderer
Joined: 13 Jan 2002 Posts: 76 Location: USA
|
Posted: Mon Jan 14, 2002 4:37 am |
Thats the idea, but I should have been more specific, I don't know how to do any of the above stated, I know how to create Triggers, Variables, and what not. But geting the last line and matching it with the first line, and a counter is a bit over my head for now. Oh and to throw a monkey wrench into the whole ordeal, I play primarily on MUSHs, and for those of you who MUSH and do soft coding, know that some of the special characters of zMUD conflict with special characters of MUSH coding, really can't have both going at one time, at least not that I have found. Any ways, to recap the above, I need a bit more detail for it to be of any help, but thanks for summerizing what I wanted
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 14, 2002 2:43 pm |
Ok try using this:
#TRIGGER {(%*)} {#IF (@LastLine = %line) {#ADD counter 1} {#VAR counter 0};#VAR LastLine "%1";#IF;#IF (@counter > 10) {#GAG}}
What this trigger does is to first check a variable - @LastLine - which the has set before, agaisnt the line that fired this trigger. If they match, we add one to the variable @counter. If it doesn't match, we reset @counter back to 0.
After setting the counter, then trigger puts the line that fired it into @LastLine. This is done so the next time the trigger fires, it has the line stored to match it agaisnt the new line received from the MUD. Now, we check to see if the counter has reached its limit. If it is bigger than 10, that means we have had 10 consecutive identical lines and we begin #GAGging. Until the lines stop repeatig (and thus, the counter gets set back to 0) this conditional will be true and zMUD will keep #GAGging lines.
One final comment: notice the use of %* in the pattern. This works the same as * - matching everything - but it also matches zMUD's special characters.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jan 14, 2002 8:15 pm |
What problem are you having with the built-in spam protector? I use it and it seems quite reliable in version 6.16. How do you have it set and what version are you using?
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|