import execnode execnode.startup(["nodes"]) stdin = execnode.getinput() # This node depends on the irc node, so for clarity's sake we'll first wait # for that to have loaded. for msgobj in stdin: if msgobj['type'] == 'nodes': if 'irc' in msgobj['content']: break else: execnode.send({ 'target': 'core', 'type': 'addhooks', 'hooks': ['node_loaded'] }) elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc': break elif msgobj['source'] == 'core' and msgobj['type'] == 'quit': execnode.send({'target': 'core', 'type': 'unloaded'}) sys.exit() # The IRC module has been loaded # install !quit and !nodes hooks execnode.send({'target': 'irc', 'type': 'addhook', 'trigger': 'quit'}) execnode.send({'target': 'irc', 'type': 'addhook', 'trigger': 'test'}) for msgobj in stdin:
pending = {} execnode.startup(["nodes"]) stdin = execnode.getinput() # This node depends on the irc node, so for clarity's sake we'll first wait # for that to have loaded. for msgobj in stdin: if msgobj['type'] == 'nodes': if 'irc' in msgobj['content']: break else: execnode.send(target='core', type='addhooks', hooks=['node_loaded']) elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc': break elif msgobj['source'] == 'core' and msgobj['type'] == 'quit': execnode.send(target='core', type='unloaded') sys.exit() # The IRC module has been loaded # install !quit and !nodes hooks for trigger in ['quit', 'nodes', 'load']: execnode.send(target='irc', type='addhook', trigger=trigger) for msgobj in stdin: if msgobj['source'] == 'irc': if msgobj['type'] == 'trigger':
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Copyright (C) 2011 Dominic van Berkel - [email protected] # See LICENSE for details import execnode execnode.startup() stdin = execnode.getinput() for msgobj in stdin: if msgobj['type'] == 'haslevel': if msgobj['nick'] == 'nazgjunk': msgobj['target'] = msgobj['source'] msgobj['result'] = 'true' execnode.send(msgobj) else: msgobj['target'] = msgobj['source'] msgobj['result'] = 'false' execnode.send(msgobj) elif msgobj['source'] == 'core': if msgobj['type'] == 'quit': execnode.send(target='core', type='unloaded') break
pending = {} execnode.startup(["nodes"]) stdin = execnode.getinput() # This node depends on the irc node, so for clarity's sake we'll first wait # for that to have loaded. for msgobj in stdin: if msgobj['type'] == 'nodes': if 'irc' in msgobj['content']: break else: execnode.send(target='core', type='addhooks', hooks=['node_loaded']) elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc': break elif msgobj['source'] == 'core' and msgobj['type'] == 'quit': execnode.send(target='core', type='unloaded') sys.exit() # The IRC module has been loaded # install !quit and !nodes hooks for trigger in ['quit', 'nodes', 'load']: execnode.send(target='irc', type='addhook', trigger=trigger)
import sys import execnode execnode.startup(["nodes"]) stdin = execnode.getinput() # This node depends on the irc node, so for clarity's sake we'll first wait # for that to have loaded. for msgobj in stdin: if msgobj['type'] == 'nodes': if 'irc' in msgobj['content']: break else: execnode.send({'target': 'core', 'type': 'addhooks', 'hooks': ['node_loaded']}) elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc': break elif msgobj['source'] == 'core' and msgobj['type'] == 'quit': execnode.send({'target': 'core', 'type': 'unloaded'}) sys.exit() # The IRC module has been loaded # install !quit and !nodes hooks execnode.send({'target': 'irc', 'type': 'addhook', 'trigger': 'quit'}) execnode.send({'target': 'irc',