Browse Source

added !away (!back), also works in a PM

master
jcao219 14 years ago
parent
commit
8bf8bcd369
  1. 1
      var.py
  2. 20
      wolfgame.py

1
var.py

@ -11,6 +11,7 @@ START_WITH_DAY = False @@ -11,6 +11,7 @@ START_WITH_DAY = False
KILL_IDLE_TIME = 0 #300
WARN_IDLE_TIME = 0 #180
GAME_COMMAND_ADMIN_ONLY = True
AWAY = [] # cloaks of people who are away.
# HIT MISS SUICIDE
GUN_CHANCES = ( 5/7 , 1/7 , 1/7 )

20
wolfgame.py

@ -232,11 +232,12 @@ def pinger(cli, nick, chan, rest): @@ -232,11 +232,12 @@ def pinger(cli, nick, chan, rest):
@hook("whoreply")
def on_whoreply(cli, server, dunno, chan, dunno1,
dunno2, dunno3, user, status, dunno4):
cloak, dunno3, user, status, dunno4):
if not var.PINGING: return
if user in (botconfig.NICK, nick): return # Don't ping self.
if var.PINGING and 'G' not in status and '+' not in status:
if (var.PINGING and 'G' not in status and
'+' not in status and cloak not in var.AWAY):
# TODO: check if the user has AWAY'D himself
TO_PING.append(user)
@ -255,8 +256,19 @@ def pinger(cli, nick, chan, rest): @@ -255,8 +256,19 @@ def pinger(cli, nick, chan, rest):
cli.who(chan)
#def chk_bed
@cmd("away", raw_nick=True)
@pmcmd("away", raw_nick=True)
@cmd("back", raw_nick=True)
@pmcmd("back", raw_nick=True)
def away(cli, nick, *rest):
cloak = parse_nick(nick)[3]
nick = parse_nick(nick)[0]
if cloak in var.AWAY:
var.AWAY.remove(cloak)
cli.notice(nick, "You are now no longer marked as away.")
return
var.AWAY.append(cloak)
cli.notice(nick, "You are now marked as away.")

Loading…
Cancel
Save