Browse Source

add night is about to end warning time = 0 to debug mode

fix bug in !eval and !exec which caused them to not work via PM
master
jcao219 13 years ago
parent
commit
35e706456c
  1. 19
      modules/wolfgame.py

19
modules/wolfgame.py

@ -69,6 +69,7 @@ var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME)
if botconfig.DEBUG_MODE: if botconfig.DEBUG_MODE:
var.NIGHT_TIME_LIMIT = 0 # 90 var.NIGHT_TIME_LIMIT = 0 # 90
var.NIGHT_TIME_WARN = 0
var.DAY_TIME_LIMIT_WARN = 0 var.DAY_TIME_LIMIT_WARN = 0
var.DAY_TIME_LIMIT_CHANGE = 0 var.DAY_TIME_LIMIT_CHANGE = 0
var.KILL_IDLE_TIME = 0 #300 var.KILL_IDLE_TIME = 0 #300
@ -2662,9 +2663,14 @@ if botconfig.DEBUG_MODE or botconfig.ALLOWED_NORMAL_MODE_COMMANDS:
@cmd("eval", owner_only = True) @cmd("eval", owner_only = True)
@pmcmd("eval", owner_only = True) @pmcmd("eval", owner_only = True)
def pyeval(cli, nick, chan, rest): def pyeval(cli, nick, *rest):
rest = list(rest)
if len(rest) == 2:
chan = rest.pop(0)
else:
chan = nick
try: try:
a = str(eval(rest)) a = str(eval(rest[0]))
if len(a) < 500: if len(a) < 500:
cli.msg(chan, a) cli.msg(chan, a)
else: else:
@ -2676,9 +2682,14 @@ if botconfig.DEBUG_MODE or botconfig.ALLOWED_NORMAL_MODE_COMMANDS:
@cmd("exec", owner_only = True) @cmd("exec", owner_only = True)
@pmcmd("exec", owner_only = True) @pmcmd("exec", owner_only = True)
def py(cli, nick, chan, rest): def py(cli, nick, *rest):
rest = list(rest)
if len(rest) == 2:
chan = rest.pop(0)
else:
chan = nick
try: try:
exec(rest) exec(rest[0])
except Exception as e: except Exception as e:
cli.msg(chan, str(type(e))+":"+str(e)) cli.msg(chan, str(type(e))+":"+str(e))

Loading…
Cancel
Save