tBKwtWS vor 7 Jahren
Ursprung
Commit
3fa0378b88
2 geänderte Dateien mit 12 neuen und 15 gelöschten Zeilen
  1. 9 10
      irc/commands/games.py
  2. 3 5
      irc/events/on_welcome.py

+ 9 - 10
irc/commands/games.py

@@ -139,12 +139,12 @@ def do_command(self, connection, event):
     
     elif command.split()[0] == "player":
         if cmdtype == "help":    #Display help text.
-            connection.privmsg(replyto, "Displays a users game info. User optional.")
+            connection.privmsg(replyto, "Displays a users game statistics. User optional.")
         elif cmdtype == "cmd":
             
             if len(command.split()) == 1:
                 user = event.source.nick.lower()
-                message = grey + "Your info. " + reset
+                message = grey + "Your statistics. " + reset
             elif len(command.split()) == 2:
                 user = command.split()[1]
                 if not self.db.one("SELECT id FROM users WHERE LOWER(name)=%s AND network='" + self.network + "'", (user, )):
@@ -154,9 +154,9 @@ def do_command(self, connection, event):
                     connection.privmsg(replyto, "The game does not play the master.")
                     return
                 if user == event.source.nick.lower():
-                    message = grey + "Your info. " + reset
+                    message = grey + "Your statistics. " + reset
                 else:
-                    message = grey + "Info for " + red + trigger.split()[1] + reset + ". "
+                    message = grey + "Statistics for " + red + trigger.split()[1] + reset + ". "
             else:
                 connection.privmsg(replyto, "Too many arguments, For help type " + blue + self.helpchar + "players " + reset + ".")
                 return
@@ -168,12 +168,11 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, message + info)
     
     elif command.split()[0] == "levelup":
+        user = event.source.nick.lower()
+        level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, ap, apspent = GameHelpers.get_info(self, user)
         if cmdtype == "help":    #Display help text.
-            connection.privmsg(replyto, "Spend XP to gain a level. Gain multiple levels by specifying the amount.")
-        elif cmdtype == "cmd":
-            
-            user = event.source.nick.lower()
-            level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, ap, apspent = GameHelpers.get_info(self, user)
+            connection.privmsg(replyto, "Spend " + str(int(level * 2.7)) + "XP to gain your next level. Gain multiple levels (for the price of the lowest level) by specifying the amount.")
+        elif cmdtype == "cmd":    
             if len(command.split()) == 1:
                 if xp < int(level * 2.7):
                     connection.privmsg(replyto, "Insufficient XP, you need at least " + str(int(level * 2.7)) + ".")
@@ -262,7 +261,7 @@ def do_command(self, connection, event):
             elif len(command.split()) == 3:
                 self.db.run("UPDATE users SET coin=coin-%s, coin_spent=coin_spent+%s, coin_given=coin_given+%s, ap_spent=ap_spent+1 WHERE name=%s AND network=%s", (command.split()[2], command.split()[2], command.split()[2], event.source.nick, self.network, ))
                 self.db.run("UPDATE users SET coin=coin+%s WHERE LOWER(name)=%s AND network=%s", (command.split()[2], command.split()[1], self.network))
-            info = GameHelpers.player_info(self, user)
+            info = GameHelpers.player_info(self, event.source.nick)
             connection.notice(event.source.nick, "Your new statistics: " + info)
     
     elif command.split()[0] == "players":

+ 3 - 5
irc/events/on_welcome.py

@@ -3,11 +3,9 @@ from common import log, do_everything_to
 def process_event(self, connection, event):
     log.info(event)    # Handy for debugging. Keep this.
     if self.password:   # Id with NickServ
-        connection.privmsg("NickServ", "identify " + connection.nickname + " " + self.password) # Identify with NickServ.
+        connection.privmsg("NickServ", "identify " + self.password) # Identify with NickServ.
     channels = self.db.all("SELECT name FROM channels WHERE network='" + self.network + "' AND autojoin=True")
     connection.mode(connection.get_nickname(), "+x")
-    connection.join(self.homechannel)
-    for channel in channels:    # Join channels with autojoin function.
-        connection.join(channel)
     do_everything_to.join(self, connection, self.homechannel)
-    connection.who(connection.get_nickname())   # Get whoreply to add bot to protectees.
+    for channel in channels:    # Join channels with autojoin function.
+        do_everything_to.join(channel)