Example #1
0
def cmd_punish(match, entry, userinfo):
  targetname = match.group(1)
  if permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to punish " + targetname):
    rewards.punish(users.getuser_byname(targetname), {
      "reason": "Unspecified reason",
      "level": 1
    })
  return True # No more processing from command list
Example #2
0
def cmd_give(match, entry, userinfo):
  who = match.group(1)
  what = match.group(2)

  if not permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to give " + what + " to " + who):
    return True # No more processing from command list

  externals.minecraft.send("give " + who + " " + what + "\r\n")
  return True # No more processing from command list
Example #3
0
def cmd_react(match, entry, userinfo):
  targetname = match.group(1)
  opinion = float(match.group(2))

  #if "admin" in userinfo and userinfo["admin"]:
  if permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to have gods react"):
    gods.react_byname(targetname, opinion)

  return True # No more processing from command list
Example #4
0
def cmd_godmood_set(match, entry, userinfo):
  #if "admin" in userinfo and userinfo["admin"]:
  if permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to set godmood"):
    newmood = match.group(1)
    try:
      gods.mood = float(newmood)
    except:
      pass

  return True # No more processing from command list
Example #5
0
def cmd_gs(match, entry, userinfo):
  print("Got " + str(len(match.groups())) + " groups.")
  if len(match.groups()) == 0:
    targetname = userinfo["username"]
  else:
    targetname = match.group(1)

  if permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to give glowstone to " + targetname):
    externals.minecraft.send("give " + targetname + " glowstone\r\n")

  return True # No more processing from command list
Example #6
0
def cmd_say(match, entry, userinfo):
  if permissions.is_allowed(userinfo, { "minimum_standing": 0 }, "Trying to make the server speak"):
    msg = match.group(1)
    externals.minecraft.say(msg)
  return True # No more processing from command list
Example #7
0
def cmd_announcement(match, entry, userinfo):
  if permissions.is_allowed(userinfo, { "minimum_standing": 100 }, "Trying to make a title"):
    msg = match.group(1)
    externals.minecraft.announcement(msg)
  return True # No more processing from command list