|
|
@@ -161,7 +161,7 @@ def do_command(self, connection, event):
|
|
|
return
|
|
|
|
|
|
level, xp, xpspent, karma, coin = GameHelpers.get_info(self, user)
|
|
|
- connection.privmsg(replyto, message + "Level: " + str(level) + ", XP: " + str(xp) + ", coin: " + str(coin) + ", karma: " + str(karma))
|
|
|
+ connection.privmsg(replyto, message + "Level: " + str(level) + grey + ", " + reset + "XP: " + str(xp) + grey + ", " + reset + "coin: " + str(coin) + grey + ", " + reset + "karma: " + str(karma))
|
|
|
|
|
|
elif command.split()[0] == "levelup":
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
@@ -170,13 +170,12 @@ def do_command(self, connection, event):
|
|
|
|
|
|
user = event.source.nick.lower()
|
|
|
level, xp, xpspent, karma, coin = GameHelpers.get_info(self, user)
|
|
|
- print(xp)
|
|
|
if len(command.split()) == 1:
|
|
|
print("XP < 10: " + str(xp < 10))
|
|
|
if xp < 10:
|
|
|
connection.privmsg(replyto, "Insuficcient XP, you need at least 10.")
|
|
|
else:
|
|
|
- self.db.run("UPDATE users SET level=level+1, xp_spent=xp_spent+10 WHERE LOWER(name)='" + user + "' AND network='" + self.network + "'")
|
|
|
+ self.db.run("UPDATE users SET level=level+1, xp_spent=xp_spent+10 WHERE LOWER(name)=%s AND network=%s", (user, self.network, ))
|
|
|
self.db.run("UPDATE users SET coin=coin+0.3 WHERE level>0")
|
|
|
elif len(command.split()) == 2:
|
|
|
try:
|
|
|
@@ -190,9 +189,8 @@ def do_command(self, connection, event):
|
|
|
elif xp < levels * 10:
|
|
|
connection.privmsg(replyto, "Insuficcient XP, you need at least " + str(levels * 10) + ".")
|
|
|
else:
|
|
|
- print("UPDATE users SET level=level+" + str(levels) + ", xp_spent=xp_spent+" + str(levels * 10) + " WHERE LOWER(name)='" + user + "' AND network='" + self.network + "'")
|
|
|
- self.db.run("UPDATE users SET level=level+" + str(levels) + ", xp_spent=xp_spent+" + str(levels * 10) + " WHERE LOWER(name)='" + user + "' AND network='" + self.network + "'")
|
|
|
- self.db.run("UPDATE users SET coin=coin+" + str(0.3 * levels) + " WHERE level>0")
|
|
|
+ self.db.run("UPDATE users SET level=level+%s, xp_spent=xp_spent+%s WHERE LOWER(name)=LOWER(%s) AND network=%s", (levels, levels * 10, user, self.network, ))
|
|
|
+ self.db.run("UPDATE users SET coin=coin+%s WHERE level>0", (self.network, ))
|
|
|
else:
|
|
|
connection.privmsg(replyto, "Too many arguments. For help type " + blue + self.helpchar + "levelup " + reset + ".")
|
|
|
|