예제 #1
0
def filter_msg(word, word_eol, userdata):
    """Filters join and part messages"""
    user = xchat.strip(word[0])
    # If the user just joined, add him to the dict and mark him as such
    if 'Join' in userdata:
        if user not in last_seen:
            last_seen[user] = [time(), 0]
            return xchat.EAT_XCHAT
    # If the user changed his nick, check if we've been tracking him before
    # and transfer his stats if so. Otherwise, add him to the dict.
    elif 'Nick' in userdata:
        user = xchat.strip(word[1])
        old = xchat.strip(word[0])
        if old in last_seen:
            last_seen[user] = last_seen[old]
            del last_seen[old]
        else:
            last_seen[user] = [time(), 0]
    # If the user logged in before we did (no entry of him yet), don't display
    # his part messages
    if user not in last_seen:
        return xchat.EAT_XCHAT
    # If the user has never spoken, or has spoken too long ago, eat his part
    # or join messages.
    if last_seen[user][1] == 0 or last_seen[user][0] + user_timeout < time():
        return xchat.EAT_XCHAT
예제 #2
0
def moar(word, word_eol, userdata):
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if command == "#moar":
        text = xchat.strip(word[1].split(' ', 1)[1])
        send_message(
            channel,
            jeffk(aol("moaarrr %s!!! MMMOOOOOAAAAAARRRRRRRR!!!" % text)))
예제 #3
0
def get_args(word):
    try:
        command = xchat.strip(word[1].split(' ', 1)[0]).rstrip()
    except IndexError:
        command = None
    try:
        username = xchat.strip(word[1].split(' ', 1)[1]).rstrip()
    except IndexError:
        username = None
    return command, username
def chanmessage(word, word_eol, userdata):
	nick = word[0]
	message = word[1]
	if (xchat.nickcmp(xchat.strip(nick), "B") == 0 or xchat.nickcmp(xchat.strip(nick), "BridgeBabe") == 0) and message.startswith("("):		
		name = "." + message[1:message.index(')')]
		message = message[message.index(')') + 2:]
		mode = name[1] if name[1] in "@+&~%" else ""

		xchat.emit_print(userdata, name, message, mode)
		return xchat.EAT_ALL
	return xchat.EAT_NONE
예제 #5
0
def get_args(word):
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        args = word[1].strip().split(' ', 2)[2].split('*')
        args = [xchat.strip(v) for v in args]
    except IndexError:
        args = None
    return user, action, args
예제 #6
0
def get_args(word):
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        arg = xchat.strip(word[1].strip().split(' ', 2)[2])
        #~ arg = args.split(' ', 1)
    except IndexError:
        arg = None
    return user, action, arg
예제 #7
0
def get_args(word):
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        arg = xchat.strip(word[1].strip().split(' ', 2)[2])
        #~ arg = args.split(' ', 1)
    except IndexError:
        arg = None
    return user, action, arg
예제 #8
0
def chan_command(word, word_eol, userdata):
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if channel.lower() in data.allowed_chans:
        user, action, arg = get_args(word)
        if command == "#d":
            if action in data.commands:
                if action == data.commands[0]:
                    if arg:
                        send_message(channel, add_device(user, arg))
                    else:
                        send_message(channel, "Usage: #d add <device>")
                elif action == data.commands[1]:
                    if arg:
                        send_message(channel, rem_device(user, arg))
                    else:
                        send_message(channel, "Usage: #d remomve <device_id>")
                elif action == data.commands[2]:
                    if arg:
                        send_message(channel, list_devices(arg))
                    else:
                        send_message(channel, "Usage: #d list <user>")
                elif action == data.commands[3]:
                    if arg:
                        send_message(channel, search_devices(arg))
                    else:
                        send_message(channel, "Usage: #d search <device>")
            elif action:
                arg = action
                send_message(channel, list_devices(arg))
예제 #9
0
def chan_command(word, word_eol, userdata):
    channel = xchat.get_info("channel")
    command = xchat.strip(word[1].split(" ", 1)[0])
    if channel.lower() in data.allowed_chans:
        user, action, title, content = get_args(word)
        if command == "#f":
            if action in data.commands:
                if action == data.commands[0]:
                    if title and content:
                        c.execute("DELETE FROM facts WHERE title=?", (title,))
                        c.execute("INSERT INTO facts VALUES (?, ?)", (title, content))
                        conn.commit()
                    else:
                        send_message(channel, "Error inserting fact into database - specified title/content?")
                elif action == data.commands[1]:
                    if title:
                        c.execute("DELETE FROM facts WHERE title=?", (title,))
                        conn.commit()
                    else:
                        send_message(channel, "Error removing fact from database - specified title?")
                elif action == data.commands[2]:
                    c.execute("SELECT * FROM facts")
                    msg = "\00306"
                    for row in c.fetchall():
                        msg = "".join([msg, '\003: \00302"'.join(row), '"\003, \00306'])
                    send_message(channel, msg[:-6])
        elif command == "#give":
            fact = getfact(title)
            if fact:
                send_message(channel, "%s: %s" % (action, fact))
        elif command.startswith("#"):
            title = command[1:]
            fact = getfact(title)
            if fact:
                send_message(channel, "\00307" + fact)
예제 #10
0
파일: rnb.py 프로젝트: b0nk/scriptsNconfs
def make_a_rainbow(word, word_eol, userdata):

  original = XC.strip(word_eol[1])
  sequence = ['04', '07', '08', '03', '12', '02', '06']
  length = len(original)
  counter = len(sequence)
  colored = ''
  COLOR = '\003'
  i = 0
  num = 0

  while(i <= length - 1):

    if(i >= counter):
      num = i - counter

      while(num >= counter):
        num -= counter

    else:
      num = i

    tmp = COLOR + sequence[num] + original[i]
    colored = colored + tmp
    i += 1

  XC.command('say %s' % (colored + COLOR))
예제 #11
0
def steiner(text, text_eol, userdata):
	ignore = ['swim', 'seventyNexus', 'SeventyTwo', 'Noxialis', 'ChanServ', 'cocaine', 'Ultimation_', 'roofletrain', 'Serpentine', 'hachimitsu-boy', 'whatapath', 'YourImaginaryFriend', 'RocketLauncher', 'Onee-chan', 'Fijou', 'DarkAceLaptop', 'GayServ', 'zingas', 'rpk', 'qb', 'mkillebrew', 'whoapath', 'guymann', 'Doomfag', 'maws', 'cunnelatio', 'DenSaakalte', 'martian', 'irc', 'cyberdynesystems', 'net', 'somberlain', 'PhilKenSebben', 'kyokugen', 'Erotica', 'mechanicalTurk', 'ed', 'anon__', 'E-Pain', 'thenoize', 'skew', 'StoneColdSteveAustin', 'frussif', 'Ultimation', 'charles', 'i7MUSHROOM', 'slamm', 'h**o', 'Hypnotized', 'Dr_Venture', 'AoC', 'Porygon', 'axujen', 'Jax', 'Special-G', 'peopleschampion', 'LtSerge', 'Dwarf', 'pinetreegator', 'Cap', '[^_^]', 'swam', 'Clear', 'takoyaki', 'keret', 'MeanPocket', 'keref', 'hachi', 'vortmax', 'War', 'Hachi-chan', 'JediDachshund', 'BillGates', 'BTDT', 'kk', 'guy9000', 'Erzengel', 'Revived', 'BradPitt', 'Colink', 'ekOz', 'Jynweythek']
	steiner = ""
	
	nick = xchat.strip(text[0]).translate(str.maketrans("", "", "+%@&~"))
	if nick in ignore or "ScottSteiner" not in xchat.get_info("nick"): return
	if text[1] == "nothing gayer":
		steiner = "than {}".format(nick)
	elif re.search("nothin(?:g(?:'s|)|)gayer", text[1]):
		steiner = "{} is a f****t".format(nick)
	elif re.search("nothin(?:g(?:'s|)|) finer than", text[1]) or text[1] == "no one kinder than":
		steiner = "Scott Steiner"
	elif re.search("nothin(?:g(?:'s|)|) finer", text[1]) or text[1] == "no one kinder":
		steiner = "than Scott Steiner"
	elif text[1] == "nothing is finer":
		steiner = "than {} being a dumbfuck inbred retard who still can't into a simple script".format(nick)
	elif text[1] == "big poppa pump":
		steiner = "IS YOUR HOOKUP. HOLLER IF YA HEAR ME"
	
	if steiner:
		print("{0}<{1}{0}> {2}".format("\x0307", text[0],text[1]))
		xchat.get_context().command("say {}".format(steiner))
		global steinerhook, steinertimer
		xchat.unhook(steinerhook)
		steinertimer = xchat.hook_timer(60000, steinertoggle) 
		steinerhook = None
		return xchat.EAT_XCHAT
예제 #12
0
def fake(word, word_eol, userdata):
    my_nick = xchat.get_info('nick')
    try:
        topic = word_eol[1]
    except:
        xchat.prnt("fake_log_image.py Error: Invalid arguments!"
                   )  #add error func later
    else:
        nicklist = [xchat.strip(user.nick) for user in xchat.get_list('users')]
        network = xchat.get_info('network')
        chan = xchat.get_info('channel')
        fake_log_image_generator(nicklist, network, chan, my_nick, topic)
        if UPLOAD_TO_IMGUR:
            try:
                import pyimgur
            except ImportError:
                xchat.prnt(
                    "[!] fake_log_image.py Error: pyimgur module not found!")
            else:
                client_id = ''
                im = pyimgur.Imgur(client_id)
                uploaded_image = im.upload_image(
                    PATH + NEW_FILENAME,
                    title="100 PERCENT AUTHENTIC REAL LOGS")
                lnk = uploaded_image.link
                lnk = lnk.replace('http', 'https')
                xchat.command("say I just took a screenshot of this chat: " +
                              lnk)
    return xchat.EAT_ALL
예제 #13
0
def new_msg(word, word_eol, userdata):
    """Handles normal messages.

    Unless this is the first user's message since he joined, the message will
    not be altered. Otherwise, a '(logged in Xs ago)' message will be appended.

    """
    user = xchat.strip(word[0])
    # If the user logged in before we did (which means the Join part of
    # filter_msg didn't take effect), add him to the dict.
    if user not in last_seen:
        last_seen[user]= [time(), 1]
    # If the user has never spoken before, let us know when he logged in.
    if last_seen[user][1] == 0:
        time_diff = time() - last_seen[user][0]
        # Bold the username and color the text if it's a hilight
        if "Hilight" in userdata:
            s_user = "******" + word[0]
            s_msg = "\017\00319" + word[1]
        else:
            s_user = word[0]
            s_msg = "\017" + word[1]
        if "Action" in userdata:
            s_user = "******" % s_user
        else:
            s_user += '\t'
        xchat.prnt("%s%s \00307(logged in %ss ago)" % (s_user, s_msg,
                                                         int(time_diff)))
        last_seen[user]= [time(), 1]
        return xchat.EAT_XCHAT
    else:
        last_seen[user]= [time(), 1]
예제 #14
0
def chan_command(word, word_eol, userdata):
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if channel.lower() in data.allowed_chans:
        user, action, arg = get_args(word)
        if command == "#d":
            if action in data.commands:
                if action == data.commands[0]:
                    if arg:
                        send_message(channel, add_device(user, arg))
                    else:
                        send_message(channel, "Usage: #d add <device>")
                elif action == data.commands[1]:
                    if arg:
                        send_message(channel, rem_device(user, arg))
                    else:
                        send_message(channel, "Usage: #d remomve <device_id>")
                elif action == data.commands[2]:
                    if arg:
                        send_message(channel, list_devices(arg))
                    else:
                        send_message(channel, "Usage: #d list <user>")
                elif action == data.commands[3]:
                    if arg:
                        send_message(channel, search_devices(arg))
                    else:
                        send_message(channel, "Usage: #d search <device>")
            elif action:
                arg = action
                send_message(channel, list_devices(arg))
예제 #15
0
def get_args(word):
    """ Extracts arguments from the message.
    
    Returns: The calling user, the specified action and extra args
    
    """
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        args = word[1].strip().split(' ', 2)[2].split(' ')
        args = [xchat.strip(v) for v in args]
    except IndexError:
        args = None
    return user, action, args
예제 #16
0
def get_args(word):
    """ Extracts arguments from the message.
    
    Returns: The calling user, the specified action and extra args
    
    """
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        args = word[1].strip().split(' ', 2)[2].split(' ')
        args = [xchat.strip(v) for v in args]
    except IndexError:
        args = None
    return user, action, args
예제 #17
0
def join_cb(word, word_eol, userdata):
	global joined
	global channel_name
	
	if xchat.nickcmp(xchat.get_info("channel"), channel_name) != 0:
		return xchat.EAT_NONE
		
	joined.append(xchat.strip(word[0]))
	return xchat.EAT_NONE
예제 #18
0
def shoot2(person):
	if g2.shoot():	
		reason = random_reason("\x02{0}\x02".format(g2.name))
		channel = (xchat.get_context()).get_info("channel")
		person = xchat.strip(person)
		if g2.action(channel):
			xchat.command("raw kill {0} {1} (\x02{2}\x02/\x02{3} Bullets\x02 - {4})".format(person, reason, g2.bullets+1, len(g2.chambers), channel))
		else:
			xchat.command("kickban {0} {1}".format(person, reason))
			xchat.command("invite {0} {1}".format(person, channel))
		g2.reset()
예제 #19
0
def new_msg(word, world_eol, userdata):
    """Adds messages to the network/channel they belong to, so we can use them
    later:
    networks = {network: {channel: [timestamp, nickname, message]}}
          e.g.  freenode  #mychan    s. since  "mynick"  "hello"
                                    the epoch

    The time stamp, nickname and message are added as three separate list
    entries.

    """
    channel = xchat.get_info("channel")
    network = xchat.get_info("network")
    if network not in networks:
        networks[network] = {}
    if channel not in networks[network]:
        networks[network][channel] = []
    user = xchat.strip(word[0])
    msg = xchat.strip(word[1])
    networks[network][channel].append([time(), user, msg])
예제 #20
0
def new_msg(word, world_eol, userdata):
    """Adds messages to the network/channel they belong to, so we can use them
    later:
    networks = {network: {channel: [timestamp, nickname, message]}}
          e.g.  freenode  #mychan    s. since  "mynick"  "hello"
                                    the epoch

    The time stamp, nickname and message are added as three separate list
    entries.

    """
    channel = xchat.get_info("channel")
    network = xchat.get_info("network")
    if network not in networks:
        networks[network] = {}
    if channel not in networks[network]:
        networks[network][channel] = []
    user = xchat.strip(word[0])
    msg = xchat.strip(word[1])
    networks[network][channel].append([time(), user, msg])
예제 #21
0
def title(word, word_eol, userdata):
    channel = xchat.get_info('channel').lower()
    if channel in allowed_chans:
        urls = re.findall("(?<!<)http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]"
                          "|[!*\(\),]|(?:%[0-9a-fA-F]"
                          "[0-9a-fA-F]))+", xchat.strip(word_eol[0]))
        if len(urls) > 0:
            context = xchat.get_context()
            pool = ThreadPool(processes=1)
            pool.apply_async(gettitle, (urls, pool, context),
                             callback=send_message)
예제 #22
0
def shoot(person):
	if g.shoot():	
		reason = random_reason(g.name)
		channel = (xchat.get_context()).get_info("channel")
		person = xchat.strip(person)
		if g.action(channel):
			xchat.command("raw kill {0} {1} ({2})".format(person, reason, channel))
		else:
			xchat.command("kickban {0} {1}".format(person, reason))
			xchat.command("invite {0} {1}".format(person, channel))
		g.reset()
		g.load(1)
예제 #23
0
def title(word, word_eol, userdata):
    channel = xchat.get_info('channel').lower()
    if channel in allowed_chans:
        urls = re.findall(
            "(?<!<)http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]"
            "|[!*\(\),]|(?:%[0-9a-fA-F]"
            "[0-9a-fA-F]))+", xchat.strip(word_eol[0]))
        if len(urls) > 0:
            context = xchat.get_context()
            pool = ThreadPool(processes=1)
            pool.apply_async(gettitle, (urls, pool, context),
                             callback=send_message)
예제 #24
0
def process_youtube_urls(msg, nick, dest=None):
	# TODO: do a findall() on word_eol and loop in the returned list to process all urls
	m = re.match("^.*(https?://(www.)?((youtube.com/)|(youtu.be/))[?&=a-zA-Z0-9_-]*).*$",xchat.strip(msg),re.I)
	if m != None:
		DEBUG and xchat.prnt("msg: "+xchat.strip(msg))
		url = m.group(1)
		DEBUG and xchat.prnt("url: "+url)
		task = Thread() #TODO: task.daemon = True
		def task_func():
			decipher_youtube_url(url,nick,msg,dest)
		task.run = task_func
		task.start()
	return xchat.EAT_NONE
예제 #25
0
파일: growl.py 프로젝트: BFCatalin/plugins
def growlnotify(_type, title, desc='', pri=0):
	if xchat.get_prefs('away_omit_alerts') and xchat.get_info('away'):
		return

	if xchat.get_prefs('gui_focus_omitalerts') and xchat.get_info('win_status') == 'active':
		return

	try:
		growl.notify(
			noteType=_type,
			title=xchat.strip(title),
			description=xchat.strip(desc),
			icon=hexchatlogo,
			sticky=False,
			priority=pri
		)
	except:
		global lasterrtime
		# Avoid more spam, 1 error a min.
		if lasterrtime + 60 < time():
			xchat.prnt('Growl Error: Growl is not running.')
		lasterrtime = time()
예제 #26
0
def get_args(word):
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(" ", 2)[1])
    except IndexError:
        action = None
    try:
        args = xchat.strip(word[1].strip().split(" ", 2)[2])
        args = args.split(" ", 1)
    except IndexError:
        args = None
    if args:
        try:
            arg1 = args[0]
        except IndexError:
            arg1 = None
        try:
            arg2 = args[1]
        except IndexError:
            arg2 = None
    else:
        arg1 = None
        arg2 = None
    return user, action, arg1, arg2
예제 #27
0
파일: define.py 프로젝트: BFCatalin/plugins
def define(word, word_eol, userdata):

	if len(word) >= 2:
		_word = xchat.strip(word[1])
		_number = 1
		if len(word) >= 3:
			_number = int(xchat.strip(word[2]))
	else:
		xchat.prnt('Define Usage: /define word [number]')
		xchat.prnt('	number being alternate definition')
		return xchat.EAT_ALL

	url="http://www.google.com/dictionary/json?callback=s&q=" + _word + "&sl=en&tl=en&restrict=pr,de&client=te"
	obj=urllib.urlopen(url);
	content=obj.read()
	obj.close()
	content=content[2:-10]
	dic=ast.literal_eval(content)
	if dic.has_key("webDefinitions"):
		webdef=dic["webDefinitions"]
		webdef=webdef[0]
		webdef=webdef["entries"]
		index=1

		for i in webdef:
			if index == _number:
				if i["type"]=="meaning":
					ans=i["terms"]
					op=ans[0]['text']
					split=op.split(';')
					xchat.prnt(_word + ': ' + split[0].strip())
			index+=1
		return xchat.EAT_ALL
	else:
		xchat.prnt('Description unavailable for ' + _word)
		return xchat.EAT_ALL
예제 #28
0
def get_args(word):
    user = xchat.strip(word[0])
    try:
        action = xchat.strip(word[1].split(' ', 2)[1])
    except IndexError:
        action = None
    try:
        args = xchat.strip(word[1].strip().split(' ', 2)[2])
        args = args.split(' ', 1)
    except IndexError:
        args = None
    if args:
        try:
            arg1 = args[0]
        except IndexError:
            arg1 = None
        try:
            arg2 = args[1]
        except IndexError:
            arg2 = None
    else:
        arg1 = None
        arg2 = None
    return user, action, arg1, arg2
예제 #29
0
def define(word, word_eol, userdata):

    if len(word) >= 2:
        _word = xchat.strip(word[1])
        _number = 1
        if len(word) >= 3:
            _number = int(xchat.strip(word[2]))
    else:
        xchat.prnt('Define Usage: /define word [number]')
        xchat.prnt('	number being alternate definition')
        return xchat.EAT_ALL

    url = "http://www.google.com/dictionary/json?callback=s&q=" + _word + "&sl=en&tl=en&restrict=pr,de&client=te"
    obj = urllib.urlopen(url)
    content = obj.read()
    obj.close()
    content = content[2:-10]
    dic = ast.literal_eval(content)
    if dic.has_key("webDefinitions"):
        webdef = dic["webDefinitions"]
        webdef = webdef[0]
        webdef = webdef["entries"]
        index = 1

        for i in webdef:
            if index == _number:
                if i["type"] == "meaning":
                    ans = i["terms"]
                    op = ans[0]['text']
                    split = op.split(';')
                    xchat.prnt(_word + ': ' + split[0].strip())
            index += 1
        return xchat.EAT_ALL
    else:
        xchat.prnt('Description unavailable for ' + _word)
        return xchat.EAT_ALL
예제 #30
0
def colorize_message(word, word_eol, userdata):
    """
    Callback for message printing events. Scans contents of a message for both
    URLs and nicks and colorizes them. This colorized output is sent along to the
    client
    """
    if len(word) < 2:
        return xchat.EAT_NONE

    message = word[1]

    # This prevents recursive printing
    if is_colorized(message):
        return xchat.EAT_NONE

    current_channel = xchat.get_info('channel')

    # Private messages - the channel is the nick
    if not current_channel.startswith('#'):
        nicks = [current_channel, xchat.get_info('nick')]
    else:
        nicks = [u.nick for u in xchat.get_list('users')]

    # Only perform nick coloring if the setting is enabled
    if color_enabled():
        output = []

        # Split up the message delimited by a possible nick
        for token in nick_pat.split(message):
            if token in nicks:
                token = colorize_string(token)
            output.append(token)

        output = ''.join(output)
    else:
        output = message

    # Colorize URLs
    for url in url_pat.findall(output):
        output = output.replace(url, '\037\00328%s\017' % xchat.strip(url, len(url), 3))

    # This is a bit of a hack where we tag the message with a non-printing
    # color so we don't recurse forever
    if not is_colorized(output):
        output = '%s%s' % (output, colorize_string(''))
    xchat.command('gui color 2')
    xchat.emit_print(userdata, word[0], output)
    return xchat.EAT_ALL
예제 #31
0
def handler(word, word_eol, userdata):
    """ Handles the different commands. """
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if command in triggers:
        user, action, args = get_args(word)
        if not action:
            ffa(user, channel)
        elif action in actions:
            if action == actions[0]:  # challenge
                challenge(channel, user, args)
            elif action == actions[1]:  # challenge_reset
                send_message(channel, user, challenge_reset(user))
            elif action == actions[2]:  # help
                for msg in help_messages:
                    send_message(channel, user, msg)
예제 #32
0
def handler(word, word_eol, userdata):
    """ Handles the different commands. """
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if command in triggers:
        user, action, args = get_args(word)
        if not action:
            ffa(user, channel)
        elif action in actions:
            if action == actions[0]: # challenge
                challenge(channel, user, args)
            elif action == actions[1]: # challenge_reset
                send_message(channel, user, challenge_reset(user))
            elif action == actions[2]: # help
                for msg in help_messages:
                    send_message(channel, user, msg)
예제 #33
0
def steiner(text, text_eol, userdata):
    ignore = [
        'swim', 'seventyNexus', 'SeventyTwo', 'Noxialis', 'ChanServ',
        'cocaine', 'Ultimation_', 'roofletrain', 'Serpentine',
        'hachimitsu-boy', 'whatapath', 'YourImaginaryFriend', 'RocketLauncher',
        'Onee-chan', 'Fijou', 'DarkAceLaptop', 'GayServ', 'zingas', 'rpk',
        'qb', 'mkillebrew', 'whoapath', 'guymann', 'Doomfag', 'maws',
        'cunnelatio', 'DenSaakalte', 'martian', 'irc', 'cyberdynesystems',
        'net', 'somberlain', 'PhilKenSebben', 'kyokugen', 'Erotica',
        'mechanicalTurk', 'ed', 'anon__', 'E-Pain', 'thenoize', 'skew',
        'StoneColdSteveAustin', 'frussif', 'Ultimation', 'charles',
        'i7MUSHROOM', 'slamm', 'h**o', 'Hypnotized', 'Dr_Venture', 'AoC',
        'Porygon', 'axujen', 'Jax', 'Special-G', 'peopleschampion', 'LtSerge',
        'Dwarf', 'pinetreegator', 'Cap', '[^_^]', 'swam', 'Clear', 'takoyaki',
        'keret', 'MeanPocket', 'keref', 'hachi', 'vortmax', 'War',
        'Hachi-chan', 'JediDachshund', 'BillGates', 'BTDT', 'kk', 'guy9000',
        'Erzengel', 'Revived', 'BradPitt', 'Colink', 'ekOz', 'Jynweythek'
    ]
    steiner = ""

    nick = xchat.strip(text[0]).translate(str.maketrans("", "", "+%@&~"))
    if nick in ignore or "ScottSteiner" not in xchat.get_info("nick"): return
    if text[1] == "nothing gayer":
        steiner = "than {}".format(nick)
    elif re.search("nothin(?:g(?:'s|)|)gayer", text[1]):
        steiner = "{} is a f****t".format(nick)
    elif re.search("nothin(?:g(?:'s|)|) finer than",
                   text[1]) or text[1] == "no one kinder than":
        steiner = "Scott Steiner"
    elif re.search("nothin(?:g(?:'s|)|) finer",
                   text[1]) or text[1] == "no one kinder":
        steiner = "than Scott Steiner"
    elif text[1] == "nothing is finer":
        steiner = "than {} being a dumbfuck inbred retard who still can't into a simple script".format(
            nick)
    elif text[1] == "big poppa pump":
        steiner = "IS YOUR HOOKUP. HOLLER IF YA HEAR ME"

    if steiner:
        print("{0}<{1}{0}> {2}".format("\x0307", text[0], text[1]))
        xchat.get_context().command("say {}".format(steiner))
        global steinerhook, steinertimer
        xchat.unhook(steinerhook)
        steinertimer = xchat.hook_timer(60000, steinertoggle)
        steinerhook = None
        return xchat.EAT_XCHAT
예제 #34
0
def chan_command(word, word_eol, userdata):
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if channel.lower() in data.allowed_chans:
        user, action, title, content = get_args(word)
        if command == "#f":
            if action in data.commands:
                if action == data.commands[0]:
                    if title and content:
                        c.execute("DELETE FROM facts WHERE title=?", (title, ))
                        c.execute("INSERT INTO facts VALUES (?, ?)", (
                            title,
                            content,
                        ))
                        conn.commit()
                    else:
                        send_message(
                            channel,
                            "Error inserting fact into database - specified title/content?"
                        )
                elif action == data.commands[1]:
                    if title:
                        c.execute("DELETE FROM facts WHERE title=?", (title, ))
                        conn.commit()
                    else:
                        send_message(
                            channel,
                            "Error removing fact from database - specified title?"
                        )
                elif action == data.commands[2]:
                    c.execute("SELECT * FROM facts")
                    msg = "\00306"
                    for row in c.fetchall():
                        msg = ''.join(
                            [msg, '\003: \00302"'.join(row), '"\003, \00306'])
                    send_message(channel, msg[:-6])
        elif command == "#give":
            fact = getfact(title)
            if fact:
                send_message(channel, "%s: %s" % (action, fact))
        elif command.startswith("#"):
            title = command[1:]
            fact = getfact(title)
            if fact:
                send_message(channel, '\00307' + fact)
예제 #35
0
파일: rnb2.py 프로젝트: b0nk/scriptsNconfs
def make_a_cancer(word, word_eol, userdata):

    COLOR = '\003'
    original = XC.strip(word_eol[1])
    original = original.upper()
    cancered = ''
    i = 0
    while i < 20:

        ran1 = randint(3, 15)
        ran2 = randint(3, 15)

        if ran1 == ran2:
            ran2 = randint(3, 15)

        cancered += "%s%d,%d" % (COLOR, ran1, ran2) + original
        i += 1

    XC.command('say %s' % (cancered))
예제 #36
0
파일: rnb2.py 프로젝트: b0nk/scriptsNconfs
def make_a_cancer(word, word_eol, userdata):

  COLOR = '\003'
  original = XC.strip(word_eol[1])
  original = original.upper()
  cancered = ''
  i = 0
  while i < 20:

    ran1 = randint(3, 15)
    ran2 = randint(3, 15)

    if ran1 == ran2:
      ran2 = randint(3, 15)

    cancered += "%s%d,%d" % (COLOR, ran1, ran2) + original
    i += 1

  XC.command('say %s' % (cancered))
예제 #37
0
def handler(word, word_eol, userdata):
    global answer
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    user, action, args = get_args(word)
    if answer:
        if (word[1].lower() in [x.lower() for x in answer]):
            correct_answer(channel, user)
        elif action == actions[2]: #skip
            update_score(user, -10)
            reset()
            send_message(channel, user, "SKIP: %(nick)s [-10 points]")
            getquestion(channel, user)
    elif command == "#trivia" or command == "#t":
            if not action:
                getquestion(channel, user)
            elif action in actions:
                if action == actions[0]: # random
                    getquestion(channel, user)
                elif action == actions[1]: # stats
                    send_message(channel, user, str(users))
예제 #38
0
def italy_cb(word, word_eol, userdata):
	global joined
	global ciao
	global channel_name
	
	if xchat.nickcmp(xchat.get_info("channel"), channel_name) != 0:
		return xchat.EAT_NONE
	chan = xchat.find_context(channel=channel_name)
		
	if not (xchat.strip(word[0]) in joined or xchat.strip(word[0]) in ciao):
		return xchat.EAT_NONE
		
	if xchat.strip(word[0]) in joined:
		joined.remove(xchat.strip(word[0]))
		if word[1] == "ciao":
			ciao.append(xchat.strip(word[0]))
		return xchat.EAT_NONE
	
	if xchat.strip(word[0]) in ciao:
		ciao.remove(xchat.strip(word[0]))
		if word[1] == "!list":
			chan.command("kickban " + xchat.strip(word[0]) + " Italians aren't real people")
			
	return xchat.EAT_NONE
예제 #39
0
def moar(word, word_eol, userdata):
    channel = xchat.get_info('channel')
    command = xchat.strip(word[1].split(' ', 1)[0])
    if command == "#moar":
        text = xchat.strip(word[1].split(' ', 1)[1])
        send_message(channel, jeffk(aol("moaarrr %s!!! MMMOOOOOAAAAAARRRRRRRR!!!" % text)))
예제 #40
0
# to load in hexchat: /py load youtitle.py
# to unload: /py unload youtitle.py
# hexchat API doc: https://hexchat.readthedocs.org/en/2.9.6/script_python.html

import xchat  # @UnresolvedImport
import re
from urllib.request import urlopen
from html import unescape
from threading import Thread

__module_name__ = "youtitle"
__module_version__ = "1.1"
__module_description__ = "Deciphers YouTube URLs read on IRC, getting back the titles to you or the whole channel."

DEBUG = False
SENDING_MSG_PREF = xchat.strip(__module_name__)+".sending_msg"

# TODO: moving template string in conf file
# TODO: exclusive mode for sending_msg opt. on network basis
# TODO: exclusive mode, specifying networks on which the plugin parses youtube urls
# TODO: commands to edit config without going directly in config file.
# TODO: optionnally/defaulty ignoring youtube url posted by ignored user
# TODO: option to proxify the http requests
# TODO: command to enable/disable the sending msg option
# TODO: sending messages in the right ctxt (the one where the url was received)
# TODO: map for caching pairs of youtube link and title, avoiding two same requests in a row

def msg_containing_word_of_title(msg,title):
	MIN_WORD_LEN=5
	msg = msg.lower()
	for t_word in title.split(' '):