11-19-2009, 06:42 PM
I just made me first xchat script today, so go easy on me, and thanks to Fallen for helping me get this crap hehe
Usage:
/ck a swear - adds swear
/ck r swear -removes swear
/ck c - clears swear list
/ck p - prints swear list
And if you have OP (if not it will break, dont have that exception added since im always OP lol)it will set the channel +i(invite only), kick the user who swore, and 4 seconds later it will take the invite only off the channel.
Usage:
/ck a swear - adds swear
/ck r swear -removes swear
/ck c - clears swear list
/ck p - prints swear list
And if you have OP (if not it will break, dont have that exception added since im always OP lol)it will set the channel +i(invite only), kick the user who swore, and 4 seconds later it will take the invite only off the channel.
Code:
import xchat
__module_name__ = "CurseKick"
__module_version__ = '1.0'
__module_description__ = "Kicks on curse"
curses = ["Yoda"]
def text(word, word_eol, userdata):
global curses
for curse in curses:
if not word_eol[1].upper().find(curse) == -1:
xchat.command("mode +i")
xchat.command("kick " + word[0] + " None of that!")
xchat.hook_timer(4000, i)
return xchat.EAT_NONE
def i(userdata):
global curses
xchat.command("mode -i")
return xchat.EAT_ALL
def swear(word, word_eol, userdata):
global curses
if word[1] == "a":
curses.append(word[2].upper())
elif word[1] == "r":
try:
curses.remove(word[2])
except:
xchat.command("echo Swear word not in curse list")
elif word[1] == "c":
curses = curses[:]
elif word[1] == "p":
for curse in curses:
xchat.command("echo " + curse)
else:
xchat.command("echo You did not enter an option")
xchat.hook_print("Channel Message", text)
xchat.hook_command("ck", swear)