added the ability to auto-nickserv-ghost or auto-nickserv-release
This commit is contained in:
parent
dfb6e1b4ec
commit
77c78c8788
@ -1,6 +1,9 @@
|
|||||||
PASS = ""
|
PASS = ""
|
||||||
CHANNEL = "#example"
|
CHANNEL = ""
|
||||||
HOST = "irc.freenode.net"
|
HOST = "irc.freenode.net"
|
||||||
PORT = 6667
|
PORT = 6667
|
||||||
NICK = ""
|
NICK = ""
|
||||||
ADMINS = ("")
|
OWNER = "unaffiliated/wolfbot_admin1"
|
||||||
|
ADMINS = ("unaffiliated/wolfbot_admin1", "unaffiliated/wolfbot_admin2")
|
||||||
|
CMD_CHAR = "!"
|
||||||
|
CHANGING_HOST_QUIT_MESSAGE = "Changing host"
|
@ -235,8 +235,12 @@ class IRCClient(object):
|
|||||||
self.send("NOTICE", user, ":{0}".format(line))
|
self.send("NOTICE", user, ":{0}".format(line))
|
||||||
def quit(self, msg):
|
def quit(self, msg):
|
||||||
self.send("QUIT :{0}".format(msg))
|
self.send("QUIT :{0}".format(msg))
|
||||||
def identify(self, passwd, authuser="NickServ"):
|
def ns_identify(self, passwd):
|
||||||
self.msg(authuser, "IDENTIFY {0}".format(passwd))
|
self.msg("NickServ", "IDENTIFY {0} {1}".format(self.nickname, passwd))
|
||||||
|
def ns_ghost(self):
|
||||||
|
self.msg("NickServ", "GHOST "+self.nickname)
|
||||||
|
def ns_release(self):
|
||||||
|
self.msg("NickServ", "RELEASE "+self.nickname)
|
||||||
def user(self, uname, rname):
|
def user(self, uname, rname):
|
||||||
self.send("USER", uname, self.host, self.host,
|
self.send("USER", uname, self.host, self.host,
|
||||||
rname or uname)
|
rname or uname)
|
||||||
|
41
wolfgame.py
41
wolfgame.py
@ -24,18 +24,36 @@ hook = decorators.generate(HOOKS, raw_nick=True)
|
|||||||
# Game Logic Begins:
|
# Game Logic Begins:
|
||||||
|
|
||||||
def connect_callback(cli):
|
def connect_callback(cli):
|
||||||
cli.identify(botconfig.PASS)
|
cli.ns_identify(botconfig.PASS)
|
||||||
cli.join(botconfig.CHANNEL)
|
|
||||||
cli.msg("ChanServ", "op "+botconfig.CHANNEL)
|
def prepare_stuff():
|
||||||
|
cli.join(botconfig.CHANNEL)
|
||||||
|
cli.msg("ChanServ", "op "+botconfig.CHANNEL)
|
||||||
|
|
||||||
|
var.USERS = []
|
||||||
|
|
||||||
|
@hook("whoreply")
|
||||||
|
def on_whoreply(cli, server, dunno, chan, dunno1,
|
||||||
|
cloak, dunno3, user, status, dunno4):
|
||||||
|
if user in var.USERS: return # Don't add someone who is already there
|
||||||
|
var.USERS.append(user)
|
||||||
|
cli.who(botconfig.CHANNEL)
|
||||||
|
|
||||||
var.USERS = []
|
@hook("nicknameinuse")
|
||||||
|
def mustghost(cli, *blah):
|
||||||
@hook("whoreply")
|
cli.nick(botconfig.NICK+"_")
|
||||||
def on_whoreply(cli, server, dunno, chan, dunno1,
|
cli.ns_identify(botconfig.PASS)
|
||||||
cloak, dunno3, user, status, dunno4):
|
cli.ns_ghost()
|
||||||
if user in var.USERS: return # Don't add someone who is already there
|
cli.nick(botconfig.NICK)
|
||||||
var.USERS.append(user)
|
prepare_stuff()
|
||||||
cli.who(botconfig.CHANNEL)
|
|
||||||
|
@hook("unavailresource")
|
||||||
|
def mustrelease(cli, *blah):
|
||||||
|
cli.nick(botconfig.NICK+"_")
|
||||||
|
cli.ns_identify(botconfig.PASS)
|
||||||
|
cli.ns_release()
|
||||||
|
cli.nick(botconfig.NICK)
|
||||||
|
prepare_stuff()
|
||||||
|
|
||||||
var.LAST_PING = 0 # time of last ping
|
var.LAST_PING = 0 # time of last ping
|
||||||
var.ROLES = {"person" : []}
|
var.ROLES = {"person" : []}
|
||||||
@ -54,6 +72,7 @@ def connect_callback(cli):
|
|||||||
var.GRAVEYARD = []
|
var.GRAVEYARD = []
|
||||||
var.GRAVEYARD_LOCK = threading.Lock()
|
var.GRAVEYARD_LOCK = threading.Lock()
|
||||||
|
|
||||||
|
prepare_stuff()
|
||||||
|
|
||||||
|
|
||||||
def mass_mode(cli, md):
|
def mass_mode(cli, md):
|
||||||
|
Loading…
Reference in New Issue
Block a user