• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python xchat.hook_print函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: WhoStoleIt

def WhoStoleIt(userdata):
	global dInfo
	sServ=xchat.get_info("network")
	if sServ in dInfo:
		xchat.command("whois %s" % dInfo[sServ]["nick"])
		dInfo[sServ]["who1"] = xchat.hook_print("Generic Message", Test)
		dInfo[sServ]["who2"] = xchat.hook_print("WhoIs End", WhoEnd)
开发者ID:logicplace,项目名称:xchat-plugins,代码行数:7,代码来源:autoghost.py


示例2: __init__

      def __init__(self):
          """ Costruttore """
          self.pattern = []
          self.stats = {}
          self.pattern_stats = [0, (0, 0)]

          self.debug = False
          self.label = "Mp3 filter"            

          self.load_config()
          for evnt in filter_event:
               xchat.hook_print(evnt, self.ignore_mp3_notification)            

          xchat.hook_command("mp3filter_reload", self.reload_config,
                               help="Carica nuovamente i filtri dalla config")
          xchat.hook_command("mp3filter_stats", self.pattern_status,
                                          help="Statistiche sui filtri usati")
          xchat.hook_command("mp3filter_debug", self.debug_swap,
                                        help="Stampa i messaggi che vengono \
                                              bloccati; Utile per capire \
                                  quali messaggi bloccano gli attuali filtri")

          xchat.command('MENU ADD "%s"' % self.label)
          xchat.command('MENU ADD "%s/Ricarica filtri" "mp3filter_reload"' %
                                                                   self.label)
          xchat.command('MENU ADD "%s/Statistiche filtri" "mp3filter_stats"' %
                                                                   self.label)
          xchat.command('MENU ADD "%s/Debug" "mp3filter_debug None"' %
                                                                   self.label)

          print "Filtro mp3 caricato su: \x0304%s\x03" % ', '.join(filter_event)
          s=self.pattern_stats
          print "%d/%d filtri caricati!" % (s[1][0], s[0])
开发者ID:hiryu85,项目名称:xchat_filter_mp3_advices,代码行数:33,代码来源:mp3filter.py


示例3: toggle_cb

    def toggle_cb(self, word, word_eol, userdata):
        if len(word) < 2 or word[1].lower() not in ['on', 'off', 'status']:
            self.notice("Please provide a command: 'on', 'off', or 'status'")
            return xchat.EAT_ALL

        command = word[1].lower()
        if command == "on":
            if self.hooks:
                self.notice("Hush is already on")
                return xchat.EAT_ALL

            for event in ["Join", "Part", "Part with Reason", "Quit", "Change Nick"]:
                self.hooks.append(xchat.hook_print(event, self.selective_hush_cb))

            for event in ["Private Message", "Private Action", "Channel Message", "Channel Action"]:
                self.hooks.append(xchat.hook_print(event, self.record_cb))

            self.hooks.append(xchat.hook_timer(5 * 60 * 1000, self.reaper_cb))
            self.notice("Loaded Hush")

            return xchat.EAT_ALL
        elif command == "off":
            if self.hooks:
                map(xchat.unhook, self.hooks)
                self.hooks = []
                self.active_users = []
                self.notice("Unloaded Hush")
            else:
                self.notice("Hush is already off")
            return xchat.EAT_ALL
        elif command == "status":
            status = {True: "on", False: "off"}
            self.notice("Hush is %s" % status[bool(self.hooks)])
            return xchat.EAT_ALL
开发者ID:nbm077,项目名称:hush,代码行数:34,代码来源:hush.py


示例4: xchatHook

 def xchatHook(self):
     print 'rehooking'
     if not len(self.hooked):
         self.hooked = [xchat.hook_print('Channel Message', alerts.general_message,
                                     userdata=None, priority=xchat.PRI_NORM),
                    xchat.hook_print('Channel Msg Hilight', alerts.general_message,
                                     userdata=None, priority=xchat.PRI_NORM),
                    xchat.hook_print('Private Message', alerts.private_message,
                                     userdata=None, priority=xchat.PRI_NORM),
                    xchat.hook_print('Private Message to Dialog',
                                     alerts.private_message, userdata=None,
                                     priority=xchat.PRI_NORM)]
开发者ID:dingus9,项目名称:xchat-smartAlert,代码行数:12,代码来源:smartAlert.py


示例5: __init__

    def __init__(self) :
        self.start_time = time.time()
        for event in XchatSoundHandler.EVENTS :
            xchat.hook_print(event, self.handle_message, event)

        xchat.hook_command("chatsounds", self.handle_prefs)
        xchat.hook_command("cs", self.handle_prefs)

        self.player = SoundPlayer()

        self.sound_dir = os.path.expanduser("~/.xchat2/sounds/")

        self.silenced_channels = SILENCED_CHANNELS

        debugprint("Loaded chatsounds.py")
开发者ID:veryalien,项目名称:scripts,代码行数:15,代码来源:chatsounds.py


示例6: 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


示例7: __init__

 def __init__(self):
     self.id_dh = {}
     self.hooks = [
         xchat.hook_command('', self.on_send_message),
         xchat.hook_command('ME', self.on_send_me),
         xchat.hook_command('MSG', self.on_send_msg),
         xchat.hook_command('NOTICE', self.on_send_notice),
         xchat.hook_server('notice', self.on_recv_notice, priority=xchat.PRI_HIGHEST),
         xchat.hook_print('Change Nick', self.on_change_nick),
         xchat.hook_unload(self.unload),
     ]
     for name in (
         'Channel Action', 'Private Action to Dialog', 'Private Action', 'Channel Message',
         'Private Message to Dialog', 'Private Message'
     ):
         xchat.hook_print(name, self.on_recv_message, name, priority=xchat.PRI_HIGHEST),
开发者ID:simonzack,项目名称:hexfish,代码行数:16,代码来源:plugin.py


示例8: check_process

 def check_process(self, word, word_eol, userdata):
   self.checkchannel = word[1]
   self.hostlist = []
   self.kicklist = []
   xchat.hook_print("Join", self.onJoin)
   xchat.hook_print("Quit", self.onQuit)
   xchat.hook_print("Part", self.onPart)
   xchat.hook_print("Kick", self.onKick)
   xchat.hook_print("Part with Reason", self.onPartReason)
   self.IRCserver = xchat.get_info("server")
   self.cnc = xchat.find_context(channel = self.checkchannel, server= self.IRCserver)
   userlist = self.cnc.get_list("users")
   for i in userlist:
     if i.host not in self.hostlist:
       self.hostlist.append(i.host)
     elif i.host in self.hostlist:
       self.cnc.prnt("\0034\007\002CLONE DETECTED = %s" % i.host)
       #print(self.hostlist) #DEBUG
   print("Script ready")
开发者ID:shibumi,项目名称:IRCollection,代码行数:19,代码来源:hostcheck.py


示例9: init

def init(ignore_data=None):
    hooks.append(xchat.hook_timer(500, numerator.update_timer_cb))
    hooks.append(xchat.hook_print("Focus Tab",
        numerator.reset_activity_cb))

    for evt in ('Channel Action Hilight'
               ,'Channel Msg Hilight'
               ,'Channel Message'
               ,'Private Message to Dialog'
               ,'Private Action to Dialog'):
        hooks.append(xchat.hook_print(evt, numerator.activity_cb))


    try:
        numerator.enumerate_tabs()
    except WindowsError as e:
        numerator.log("error on initial enumeration")

    numerator.log("successfully loaded")
    return 0 # do not repeat timer
开发者ID:CrimsonStar,项目名称:hexchat-addons,代码行数:20,代码来源:treenumbers.py


示例10: __init__

    def __init__(self):
        #Decode hooks
        xchat.hook_print("Private Message", self.decode, "Private Message")
        xchat.hook_print("Private Message to Dialog", self.decode, "Private Message to Dialog")

        xchat.hook_print("Quit", self.quithook, "Quit")
        xchat.hook_print("Connected", self.resetconversationshook, "Connected")
        xchat.hook_print("Your Nick Changing", self.resetconversationshook,
            "Your Nick Changing")

        #Generic encode hook
        self.allhook = xchat.hook_command("", self.encode)

        #TODO RandomPool is know to be broken
        #Random generator
        self.randfunc = get_random_bytes

        #Initialize configuration directory
        confDir = xchat.get_info("xchatdirfs") + "/cryptochati.conf"
        if not os.path.isdir(confDir):
            os.makedirs(confDir, 0700)

        #Friends file
        self.friendsPath = os.path.join(confDir, "friends.txt")
        #Private key file
        self.myKeyPath = os.path.join(confDir, "my.key")
        #Friends' public keys file
        self.keysPath = os.path.join(confDir, "public.keys")

        #Create/load configuration
        self.openConfiguration()

        #Friend management hook
        xchat.hook_command("Friend", self.friendhook, "Friend", help=
"""Usage:
FRIEND ADD <nick> - adds <nick> as a trusted friend
FRIEND DEL <nick> - deletes <nick> from trusted friends
FRIEND LIST - lists current trusted friends""")
开发者ID:dertalai,项目名称:cryptochati,代码行数:38,代码来源:cryptochati.py


示例11: on_join

def on_join(word, word_eol, userdata):
    # use global variable for unhooking
    global rename_hook
    # for comfort instead of word[0], word[1] and word[2]
    triggernick, triggerchannel, triggerhost = word
    # get the context
    destination = xchat.get_context()
    # if the channel is bitlbees channel and the nick begins with a dash
    if ((triggerchannel == "&bitlbee") and ((triggernick[0] == "-") or (triggernick[0] == "_"))):
        # send a whois on the nick
        xchat.command("whois %s" % triggernick)
        # make a handler that hooks the Name Line of the whois and calls rename_name with this line
        rename_hook = xchat.hook_print("Whois Name Line", rename_name)
        # unhook the whois
    return
开发者ID:WeNDoRx,项目名称:scripts,代码行数:15,代码来源:xchat_rename_ugly_contacts.py


示例12: setup

    def setup(self):
        # Register contact events raised by minbif.
        xchat.hook_print('Channel DeVoice', self.replicate_event, (1, 'is away'))
        xchat.hook_print('Channel Voice', self.replicate_event, (1, 'is back'))
        xchat.hook_print('Join', self.replicate_event, (0, 'has joined'))

        # The following is already notified.
        #xchat.hook_print('Quit', self.replicate_event, (0, 'has quit'))

        xchat.hook_unload(self.unload_cb)

        xchat.prnt('%s version %s by %s loaded' % (
                __module_name__, __module_version__, __author__))
开发者ID:dsoulayrol,项目名称:config,代码行数:13,代码来源:xchat-minbif.py


示例13: load

def load(*args):
    groups_load_from_settings()
    compile_strings()
    for event in chat_events:
        xchat.hook_print(event, dispatch_message, event)

    xchat.hook_print("Key Press", dispatch_key)
    xchat.hook_command("", dispatch_command)

    xchat.hook_command("ov", command_handler)

    for event in ["You Join", "You Kicked", "You Part", "you Part with Reason"]:
        xchat.hook_print(event, dispatch_channels_change, event)

    print(__module_name__, __module_version__, 'loaded')
开发者ID:Xuerian,项目名称:xchat_overwatch,代码行数:15,代码来源:overwatch.py


示例14: enable

 def enable(self):
     self.is_enabled = True
     #read in config
     self.config = ConfigParser.RawConfigParser()
     self.config.read('config.conf')
     #set menus
     self.setup_nick_menu()
     #create list of channels
     try:
         for channel in xchat.get_list("channel"):
             dir(channel)
     except KeyError:
         pass
     #watch for new channels joined
     xchat.hook_command("join", self.on_channel_join)
     #watch for channels left
     xchat.hook_command("part", self.on_channel_part)
     #set hooks for joti/join/part/messages
     xchat.hook_command("joti", self.dispatch)
     xchat.hook_print('Channel Message', self.on_text)
     xchat.hook_print('Join', self.on_join)
     xchat.hook_print('Part', self.on_part)
开发者ID:HomingHamster,项目名称:scoutlink-joti-xchat-op-script,代码行数:22,代码来源:JOTIop.py


示例15: len

	else:
		for sI, sV in dSettings.iteritems():
			sDots = '.'*(29 - len(sI))
			sTmpStr = "%s\x0312%s\x0f\x0311:\x0f %s" % (sI, sDots, sV)
			xchat.prnt(sTmpStr)
		#endfor
	#endif

	return xchat.EAT_ALL
#enddef

lEvents4L4l = [
	  "Channel Action"
	, "Channel Action Hilight"
	, "Channel Message"
	, "Channel Msg Hilight"
]

for sI in lEvents4L4l:
	xchat.hook_print(sI, LookForLink, sI)
#endfor

xchat.hook_command("yti", Settings)
xchat.prnt("Loaded %s version %s." % (__module_name__, __module_version__))

GetCategories()

import sys
if len(sys.argv) > 1:
	LookForLink(['', sys.argv[1], ''], ['', sys.argv[1], ''], None)
开发者ID:logicplace,项目名称:xchat-plugins,代码行数:30,代码来源:youtubeinfo.py


示例16: len

		if len(word_eol) > 2: # Set
			banOpts["*"]["irc_kick_message"] = word_eol[2]
			xchat.prnt("%s set to: %s" % (word[1],word_eol[2]))
		else:
			dots = 29-len(word[1])
			try: irc_kick_message = banOpts["*"]["irc_kick_message"]
			except KeyError: irc_kick_message = None
			xchat.prnt(word[1]+"\00318"+("."*dots)+"\00319:\x0f "+irc_kick_message)
		#endif
		return xchat.EAT_XCHAT
	#endif

	return xchat.EAT_NONE
#enddef

xchat.hook_print("Join", CheckJoin)
xchat.hook_print("You Join", BanTimerGo, True)
xchat.hook_server("352", CheckWhoRet)
xchat.hook_command("set",SetMessage)
for x in ["b","ban"]: xchat.hook_command(x,BanNick,None,xchat.PRI_HIGHEST)
for x in ["-b","ub","unban"]: xchat.hook_command(x,UnbanNick,None,xchat.PRI_HIGHEST)
for x in ["k","kick"]: xchat.hook_command(x,KickNick,(1,2,None),xchat.PRI_HIGHEST)
for x in ["kb","bk","kickban"]: xchat.hook_command(x,BanNick,True,xchat.PRI_HIGHEST)

LoadINIish((banTimes,"bantimes",int))
xchat.hook_unload(SaveINIish,(banTimes,"bantimes"))
LoadINIish((bannedNicks,"bannednicks",str))
xchat.hook_unload(SaveINIish,(bannedNicks,"bannednicks"))
LoadINIish((banOpts,"banopts",str))
xchat.hook_unload(SaveINIish,(banOpts,"banopts"))
xchat.prnt("Loaded %s version %s." % (__module_name__,__module_version__))
开发者ID:GunfighterJ,项目名称:xchat-plugins,代码行数:31,代码来源:betterkb.py


示例17: open

		return xchat.EAT_NONE
	
	command = word[1].split(' ')[0].lower()
	if command == "!since":
		#Command not particularly useful if stream is live
		if monitoring["monotonetim"][0] is Status.online:
			xchat.command("say MonotoneTim is live right now!")
			timer = xchat.hook_timer(60000, cooldown_cb)
			cooldown = True
			return xchat.EAT_NONE
		
		if lastStreamTime == -1:
			file = open(filename, "r")
			lastStreamTime = float(file.read())
			file.close()
		delta = TimeDelta(time.time() - lastStreamTime)
		xchat.command("say " + delta.readableTime())
		timer = xchat.hook_timer(60000, cooldown_cb)
		cooldown = True
	return xchat.EAT_NONE

def cooldown_cb(userdata):
	global cooldown
	#There should only be one cooldown in this script,
	#as the other script covers cooldown commands
	cooldown = False
	return 0
	
xchat.hook_print("Channel Message", since_cb)
xchat.hook_command("monitor", monitor_cb, help = "/MONITOR Alerts when Tim is live")
xchat.hook_command("unmonitor", unmonitor_cb, help = "/UNMONITOR Stop monitoring")
开发者ID:EliteSoba,项目名称:xchat_scripts,代码行数:31,代码来源:tim.py


示例18: len

        if len(word) >= 3 and word[2] != '--network':
            if word_eol[2]=="1" or word_eol[2]=="True" or word_eol[2]=="true":
                key.aes = True
            if word_eol[2]=="0" or word_eol[2]=="False" or word_eol[2]=="false":
                key.aes = False
            KEY_MAP[id_] = key
        elif len(word) >= 5 and word[2] == '--network':
            if word_eol[4]=="1" or word_eol[4]=="True" or word_eol[4]=="true":
                key.aes = True
            if word_eol[4]=="0" or word_eol[4]=="False" or word_eol[4]=="false":
                key.aes = False
        print 'Key aes', id_, 'set', key.aes
        return xchat.EAT_ALL

import xchat
xchat.hook_command('key', key, help='show information or set key, /key <nick> [<--network> <network>] [new_key]')
xchat.hook_command('key_exchange', key_exchange, help='exchange a new key, /key_exchange <nick>')
xchat.hook_command('key_list', key_list, help='list keys, /key_list')
xchat.hook_command('key_load', key_load, help='load keys, /key_load')
xchat.hook_command('key_pass', key_pass, help='set key file pass, /key_pass password')
xchat.hook_command('aes', aes, help='aes #channel/nick 1|0 or True|False')
xchat.hook_command('key_remove', key_remove, help='remove key, /key_remove <nick>')
xchat.hook_server('notice', dh1080)
xchat.hook_print('Channel Message', decrypt_print, 'Channel Message')
xchat.hook_print('Change Nick', change_nick)
xchat.hook_print('Private Message to Dialog', decrypt_print, 'Private Message to Dialog')
xchat.hook_server('332', server_332)
xchat.hook_command('', encrypt_privmsg)
xchat.hook_unload(unload)
load()
开发者ID:Sharker,项目名称:XChat-FiSH-AES,代码行数:30,代码来源:XChat_AES.py


示例19: list

cmd_aliases = {'highlights': {'xhighlights': {'helpfix': ('XHIGH', 'HIGH')},
                              },
               }

# Fix help and descriptions for aliases
for aliasname in cmd_aliases.keys():
    # Fix help
    for cmd in cmd_aliases[aliasname]:
        replacestr, replacewith = cmd_aliases[aliasname][cmd]['helpfix']
        cmd_help[aliasname] = cmd_help[cmd].replace(replacestr, replacewith)
    # Fix description
    aliasforcmds = list(cmd_aliases[aliasname].keys())
    aliasfor = aliasforcmds[0]
    commands[aliasname]['desc'] = commands[aliasfor]['desc']

# Hook all enabled commands.
for cmdname in commands.keys():
    if commands[cmdname]['enabled']:
        xchat.hook_command(cmdname.upper(),
                           commands[cmdname]['func'],
                           userdata=None,
                           help=cmd_help[cmdname])

# Hook into channel msgs
for eventname in ('Channel Message', 'Channel Msg Hilight', 'Your Message'):
    xchat.hook_print(eventname, message_filter, userdata=eventname)


# Print status
print('{} loaded.'.format(color_text('blue', VERSIONSTR)))
开发者ID:litwinski,项目名称:wp_site,代码行数:30,代码来源:xhighlights.py


示例20: unloading

		except:
			xchat.prnt("Sorry, you need to input a time in seconds")
	elif word[1][0:3] == "off":
		if active == 1:
			active = 0
			xchat.prnt("Module turned off!")
		else:
			xchat.prnt("Module already disabled!")
	elif word[1][0:2] == "on":
		if active == 0:
			active = 1
			lastcommand = 0
			xchat.prnt("Module turned on!")
		else:
			xchat.prnt("Module already enabled!")
	return xchat.EAT_ALL

def unloading(userdata):
	xchat.prnt("Unloading Dict module...")

# These are all XChat specific functions
xchat.hook_print("Channel Msg Hilight", they_say)
xchat.hook_print("Channel Message", they_say)
xchat.hook_print("Private Message to Dialog", they_say)
xchat.hook_print("Your Message", me_say)
xchat.hook_command("dict", set_vars)
xchat.hook_unload(unloading)

# Print success on load
xchat.prnt("Dict loaded successfully.")
开发者ID:10crimes,项目名称:code,代码行数:30,代码来源:dict.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python xchat.hook_server函数代码示例发布时间:2022-05-26
下一篇:
Python xchat.hook_command函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap