IPB

Welcome Guest ( Log In | Register )

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 
Reply to this topicStart new topic
> Phrase Plugin Non-Clan
Masterchief
post Sep 27 2009, 04:32 PM
Post #1


Get Pwned By me!
***

Group: Members
Posts: 420
Joined: 20-May 08
From: Some where in the USA
Member No.: 37,171



Hello,

I have the phrase kick plugin and I need it so it will not kick my members/safelisted people. If you could do that that would be great!

I had to post on this forum b/c it got this is the scripting forum? And there dont seem to be one on the other forum.

CODE
'pkick
'1.24
'&Phrase Kick:Damien
'&pkadd <word>:pklist:pkdel <word>:pkreset:pk <on/off>:pkstatus:pksafe <on/off>:pkword <on/off>:pkrelease <username>


'// ver 1.21 - Jack
'// *Removed call to CreateTimer


'//////////////////////////////////////////////////////
'//WARNINGS, USER GUIDE, AND ALL THAT OTHER FUN STUFF//
'//////////////////////////////////////////////////////
'
' +++ACKNOWLEDGEMENTS++
'
' -> Timebanning
' The timebanning method used in this plugin is inspired by raylu's brilliant
' dictionary-based timebanning method. Thanks raylu!
'
' +++WARNINGS+++
'
' -> AntiVirus Programs
' This plugin uses methods that may invoke the heuristics of some antivirus
' programs. If it gives you any trouble, just authorize the script. I promise
' that I didn't put anything harmful in here.
'
' +++USER GUIDE+++
'
' -> Basic Use
' This plugin can be accessed through the bot interface and through BNet via
' both normal chat and whispers. Through BNet, just use your trigger and the
' commands you can set in the settings below. Using my default command set and
' the exclamation mark trigger, here are examples of syntax:
'
' [Through BNet]
' !pkadd boop --> Adds a phrasekick word
' !pklist --> Lists all phrasekick words
' !pkdel boop --> Removes a phrasekick word
' !pkreset --> Resets all recorded infractions and timebans
' !pk on --> Turns on phrasekicking
' !pk off --> Turns off phrasekicking
' !pkstatus --> Tells you the status of the phrasekicker
' !pksafe on --> Turns on safelisted user exemption
' !pksafe off --> Turns off safelisted user exemption
' !pkword on --> Turns on word comprehension
' !pkword off --> Turns off word comprehension
' !pkrelease Damien --> Untimebans a user
'
' (Note that you can also do these through the bot console using the "/" trigger.)
'
' -> Safelisted User Exemption
' If you set the pkickSafe variable in the settings area to True, then by
' default, safelisted users won't even be considered for phrasekicking. You
' can change this on the fly, as shown above.
'
' -> Word Comprehension
' The bot is programmed by default to look for the phrasekickable words
' ANYWHERE in a talk Message. This means that if you put "ass" in your list,
' it will kick users who use the words "crass" or "grass" and so on. Be wary!
' If you want it to only recognize words that have spaces around them, set
' the pkickWordComp variable in the settings area to True.
'
' -> Advanced Notes
' This script is pretty simple, really. It uses two text files, one for the
' words and one for the users who have been kicked.
'

'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=- GENERAL DECLARATIONS (NO TOUCHY!!!) -=-=-
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Public pkickFSO
Public pkickFile
Public pkickBanFile
Public pkickLength
Public pkickLine
Public pkickArray() '//Array for storing the phrasekickable words
Public pkickUserArray '//Array that stores info about kicked users for comparison
Public pkickList
Public pkickDel
Public pkickSafe
Public pkickWordComp
Public pkickPermaBan
Public pkicktimeban
Public pkickUsers
Public pkickOn

'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=- SETTINGS -- CHANGE VALUES TO CHANGE BASIC OPTIONS -=-=-
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


'=== Filename for file with kickable words (root is StealthBot dir for all of these).
Public Const pkickfilepath = "plugins\phrasekicks.txt"

'=== Filename for file for recording phrasekicked users (for banning purposes).
Public Const pkickuserfilepath = "plugins\phrasekickusers.txt"

'=== Access required to change the phrasekick settings.
Public Const pkickAccess = 70

'=== Access required to list the phrasekickable words.
Public Const pkicklistAccess = 40

'=== Whether or not the phrasekicking is enabled by default.
pkickOn = True

'=== Whether or not safelisted users are exempt from kicking/banning by default.
pkickSafe = True

'=== Word Comprehension?
pkickWordComp = True

'=== Timeban for first repeat (in minutes)?
Public Const pkickRBan1 = 30

'=== Timeban for second repeat?
Public Const pkickRBan2 = 60

'=== Three strikes, you're out?
pkickPermaBan = False

'=== Timeban increment in minutes per offense if above is FALSE?
Public Const pkickRBan_Increment = 30


'//Command editing -- be careful! When changing these, PLEASE make all the
'//strings LOWERCASE, and make the first two letters of each the same! This
'//is important because it's involved in preventing you from being kicked for
'//using the remove command!!!

'=== Command key for adding phrasekickable words.
Public Const pkickAdd_command = "pkadd"

'=== Command key for removing phrasekickable words.
Public Const pkickDel_command = "pkdel"

'=== Command key for listing phrasekickable words.
Public Const pkickList_command = "pklist"

'=== Command key for resetting the phrasekicked and timebanned users list.
Public Const pkickReset_command = "pkreset"

'=== Command key for removing a user from the timeban.
Public Const pkickUserRemove_command = "pkrelease"

'=== Command phrase for turning phrasekicking on.
Public Const pkickOn_command = "pk on"

'=== Command phrase for turning phrasekicking off.
Public Const pkickOff_command = "pk off"

'=== Command phrase for checking phrasekicking status.
Public Const pkickStatus_command = "pkstatus"

'=== Command phrase for disabling safelisted user exemption.
Public Const pkickUnsafe_command = "pksafe off"

'=== Command phrase for resetting the phrasekicked users list.
Public Const pkickSafe_command = "pksafe on"

'=== Command phrase for enabling word comprehension.
Public Const pkickWordOn_command = "pkword on"

'=== Command phrase for disabling word comprehension.
Public Const pkickWordOff_command = "pkword off"


'////////////////////////////////////////////////////////////////
'//THE GUTS -- NO MORE BASIC ADJUSTMENTS CAN BE MADE BELOW HERE//
'////////////////////////////////////////////////////////////////


Sub pkick_Event_Load()

Set pkicktimeban = CreateObject("Scripting.Dictionary")
Set pkickFSO = CreateObject("Scripting.FileSystemObject")

'//Loading initial list from file and resetting kicked user list
Call pkickRefresh

TimerInterval "pkick", "pkickTimer", 1
TimerEnabled "pkick", "pkickTimer", True
End Sub


Sub pkick_Event_UserTalk(Username, Flags, Message, Ping)

Dim pkickCount, pkickRUser

GetDBEntry Username, myAccess, myFlags

If left(lcase(Message), 3) <> BotVars.Trigger & Left(pkickAdd_command, 2) And pkickOn Then
Call pkickEnforcer(Username, Message)
End If

If Left(Message, 1) <> BotVars.Trigger Then '//If trigger not there, no command has been passed
Exit Sub
End If

If left(lcase(Message), Len(pkickUserRemove_command) + 1) = BotVars.Trigger & pkickUserRemove_command And myAccess >= pkickAccess Then
pkickRUser = Mid(Len(pkickUserRemove_command) + 3)
If pkicktimeban.Exists(LCase(pkickRUser)) Then
pkicktimeban.Remove(LCase(pkickRUser))
AddQ "/unban " & psD2 & pkickRUser, 7
AddQ "/rejoin", 7
AddQ "/w " & psD2 & Username & " User released from trouble."
Else
AddQ "/w " & psD2 & Username & " No such user is in trouble...yet."
End If
End If

If lcase(Message) = BotVars.Trigger & pkickOn_command And myAccess >= pkickAccess Then
pkickOn = True
AddQ "/w " & psD2 & Username & " Phrasekicking on."
ElseIf lcase(Message) = BotVars.Trigger & pkickOff_command And myAccess >= pkickAccess Then
pkickSafe = False
AddQ "/w " & psD2 & Username & " Phrasekicking off."
End If

If LCase(Message) = BotVars.Trigger & pkickStatus_command And myAccess >= pkickAccess Then
If Ping = -1337 Then
Call pkickStatus(Username, 1)
Else
Call pkickStatus(Username, 0)
End If
End If

If lcase(Message) = BotVars.Trigger & pkickUnsafe_command And myAccess >= pkickAccess Then
pkickSafe = False
AddQ "/w " & psD2 & Username & " Phrasekicking safelisted user exemption disabled."
ElseIf lcase(Message) = BotVars.Trigger & pkickSafe_command And myAccess >= pkickAccess Then
pkickSafe = True
AddQ "/w " & psD2 & Username & " Phrasekicking safelisted user exemption enabled."
End If

If lcase(Message) = BotVars.Trigger & pkickWordOn_command And myAccess >= pkickAccess Then
pkickWordComp = True
AddQ "/w " & psD2 & Username & " Phrasekick word comprehension enabled."
ElseIf lcase(Message) = BotVars.Trigger & pkickWordOff_command And myAccess >= pkickAccess Then
pkickWordComp = False
AddQ "/w " & psD2 & Username & " Phrasekick word comprehension disabled."
End If

If lcase(Message) = BotVars.Trigger & pkickReset_command and myAccess >= pkickAccess Then
Set pkickFile = pkickFSO.CreateTextFile(BotPath() & pkickuserfilepath, True)
pkickFile.Close
pkicktimeban.RemoveAll()
AddQ "/rejoin", 7
AddQ "/w " & psD2 & Username & " Phrasekicked user list reset."
End If

If left(lcase(Message), Len(pkickAdd_command) + 1) = BotVars.Trigger & pkickAdd_command And myAccess >= pkickAccess Then
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 8, True)
pkickFile.WriteLine Mid(Lcase(Message), Len(pkickAdd_command) + 3)
pkickFile.Close
Call pkickRefresh
AddQ "/w " & psD2 & Username & " New phrasekick entry added."
End If

If lcase(Message) = BotVars.Trigger & pkickList_command And myAccess >= pkicklistAccess Then
Call pkickRefresh
AddQ "/w " & psD2 & Username & " PKick list:" & pkickList
End If

If left(lcase(Message), Len(pkickDel_command) + 1) = BotVars.Trigger & pkickDel_command And myAccess >= pkickAccess Then
pkickDel = Mid(Message, Len(pkickDel_command) + 3)
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 2, True)
For pkickCount = 0 To pkickLength - 1
If lcase(pkickArray(pkickCount)) <> lcase(pkickDel) Then
pkickFile.WriteLine pkickArray(pkickCount)
Else
AddQ "/w " & psD2 & Username & " Phrasekick item '" & pkickDel & "' has been removed from the list."
pkickDel = "DAMIENISTHECOOLEST"
End If
Next
If pkickDel <> "DAMIENISTHECOOLEST" Then AddQ "/w " & psD2 & Username & " Phrasekick item not found."
pkickFile.Close
Call pkickRefresh
End If

End Sub


Sub pkick_Event_WhisperFromUser(Username, Flags, Message)

If Left(Message, 1) <> BotVars.Trigger Then '//If trigger not there, no command has been passed
Exit Sub
End If

Call pkick_Event_UserTalk(Username, Flags, Message, -1337)

End Sub


Sub pkick_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatstring)

Call pkick_TimeBanner(Username, 0, "Check", True) '//Checks to see if timeban exists on user

End Sub


Sub pkick_Event_PressedEnter(Text)

Dim pkickCount, pkickRUser

If left(lcase(Text), Len(pkickUserRemove_command) + 1) = "/" & pkickUserRemove_command Then
pkickRUser = Mid(Text, Len(pkickUserRemove_command) + 3)
If pkicktimeban.Exists(LCase(pkickRUser)) Then
pkicktimeban.Remove(LCase(pkickRUser))
AddQ "/unban " & pkickRUser, 7
AddQ "/rejoin", 7
AddQ "/w " & psD2 & Username & " User released from trouble."
Else
AddQ "/w " & psD2 & Username & " No such user is in trouble...yet."
End If
VetoThisMessage
End If

If lcase(Text) = "/" & pkickOn_command Then
pkickOn = True
AddChat vbGreen, "Phrasekicking enabled."
VetoThisMessage
ElseIf lcase(Text) = "/" & pkickOff_command Then
pkickOn = False
AddChat vbGreen, "Phrasekicking disabled."
VetoThisMessage
End If

If LCase(Text) = "/" & pkickStatus_command Then
Call pkickStatus(Username, 2)
VetoThisMessage
End If

If lcase(Text) = "/" & pkickUnsafe_command Then
pkickSafe = False
AddChat vbGreen, "Phrasekicking safelisted user exemption disabled."
VetoThisMessage
ElseIf lcase(Text) = "/" & pkickSafe_command Then
pkickSafe = True
AddChat vbGreen, "Phrasekicking safelisted user exemption enabled."
VetoThisMessage
End If

If lcase(Text) = "/" & pkickWordOn_command Then
pkickWordComp = True
AddChat vbGreen, "Phrasekick word comprehension enabled."
VetoThisMessage
ElseIf lcase(Text) = "/" & pkickWordOff_command Then
pkickWordComp = False
AddChat vbGreen, "Phrasekick word comprehension disabled."
VetoThisMessage
End If

If lcase(Text) = "/" & pkickReset_command Then
Set pkickFile = pkickFSO.CreateTextFile(BotPath() & pkickuserfilepath, True)
pkickFile.Close
pkicktimeban.RemoveAll()
AddQ "/rejoin", 7
AddChat vbGreen, "Phrasekicked user list reset."
VetoThisMessage
End If

If left(lcase(Text), Len(pkickAdd_command) + 1) = "/" & pkickAdd_command Then
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 8, True)
pkickFile.WriteLine Mid(Lcase(Text), Len(pkickAdd_command) + 3)
pkickFile.Close
Call pkickRefresh
AddChat vbGreen, "New phrasekick entry added."
VetoThisMessage
End If

If lcase(Text) = "/" & pkickList_command Then
Call pkickRefresh
AddChat vbGreen, "PKick list:" & pkickList
VetoThisMessage
End If

If left(lcase(Text), Len(pkickDel_command) + 1) = "/" & pkickDel_command Then
pkickDel = Mid(Text, Len(pkickDel_command) + 3)
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 2, True)
For pkickCount = 0 To pkickLength - 1
If lcase(pkickArray(pkickCount)) <> lcase(pkickDel) Then
pkickFile.WriteLine pkickArray(pkickCount)
Else
AddChat vbGreen, "PhraseKick item '" & pkickDel & "' has been removed from the list."
pkickDel = "DAMIENISTHECOOLEST"
End If
Next
If pkickDel <> "DAMIENISTHECOOLEST" Then
AddChat vbGreen, "PhraseKick item not found."
End If
pkickFile.Close
Call pkickRefresh
VetoThisMessage
End If

End Sub


'//////////Timers//////////

Sub pkick_pkickTimer_Timer() '//Checks timebans once every second

If pkicktimeban.Count > 0 Then
Dim pkicktbArray, pkickCounter
pkicktbArray = pkicktimeban.Keys
For pkickCounter = 0 To UBound(pkicktbArray)
pkicktimeban.Item(pkicktbArray(pkickCounter)) = pkicktimeban(pkicktbArray(pkickCounter)) - 1
If pkicktimeban.Item(pkicktbArray(pkickCounter)) <= 0 Then
pkicktimeban.Remove pkicktbArray(pkickCounter)
AddQ "/unban " & pkicktbArray(pkickCounter), 7
AddQ "/rejoin", 7
End If
Next
End If

End Sub

'//////////Custom Subs and Functions//////////

Sub pkickRefresh '//Refreshes the phrasekick array

Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 1, True)
pkickLength = 0
pkickList = ""
While Not pkickFile.AtEndOfStream
pkickLine = pkickFile.ReadLine
pkickLength = pkickLength + 1
Wend
pkickFile.Close
ReDim pkickArray(pkickLength)
pkickLength = 0
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickfilepath, 1)
While Not pkickFile.AtEndOfStream
pkickLine = pkickFile.ReadLine
pkickArray(pkickLength) = pkickLine
pkickList = pkickList + " " + pkickLine
pkickLength = pkickLength + 1
Wend
pkickFile.Close

End Sub


Sub pkickStatus(Username, Origin) '//Reports on the status of phrasekicking

Dim pkickString

If pkickOn Then
pkickString = "Phrasekicking is on. "
Else
pkickString = "Phrasekicking is off. "
End If

If pkickSafe Then
pkickString = pkickString & "Safelisted user exemption is on. "
Else
pkickString = pkickString & "Safelisted user exemption is off. "
End If

If pkickWordComp Then
pkickString = pkickString & "Word comprehension is on. "
Else
pkickString = pkickString & "Word comprehension is off. "
End If

pkickString = pkickString & CStr(pkicktimeban.Count) & " users are timebanned."

If Origin = 0 Then
AddQ pkickString
ElseIf Origin = 1 Then
AddQ "/w " & psD2 & Username & " " & pkickString
ElseIf Origin = 2 Then
AddChat vbGreen, pkickString
End If

End Sub


Sub pkickEnforcer(Username, Message) '//Checks to see if a violation has been made (The Judge)

Dim pkickCount, pkickLevel, pkickLevel_temp, pkickPhrase, Offender

pkickLevel = 0
pkickLevel_temp = 0
Offender = False

If (IsSafelisted(Username) Imp Not pkickSafe) Then '//This logical argument was a biznatch at first!
For pkickCount = 0 To (pkickLength - 1)
pkickLevel_temp = 0
If ((InStr(1, LCase(Message), LCase(pkickArray(pkickCount))) > 0) And Not pkickWordComp) Or (pkickWordComp And pkickWordComp_Check(Username, Message, pkickArray(pkickCount))) Then
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickuserfilepath, 1, True)
While Not pkickFile.AtEndOfStream
pkickLine = pkickFile.ReadLine
pkickUserArray = Split(pkickLine)
If lcase(pkickUserArray(0)) = lcase(Username) And lcase(pkickUserArray(1)) = lcase(pkickArray(pkickCount)) Then
pkickLevel_temp = pkickLevel_temp + 1
End If
Wend
Set pkickFile = pkickFSO.OpenTextFile(BotPath() & pkickuserfilepath, 8, True)
pkickFile.WriteLine Username & " " & pkickArray(pkickCount)
If pkickLevel_temp >= pkickLevel Then
pkickPhrase = pkickArray(pkickCount)
pkickLevel = pkickLevel_temp
End If
Offender = True
pkickFile.Close
End If
Next
End If

If Offender Then
Select Case pkickLevel
Case 0
AddQ "/kick " & psD2 & Username & " Phrasekick: " & pkickPhrase & ". WARNING: Timeban for repeat offenses.", 7
Case 1
Call pkick_TimeBanner(Username, pkickRBan1, pkickPhrase, False)
Case 2
Call pkick_TimeBanner(Username, pkickRBan2, pkickPhrase, False)
Case Else
If pkickPermaBan Then
AddQ "/ban " & psD2 & Username & " Permabanned for repeating: " & pkickPhrase & ". You must now beg a clan leader to let you in.", 7
Else
Call pkick_TimeBanner(Username, pkickRBan2 + (pkickRBan_Increment * pkickLevel), pkickPhrase, False)
End If
End Select
End If

End Sub


Function pkickWordComp_Check(Username, Message, Phrase) '//Checks to see ifit's a whole word (The Expert Witness)

Dim pkickWCArray, pkickCount

pkickWCArray = Split(Message)

'//Checks to see if it's a complete word
For pkickCount = 0 To UBound(pkickWCArray)
If LCase(pkickWCArray(pkickCount)) = LCase(Phrase) Then
pkickWordComp_Check = True
Exit Function
End If
Next
pkickWordComp_Check = False

End Function


Sub pkick_TimeBanner(Username, Minutes, Phrase, IsChecking) '//Timebans (The Executioner)

If IsChecking Then
If pkicktimeban.Exists(LCase(Username)) Then
AddQ "/ban " & psD2 & Username & " You are still timebanned for " & CStr(CInt(pkicktimeban.Item(LCase(Username)) / 60)) & " minutes repeat phrasekicking offenses.", 7
Exit Sub
Else
Exit Sub
End If
Else
pkicktimeban.Add LCase(Username), Minutes * 60
AddQ "/ban " & psD2 & Username & " Timebanned for " & Minutes & " minutes for repeating: " & Phrase & ".", 7
End If

End Sub


Thanks!


--------------------
IPB Image
IPB Image

IPB Image
Need help with Hdx Warden Proxy? Do it the easy way: Click here
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Sep 27 2009, 05:06 PM
Post #2


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Please don't bump.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Masterchief
post Sep 30 2009, 02:18 PM
Post #3


Get Pwned By me!
***

Group: Members
Posts: 420
Joined: 20-May 08
From: Some where in the USA
Member No.: 37,171



Its been 3 days. Can anybody edit this?

Its been 3 days. Can anybody edit this?


--------------------
IPB Image
IPB Image

IPB Image
Need help with Hdx Warden Proxy? Do it the easy way: Click here
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Sep 30 2009, 02:25 PM
Post #4


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



What did I say about not bumping? Don't do it again. You've been around long enough to know the explanation of why stuff doesn't get made or edited.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th September 2019 - 01:17 AM
Skin by Andrea
Website Legal Information | Hosted by LunarPages