当前位置: 首页>>代码示例>>Python>>正文


Python xchat.unhook函数代码示例

本文整理汇总了Python中xchat.unhook函数的典型用法代码示例。如果您正苦于以下问题:Python unhook函数的具体用法?Python unhook怎么用?Python unhook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unhook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: BanTimerGo

def BanTimerGo(newInfo=None,newTime=None,onYouJoin=False):
	global banTimer,nextBanInfo,nextBanTime
	if onYouJoin:
		newInfo = None
		newTime = None
	#endif
	curTime = time()
	if not newTime:
		for servChan in banTimes:
			serv,chan = tuple(servChan.split("/",1))
			if xchat.find_context(serv,chan):
				remove = []
				for mask in banTimes[servChan]:
					thTime = banTimes[servChan][mask]
					if thTime <= curTime: remove.append((servChan,mask,thTime))
					elif not nextBanTime or thTime < nextBanTime:
						newInfo = (servChan,mask)
						newTime = thTime
					#endif
				#endfor
				for x in remove: BanTimerTick(x)
			#endif
		#endfor
	#endif
	if newInfo and newTime and (not nextBanTime or newTime < nextBanTime):
		nextBanInfo = newInfo
		nextBanTime = newTime
		if banTimer: xchat.unhook(banTimer)
		banTimer = xchat.hook_timer((newTime-int(time()))*1000, BanTimerTick)
开发者ID:GunfighterJ,项目名称:xchat-plugins,代码行数:29,代码来源:betterkb.py

示例2: skip_print

    def skip_print(self, name):
        def hook_func(word, word_eol, userdata):
            return xchat.EAT_XCHAT

        hook = xchat.hook_print(name, hook_func, priority=xchat.PRI_HIGHEST)
        yield
        xchat.unhook(hook)
开发者ID:simonzack,项目名称:hexfish,代码行数:7,代码来源:plugin.py

示例3: steiner

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', 'homo', '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 faggot".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
开发者ID:ScottSteiner,项目名称:xchat-scripts,代码行数:27,代码来源:steiner-replies.py

示例4: initialize

def initialize():
	print "initialize"
	global original_nick, timer_begins, timer_ends
	global uppercase_hook, action_hook, nick_hook, heretic_hook
	global ACF_BEGIN_TIME, ACF_END_TIME, has_joined
	has_joined = True
	hooks = [timer_begins, timer_ends, uppercase_hook, action_hook, nick_hook, heretic_hook]
	for h in hooks:
		if h is not None:
			xchat.unhook(h)
			h = None
	timer_begins = xchat.hook_timer(time_to(ACF_BEGIN_TIME), ACF_begin)
	timer_ends = xchat.hook_timer(time_to(ACF_END_TIME), ACF_end)
	uppercase_hook = xchat.hook_command("", to_uppercase)
	action_hook = xchat.hook_command("me", to_uppercase_action)
	nick_hook = xchat.hook_command("nick", change_nick)
	heretic_hook = xchat.hook_server("PRIVMSG", heretic_patrol)
	xchat.hook_command("leave", leave_dc801)
	original_nick = xchat.get_info("nick")
	if all_caps_friday() and original_nick.islower():
		new_nick = original_nick.upper()
		cmd = "nick %s" % new_nick
		xchat.command(cmd)
		return xchat.EAT_ALL
	return xchat.EAT_NONE
开发者ID:DoktorUnicorn,项目名称:xchatscripts,代码行数:25,代码来源:allcapsfriday.py

示例5: stop

def stop():
    global my_hook
    if my_hook is not None:
        xchat.unhook(my_hook)
        my_hook = None
        print "EasyXdcc stoped"
    return xchat.EAT_ALL
开发者ID:Ultrabenosaurus,项目名称:EasyXdcc,代码行数:7,代码来源:EasyXdcc.py

示例6: enumerate_cb

 def enumerate_cb(self, data):
     try:
         self.enumerate_tabs()
     except:
         pass
     if self.timerhook:
         xchat.unhook(self.timerhook)
     self.timerhook = None
开发者ID:CrimsonStar,项目名称:hexchat-addons,代码行数:8,代码来源:treenumbers.py

示例7: stop

 def stop(self, userdata):
     chan = userdata[0].get_info('channel')
     if chan in self.scrobblers:
         xchat.unhook(self.scrobblers[chan])
         del self.scrobblers[chan]
         print "scrobbling ended on " + chan
     else:
         print "wheren't scrobbling on " + chan
开发者ID:dingus9,项目名称:grooveyScrobbler,代码行数:8,代码来源:scrobblin.py

示例8: unload_cb

def unload_cb(userdata): 
    global timer_hook 
    if timer_hook is not None: 
        xchat.unhook(timer_hook) 
        timer_hook = None
        #force the nick as away
        update_away_nick()
        print "[autoaway] Module Unloads!"
开发者ID:vaibhav92,项目名称:xchat-autoaway,代码行数:8,代码来源:autoaway.py

示例9: unload_cb

def unload_cb(userdata):
    """Esta funcion debe desconectar todas las funciones del modulo al
    descargarse el script
    Argumentos:
    userdata -- variable opcional que se puede enviar a un hook (ignorado)
    """
    # Desconectamos las funciones
    xchat.unhook(HOOKEJEMPLO1)
开发者ID:GatoLoko,项目名称:GatoScript,代码行数:8,代码来源:example.py

示例10: CheckJoin

def CheckJoin(word,word_eol,userdata):
	global dInfo
	sServ=xchat.get_info("network")
	if sServ in dInfo and word[0] == dInfo[sServ]["nick"]:
		dInfo[sServ]["on"] = 5
		if "timer" in dInfo[sServ]:
			xchat.unhook(dInfo[sServ]["timer"])
			del dInfo[sServ]["timer"]
开发者ID:logicplace,项目名称:xchat-plugins,代码行数:8,代码来源:autoghost.py

示例11: check_channel

def check_channel(userdata):
    global cnh
    global channel
    cn = xchat.find_context(channel='#%s' % channel)
    if cn is not None:
        xchat.unhook(cnh)
    else:
        xchat.command("join #" + channel)
    return xchat.EAT_ALL
开发者ID:Hackr5,项目名称:py-xchat-twitter,代码行数:9,代码来源:xchat_twitter.py

示例12: defab_callback

def defab_callback(word, word_eol, user_data):
        global fab_hook
        
        if fab_hook is not None:
                hexchat.unhook(fab_hook)
                fab_hook = None
                hexchat.prnt('Fabulous mode off')
        
        return hexchat.EAT_ALL
开发者ID:Jake0720,项目名称:XChat-Scripts,代码行数:9,代码来源:rainbowtext.py

示例13: CheckQuit

def CheckQuit(word,word_eol,userdata):
	global dInfo
	sServ=xchat.get_info("network")
	if sServ in dInfo and word[0] == dInfo[sServ]["nick"]:
		xchat.command("nick %s" % dInfo[sServ]["nick"])
		if "timer" in dInfo[sServ]:
			xchat.unhook(dInfo[sServ]["timer"])
		#endif
		del dInfo[sServ]
开发者ID:logicplace,项目名称:xchat-plugins,代码行数:9,代码来源:autoghost.py

示例14: hookShowMenus

def hookShowMenus(*args):
  if hasattr(hookShowMenus, 'handler'):
    xchat.unhook(hookShowMenus.handler)
  next, meal_type = min((secondsToTime(hour, minute), meal_type)
                        for hour, minute, meal_type in ((8, 0, 'Breakfast'),
                                                        (11, 45, 'Lunch'),
                                                        (17, 0, 'Happy Hour'),
                                                        (17, 45, 'Dinner')))
  hookShowMenus.handler = xchat.hook_timer(
      next * 1000, onTimer, args[:2] + (meal_type,))
开发者ID:jiqingtang,项目名称:jiqingtang,代码行数:10,代码来源:JiqingBot.py

示例15: on_part

def on_part(word, word_eol, userdata):
    global jointimer
    if jointimer:
        xchat.unhook(jointimer)
        jointimer = None
    triggerchannel = word[2].lower()
    thecontext = xchat.find_context(channel=triggerchannel)
    if triggerchannel in option["opin"]:
        if triggerchannel in option["limitchannels"] and option["limitjoins"] == True:
            jointimer = xchat.hook_timer(option["limittime"], part_limit, userdata=thecontext)
开发者ID:KnightRobby,项目名称:cancelbot,代码行数:10,代码来源:opbot.py


注:本文中的xchat.unhook函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。