Help - Search - Members - Calendar
Full Version: [RESOLVED]Change Swent's ACS plugin to Timeban
StealthBot.net > StealthBot > Scripting and Plugins > Tutorials & FAQs > Tutorial Queue
OmegaFalcon
So I am currently using Swent's acsAntiCommandSpam script, and would like to know how to change the punishment from a kick, ban, or shitadd, to a 30 second timeban. I have the timban script so I figured it would be a simple line or 2 change in the script to make it run the timban command instead of one of the others. Help from Swent or anyone else who knows what they're doing would be helpful, since I cannot figure it out. Here's the script"

QUOTE
'acs
'1.0
'&Anti-Command Spam:Swent
'&
'&7696
'&If you want to disable command spam kicking, type /acs off:To change the forum of punishment (kick/ban/shitadd), open up acsAntiCommandSpam.plug using Notepad, and change the acs_punish_cmd setting

'// -- Program Settings --

'// Form of punishment
'// 1 = kick
'// 2 = ban
'// 3 = shitadd
Const acs_punish_cmd = 1

'// Squelching
'// Set to False if you don't want spammers squelched
Const acs_squelch = False

'// ----------------------

Set acsCmdLog = CreateObject("Scripting.Dictionary")

Sub acs_Event_Load()

End Sub


Sub acs_Event_UserTalk(Username, Flags, Message, Ping)

'// Do they have less than 45 access?
GetDBEntry Username, myAccess, myFlags
If myAccess >= 45 Then Exit Sub

'// Are they typing a command?
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub

'// Get the command
If Len(Message) < 2 Then Exit Sub
cmdName = Split(Mid(Trim(Message & " "), 2))(0)

'// If they use the same command 3 times with less than 15 seconds between each command, punish them
If acsCmdLog.Exists(Username) Then
If acsCmdLog.Item(Username)(0) = cmdName And Timer() - acsCmdLog.Item(Username)(1) < 15 Then
If acsCmdLog.Item(Username)(2) = 2 Then
arrCmds = Split("kick|ban|shitadd", "|")
Call Command(BotVars.Username, "/scq", True)
Command BotVars.Username, "/" & arrCmds(acs_punish_cmd - 1) & " " & Username & _
" Spamming the " & BotVars.Trigger & cmdName & " command.", True
If acs_squelch Then Command BotVars.Username, "/squelch " & Username, True
End If
acsCmdLog.Item(Username) = Array(cmdName, Timer(), 2)
Exit Sub
End If
acsCmdLog.Item(Username) = Array(cmdName, Timer(), 1)
Else
acsCmdLog.Add Username, Array(cmdName, Timer(), 1)
End If
End Sub


EDIT: Being able to change it to use the warn script would also help.
Swent
Replace
CODE
Command BotVars.Username, "/" & arrCmds(acs_punish_cmd - 1) & " " & Username & _
" Spamming the " & BotVars.Trigger & cmdName & " command.", True
with
CODE
Call Event_PressedEnter("/timeban " & Username & " 30 Spamming the " & BotVars.Trigger & cmdName & " command.")
OmegaFalcon
Drat I was so close, I pulled the code from your anti-spam plugin, but in there you had Call timeban_Event_PressedEnter. That worked now, thanks. What about if I wanted to use the warn command? Just replacing /timeban with /warn doesn't work...
Swent
Try this:
CODE
Call Event_PressedEnter(BotVars.Trigger & "warn " & Username & " 1 Spamming the " & BotVars.Trigger & cmdName & " command.")
OmegaFalcon
Sorry to bump this, but I just finally found this topic again and to my pleasant surprise Swent responded. The change to warn worked like a charm as well, thnx bunches, lol. =)
Swent
I have marked this topic as resolved. If you did not receive a satisfactory response, please reply and provide as much detail as possible.
Swent
This question has been asked frequently and therefore I request that a tutorial be made to assist users in the future.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.