Support Forums

Full Version: Xchat Python CurseKick
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

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)
LOL first nicley done, I needed to restart my PC to test it but I had fun with it!

I love it, almost kissed the screen :roflamo:
You don't mind if I use this script from time to time?
(11-19-2009, 06:42 PM)Nyx- Wrote: [ -> ]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.

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)

Good script
By the way, you sound like a pirate : "I just made me first xchat script today" Big Grin
(11-19-2009, 10:27 PM)nevets04 Wrote: [ -> ]Good script
By the way, you sound like a pirate : "I just made me first xchat script today" Big Grin

yea i just copy pasted from HF and had that typo there too lol, synny said i sound like a leprechaun
(11-19-2009, 09:51 PM)Master of The Universe Wrote: [ -> ]LOL first nicley done, I needed to restart my PC to test it but I had fun with it!

I love it, almost kissed the screen :roflamo:
You don't mind if I use this script from time to time?

yea no problem, and if you use Xchat, I can help you with Python xchat plugins that you think might be useful, and nevets04 is also learning with me ^__^
Nice dude!!!!!
Awesome script Smile You got to love Xchat's plugin interfaces
(11-20-2009, 12:04 PM)Nyx- Wrote: [ -> ]yea no problem, and if you use Xchat, I can help you with Python xchat plugins that you think might be useful, and nevets04 is also learning with me ^__^

Well I will remember that.... ;D

What do you have else.... I could need some.