creating shared dict

This commit is contained in:
jomo
2014-07-14 01:16:40 +02:00
parent 991030b326
commit 94932ce0bf
3 changed files with 37 additions and 35 deletions

28
misc.py
View File

@@ -105,6 +105,7 @@ def onPluginversionsCommand(sender, args):
msg(sender, "&6" + plugin.getDescription().getName() + "&r: &e" + plugin.getDescription().getVersion())
return True
#
# /echo - essentials echo sucks and prints mail alerts sometimes
#
@@ -112,3 +113,30 @@ def onPluginversionsCommand(sender, args):
@hook.command("echo")
def onEchoCommand(sender, args):
msg(sender, " ".join(args).replace("\\n", "\n"))
#
# /pyeval - run python ingame
#
# has to be in main.py so we can access the modules
def evalThread(sender, code):
try:
msg(sender, "%s" % unicode(eval(code)), False, "a")
except Exception, e:
msg(sender, "%s: %s" % (e.__class__.__name__, e), False, "c")
thread.exit()
@hook.command("pyeval")
def onPyevalCommand(sender, args):
if sender.hasPermission("utils.pyeval"):
if not checkargs(sender, args, 1, -1):
return True
msg(sender, "%s" % " ".join(args), False, "e")
try:
thread.start_new_thread(evalThread, (sender, " ".join(args)))
except Exception, e:
msg(sender, "&cInternal error: %s" % e)
else:
noperm(sender)
return True