Support Forums
Bleh, dont care. - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32)
+---- Thread: Bleh, dont care. (/showthread.php?tid=3024)



Bleh, dont care. - Nyx- - 11-19-2009

I made a python script for Xchat that sets the channel mode +i(invite only), then it kicks the user you enter(word_eol[1]), pauses for 4 seconds, and then sets the channel mode -i. Its so people with Auto kick rejoin cant. But my problem is whenever I run it, it works, but it gives me this error:

TypeError: ik() takes exactly 2 arguments (3 given)

the only thing i can think of is because there is 2 xchat.command's in ik, but it still runs both so why even give such a lame error?
Code:
import xchat

__module_name__ = "InviteKick"
__module_version__ = "1.0"
__module_description__ = "+i, kick, pause, -i"

knick = None
def ik(word_eol, userdata):
    global knick
    knick = word_eol[1]
    xchat.command("mode +i")
    xchat.command("kick" + knick)
    xchat.hook_timer(4000, i)
    return xchat.EAT_ALL
def i(userdata):
    xchat.command("mode -i")
    return xchat.EAT_ALL
xchat.hook_command('ik', ik)



RE: Xchat Python Script - uber1337 - 11-19-2009

maybe its the
Code:
xchat.hook_command('ik', ik)