StealthBot.net: AntiSpam - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

AntiSpam by Awakening

#1 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 07, 2010 - 12:31 AM

AntiSpam Script

by AwaKening

Current Version: 1.1.4


Description:
Monitor the speed at which users are sending messages. A user can be warned x number of times before punishment. Repeated and longer messages are taken into consideration.

Settings:
(All settings can be found in scripts.ini)

sensitivity
0 being least sensitive and 6 being the most sensitive (decimals can now be used)
This setting basically equates to the average number of seconds between messages
Longer messages and repeats will play into the equation as well
Default = 2.5

warnings
How many warnings to issue before punishment
Default = 2

warnMessage
Message to issue with warning (%u=username, %w=Warned/allowed EG 1/2)
Default = Antispam Warning (%w) for %u

warnDecay
Decay 1 warning from user every x minutes since last offense
Default = 10

resetWarns
Yes/No to reset users warnings after punishment
Default = No

punishment
Message used to punish offenders (kick, ban, timeban)
Must have the timeban script to use timeban
%u=username, %w=Warned/Allowed (Don't use %w if warnings=0)
Default = /kick %u Sending messages too quickly

immunity
Flag or Access level for immune users
Default = 70

Commands:
(Note: any commands passed with an invalid or NO argument will display current setting)

aslevel
List or set the sensitivity level

asimmunity
List or set flags/access immunity

aswarnings
List or set the the maximum warnings

aswarndecay
List or set minutes per warn decay

Additional Notes:
- Messages will be ignored if bot doesn't hold Ops
- This is not an update of Swent's asAntiSpam. (Disable any other antispam scripts)
- If you're looking for a bot Command detection, then use my CSS script

Changelogs:
' 1.1.4 August 7th, 2010
'     - Changed sensitivity levels to basically match up with seconds between messages
' 1.1.3 July 24th, 2010
'     - Will now start checking for spam as soon as 3 messages and check time from last 4
'     - Added priority to warning messages
'     - Fixed warnDecay and warnings settings commands
'     - Fixed warnings display where it wasn't counting up
' 1.1.2 July 14th, 2010
'     - Fixed param error on initial load (only affected new installs not upgrades)
' 1.1.1 July 9th, 2010
'     - Fixed isimmune access levels where access was equal
'     - More sensitivity tweaking, and now checks message length of last 3
'     - Can now use decimals in sensitivity levels (0-6)
'     - Changed self ops Checking method
'     - Removed cleanSkip Variable (clean every 30 seconds now)
' 1.1.0 July 7th, 2010
'     - Combined functions (warn and punish)
'     - Now passing Flags to spamcheck sub and checking there
'     - Added ability to list multiple Flags in immunity setting
'     - Added command aslevel to set/check sensitivity via chat
'     - Added command asimmunity to set/check immunity flag/access
'     - Added command aswarnings to set/check allowed warnings
'     - Added command aswarndecay to set/check the warnDecay minutes
' 1.0.1 July 6th, 2010
'     - Tweaked the sensitivity
'     - Added Setting warndecay


Copy/Paste the code below, or save the attached file in your scripts folder.

Spoiler



Attached File(s)



#2 User is offline   Be-Eazie Icon

  • Newbie
  • PipPip
  • Group: Members
  • Posts: 34
  • Joined: September-04 09

Posted July 07, 2010 - 02:48 AM

Thanks Awakening,. Useful Script

#3 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 07, 2010 - 05:14 AM

Updated to tweak the sensitivity. Even lower settings seemed to trigger a warning quite frequently. Also added another setting for warndecay Posted Image

I tested quite a bit and the sensitivity settings seem to work pretty good now.

#4 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 07, 2010 - 07:36 PM

Added commands to change most of the settings via chat.
Also made it so you can list multiple flags to immunity.

#5 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 10, 2010 - 07:06 AM

- Fixed isimmune access levels. Users with access equal to setting weren't being ignored.
- More sensitivity tweaking, and now checks message length of last 3 messages from the user
- Can now use decimals in sensitivity levels (0-6) and anything in that range
- Changed self ops Checking method (nothing you'd really notice)
- Removed cleanSkip Variable (also nothing you'll really notice)

The major change here is the sensitivity. By making fractions of a number usable, there shouldn't be a need for me to make sensitivity adjustments to the code at all from here on out. I also raised the maximum from 5 to 6. Not recommended unless you really want a quiet channel ;)

#6 User is offline   smkyros Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 39
  • Joined: December-13 09

Posted July 14, 2010 - 03:52 PM

Im about to test this out but I just hit reload scripts after putting it in my scripts folder for the first time and heres what I have so far. Did not tweak any of the settings yet.


[11:49:57 AM] AwaKening's AntiSpam: Updated to 1.1.1
[11:49:59 AM] Scripting runtime error '500' in antispam: (line 271; column 2)
[11:50:00 AM] Variable is undefined: 'param'
[11:50:01 AM] Offending line: >>
[11:50:02 AM] Scripting runtime error '500' in antispam: (line 271; column 2)
[11:50:04 AM] Variable is undefined: 'param'
[11:50:05 AM] Offending line: >>
[11:50:07 AM] CRS Script:. Checking commands and creating if neccesary ... This may take a few minutes; ignore the Script-Control pop-up.
[11:50:08 AM] CRS Script:. Script is ready to use. Please view the commands in the Command Manager for descriptions, syntax, and command aliases.
[11:50:10 AM] Shaman Rotation is Active
[11:50:15 AM] Scripting runtime error '424' in antispam: (line 236; column 1)
[11:50:16 AM] Object required: 'Users'
[11:50:18 AM] Offending line: >>
[11:50:19 AM] Scripting runtime error '424' in antispam: (line 236; column 1)
[11:50:20 AM] Object required: 'Users'
[11:50:22 AM] Offending line: >>

#7 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 14, 2010 - 04:45 PM

Thanks for the report. Apparently I made a typo in the last update. Only affected brand new installs, which is why I didn't catch it on my upgrade. Redownload, should work now.

#8 User is offline   smkyros Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 39
  • Joined: December-13 09

Posted July 14, 2010 - 05:11 PM

Jesus that was fast. :)

I was wondering if I could make a special request. You probably wouldnt want to incorporate it in your main script but if you can just give me the addition and tell me where to paste it I can add it in myself. What I would like yet is if the /kick comes back as You can't kick a channel operator, then run /demote %u and /kick %u again. Basically the reason for this, I have some shamans that like to rant as well and since I have shaman rotation, even if they get demoted, when their time is back up that they can rotate back in it wont matter again. Plus all of my shamans pretty much can do all the same things without being a shaman they just all like the gold bars. Lol. I was just wondering if there was a way to do that. :)

#9 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 14, 2010 - 09:26 PM

Will take a bit of recoding, but it can be done. I don't have time atm, but send me a PM to remind me and I'll try to customize it for you later.



#10 User is offline   Fallen-God Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 364
  • Joined: September-11 09

Posted July 14, 2010 - 10:38 PM

View PostAwaKening, on 14 July 2010 - 10:26 PM, said:

Will take a bit of recoding, but it can be done. I don't have time atm, but send me a PM to remind me and I'll try to customize it for you later.

Please bear in mind I am on my phone far away from my PC and can't see either the script or the wiki to get the correct function, but you must have something like:
addq "/" & Punishment & " " & username

Again, I realise it will be better and stringformat or whatever, but something which at heart does that.
Just change to:
if (clan.members(username).rank = 3) then clan.demote(username)
addq "/" & Punishment & " " & username

I don't know the realse sub/function: but would that not work?
Choose Functional.

#11 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 15, 2010 - 01:49 AM

channel operators don't even call to the function that checks in the first place. I have to remove some checks for ops before he can add that code; not to mention you'll grab an error by checking the clan object with a username that doesn't exist. You've got the right idea, but needs a bit more than that.

Ok, so for the code. First find the following line in the spamCheck sub and delete it.
Spoiler


Next, find the TakeAction Sub and replace it with this code:
Spoiler


This should make it demote them only for punishments and not for warnings.



#12 User is offline   smkyros Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 39
  • Joined: December-13 09

Posted July 15, 2010 - 03:56 AM

Wow. Thanks a lot awakening. I just got home from work. I have added it. So far still no errors popping up however I don't have any shamans online atm to test it out. I will let you know by tomorrow morning. For punishment was what I wanted anyways so thats fine. Thanks again. :) I saw you posted in my scripts request too havent gotten a chance to read it. Hopefully good news in there. I'm eager. :)

#13 User is offline   Telrin Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 13
  • Joined: March-26 10

Posted July 23, 2010 - 09:27 PM

View Postsmkyros, on 15 July 2010 - 04:56 AM, said:

Wow. Thanks a lot awakening. I just got home from work. I have added it. So far still no errors popping up however I don't have any shamans online atm to test it out. I will let you know by tomorrow morning. For punishment was what I wanted anyways so thats fine. Thanks again. :) I saw you posted in my scripts request too havent gotten a chance to read it. Hopefully good news in there. I'm eager. :)


i think i found a glitch,
sometimes when it kicks a user, the warn count messes up.

[02:22:04 PM] spamtester#2 was kicked out of the channel by DotaCash (Antispam Warning (2/4)).
[02:22:04 PM] -- spamtester#2 has left the channel.
[02:22:07 PM] Invalid user.


and then i tried to spam again,

[02:23:46 PM] <spamtester#2> spam234
[02:23:46 PM] <spamtester#2> b
[02:23:46 PM] <spamtester#2> c
[02:23:47 PM] spamtester#2 was banned by DotaCash (Sending messages too quickly).

it banned on the 3/4 instead of 4/4

any ideas whats causing this?

#14 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 24, 2010 - 03:19 AM

View PostTelrin, on 23 July 2010 - 03:27 PM, said:

i think i found a glitch,
sometimes when it kicks a user, the warn count messes up.

[02:22:04 PM] spamtester#2 was kicked out of the channel by DotaCash (Antispam Warning (2/4)).
[02:22:04 PM] -- spamtester#2 has left the channel.
[02:22:07 PM] Invalid user.


and then i tried to spam again,

[02:23:46 PM] <spamtester#2> spam234
[02:23:46 PM] <spamtester#2> b
[02:23:46 PM] <spamtester#2> c
[02:23:47 PM] spamtester#2 was banned by DotaCash (Sending messages too quickly).

it banned on the 3/4 instead of 4/4

any ideas whats causing this?


I'll take a look at it tomorrow. I wanted to tweak it to track 4 messages instead of 3 anyways, so check back later for an update.

#15 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted July 24, 2010 - 11:58 PM

So I found the problem with the warnings. It was tracking correctly, but displaying wrong. Updated to fix that plus a few other bugs and adjustments (v1.1.3)

#16 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted August 08, 2010 - 02:34 AM

Update 1.1.4

More sensitivity tweaking. Now the sensitivity is in close relationship of time between messages. Sensitivity 3 would mean that a user could only type a message every 3 seconds (averaged). Other factors do still come into play however; such as repeats and longer messages.

#17 User is offline   petar Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: August-12 10

Posted January 29, 2011 - 01:33 PM

i want to ask something can i set immunity to more then 1 player ? i type .asimmunity name and when i do it once more it adds normal but when i type .asimmunity
to see who have immunity it show me just 1 name

and immunity dont work....
i tryed .asimmunity and when that played spam it kicks him 2

k i fixed it myself.

This post has been edited by petar: January 29, 2011 - 01:46 PM


#18 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted January 29, 2011 - 10:40 PM

View Postpetar, on January 29, 2011 - 06:33 AM, said:

i want to ask something can i set immunity to more then 1 player ? i type .asimmunity name and when i do it once more it adds normal but when i type .asimmunity
to see who have immunity it show me just 1 name

and immunity dont work....
i tryed .asimmunity and when that played spam it kicks him 2

k i fixed it myself.


immunity is a flag or access level, NOT a username

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users