diff --git a/calc.py b/calc.py index 457ce9d..ccecba4 100644 --- a/calc.py +++ b/calc.py @@ -1,7 +1,7 @@ from helpers import * calc_users = open_json_file("calc", []) -math_operators = ["+", "-", "*", "/", "&", "|",".",] +math_operators = ["+", "-", "*", "/", "&", "|"] ignore_operators = ["**", "&&", "||"] # ** may be too intensive, the others cause syntax errors calc_perm = "utils.calc" @@ -16,6 +16,8 @@ def calc(text): for char in text: if char.isdigit() or (should_calc and char in [".", " "]): expression += char + elif expression and char == ".": + expression += char elif char in math_operators: # calculation must include at least 1 operator should_calc = True diff --git a/snowbrawl.py b/snowbrawl.py index 81e62f0..ba97774 100644 --- a/snowbrawl.py +++ b/snowbrawl.py @@ -18,9 +18,9 @@ def onHit(event): print (event.getEntity().getName()) return print "passed first if statement" - if event.getEntity().getWorld().getName() != "minigames": + """if event.getEntity().getWorld().getName() != "minigames": print "Not in minigames" - return + return""" print "all good." event.getEntity().getWorld().createExplosion(event.getEntity().getLocation().getX(), event.getEntity().getLocation().getY(),event.getEntity().getLocation().getZ(),float(5),False,True) @@ -98,4 +98,4 @@ def getArena(location): if arena.getLocation().inRange(location, arena.getSize() - 1) return arena return None -""" \ No newline at end of file +"""