From 268328d36accfacef05c69450041e5ab28a90992 Mon Sep 17 00:00:00 2001 From: Griatch Date: Thu, 21 Oct 2010 23:06:55 +0000 Subject: [PATCH] Fixed @py to match the wiki documentation. --- game/gamesrc/commands/default/privileged.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/game/gamesrc/commands/default/privileged.py b/game/gamesrc/commands/default/privileged.py index 562b32ef81..7215b5b06e 100644 --- a/game/gamesrc/commands/default/privileged.py +++ b/game/gamesrc/commands/default/privileged.py @@ -69,7 +69,17 @@ class CmdPy(MuxCommand): Usage: @py - In this limited python environment, only two + In this limited python environment. + + available_vars: 'self','me' : caller + 'here' : caller.location + 'obj' : dummy obj instance + 'script': dummy script instance + 'config': dummy conf instance + 'ObjectDB' : ObjectDB class + 'ScriptDB' : ScriptDB class + 'ConfigValue' ConfigValue class + only two variables are defined: 'self'/'me' which refers to one's own object, and 'here' which refers to the current location. @@ -100,7 +110,11 @@ class CmdPy(MuxCommand): 'here':caller.location, 'obj':obj, 'script':script, - 'config':conf} + 'config':conf, + 'ObjectDB':ObjectDB, + 'ScriptDB':ScriptDB, + 'ConfigValue':ConfigValue} + caller.msg(">>> %s" % pycode) try: ret = eval(pycode, {}, available_vars)