Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xchat Python CurseKick
#1
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)
[Image: sig.php]
Reply
#2
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?
Reply
#3
(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
Reply
#4
(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 ^__^
[Image: sig.php]
Reply
#5
Nice dude!!!!!
Reply
#6
Awesome script Smile You got to love Xchat's plugin interfaces
[Image: nv70ad.png]
Terrorcore, unleash, extermination
Hyper real, cold blood, determination
fudge them, I like this sensation
Incredible, I from the annihilation
Reply
#7
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Help Dεlluzion 3 2,006 09-30-2019, 12:59 AM
Last Post: samsmith001
  Simple Python Python Compiler Canoris 21 9,180 06-01-2011, 06:30 PM
Last Post: Filefinder
  Python 2 vs 3? Jake 8 2,666 12-11-2010, 04:13 PM
Last Post: Bursihido
  Python help Kharnage 2 896 02-12-2010, 09:07 PM
Last Post: Kharnage
  "==" and "is" in Python Canoris 1 851 02-07-2010, 03:55 PM
Last Post: uber1337

Forum Jump:


Users browsing this thread: 1 Guest(s)