Explorar el Código

+cmds, improved seen situations

tBKwtWS hace 7 años
padre
commit
d4257d5504

+ 1 - 1
.eric6project/pyRot.e4q

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
 <!-- eric6 user project file for project pyRot -->
-<!-- Saved: 2018-01-30, 19:14:24 -->
+<!-- Saved: 2018-01-31, 21:43:51 -->
 <!-- Copyright (C) 2018 tBKwtWS,  -->
 <UserProject version="4.0"/>

+ 3 - 3
.eric6project/pyRot.e6t

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Tasks SYSTEM "Tasks-6.0.dtd">
 <!-- eric6 tasks file for project pyRot -->
-<!-- Saved: 2018-01-31, 06:25:13 -->
+<!-- Saved: 2018-02-01, 00:19:48 -->
 <Tasks version="6.0">
   <ProjectScanFilter></ProjectScanFilter>
-  <Task priority="1" completed="False" type="2" uid="{7da1d702-43e1-40c8-a2c0-496a31ac473d}">
+  <Task priority="1" completed="False" type="2" uid="{aeb672c5-28c2-4630-9db2-9db0d843520e}">
     <Summary>WARNING: &quot; + str(message))</Summary>
     <Description></Description>
-    <Created>2018-01-31, 06:25:10</Created>
+    <Created>2018-02-01, 00:19:45</Created>
     <Resource>
       <Filename>common/log.py</Filename>
       <Linenumber>8</Linenumber>

+ 1 - 1
commands/admin.py

@@ -22,7 +22,7 @@ def do_command(self, connection, event):
         if not userstatus.atleast_oper(self, event.source.nick, self.homechannel) and not userstatus.atleast_oper(self, event.source.nick, event.target): # Does not have at least voiced status in homechannel or operator status in target channel.
             return
     
-    if command == "cmd" or command == "commands":
+    if command == "cmd" or command == "cmds" or command == "commands":
         if cmdtype == "cmd":
             message = grey + "Admin: "
             if CH.ccc(self, "channelfunctions",  {"homechan": "oper", "chan": "oper"}, event):

+ 1 - 1
commands/games.py

@@ -18,7 +18,7 @@ def do_command(self, connection, event):
     if not self.db.one("SELECT games FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'") and not event.target == connection.get_nickname():
         return  # Do noting if the games channel function is off and it's a channel message.
     
-    if command == "cmd" or command == "commands":
+    if command == "cmd" or command == "cmds" or command == "commands":
         if cmdtype == "cmd":
             connection.privmsg(replyto, grey + "Games: " + CH.ccc(self, "8ball") + CH.ccc(self, "dice")[:-2] + ".")
     

+ 1 - 1
commands/public.py

@@ -29,7 +29,7 @@ def do_command(self, connection, event):
             else:   # Channel message.
                 connection.privmsg(replyto, str(self.channels[event.target]))
             
-    elif command == "cmd" or command == "commands":
+    elif command == "cmd" or command == "cmds" or command == "commands":
         if cmdtype == "help":    #Display help text.
             if len(command.split()) is not 1:
                 return

+ 11 - 4
commands/statistics.py

@@ -18,7 +18,7 @@ def do_command(self, connection, event):
     if not self.db.one("SELECT statistics_commands FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'") and not event.target == connection.get_nickname():
         return  # Do noting if the games channel function is off and it's a channel message.
 
-    if command == "cmd" or command == "commands":
+    if command == "cmd" or command == "cmds" or command == "commands":
         if cmdtype == "cmd":
             connection.privmsg(replyto, grey + "Statistics commands: " + CH.ccc(self, "seen") + CH.ccc(self, "joins") + CH.ccc(self, "kicks") + CH.ccc(self, "messages") + CH.ccc(self, "actions") + CH.ccc(self, "notices")[:-2] + ".")
     
@@ -144,9 +144,16 @@ def do_command(self, connection, event):
                     print("SELECT last_act_type FROM users WHERE LOWER(name)='" + command.split()[1] + "' AND network='" + self.network + "'")
                     print(self.db.one("SELECT last_act_type FROM users WHERE LOWER(name)='" + command.split()[1] + "' AND network='" + self.network + "'"))
                     connection.action(replyto, "has never seen " + red + command.split()[1] + reset + ".")
+                elif command.split()[1] == connection.get_nickname().lower():
+                    connection.action(replyto, "never forgets to look in the mirror.")
+                elif command.split()[1] == event.source.nick:
+                    connection.action(replyto, "holds up a mirror to " + event.source.nick)
                 else:
                     record = self.db.one("SELECT last_act_type, last_act_datetime, last_act_channel, last_act, last_act_auxiliary FROM users WHERE LOWER(name)='" + command.split()[1] + "' AND network='" + self.network + "'")
-                    action = "last saw " + red + trigger.split()[1] + reset + " "
+                    if command.split()[1] == connection.get_nickname().lower():
+                        action = "last act"
+                    else:
+                        action = "last saw " + red + trigger.split()[1] + reset + " "
                     print(record)
                     if record[0] == "nick":
                         action += "changing nickname to " + red + record[3]
@@ -192,10 +199,10 @@ def do_command(self, connection, event):
                         action += blue + "just now."
                     elif differential.seconds < 60: # Less then a minute.
                         action += green + str(differential.seconds) + blue + " seconds " + reset + "ago."
-                    elif differential.seconds == 60: # 1 minute.
+                    elif differential.seconds / 60 == 1: # 1 minute.
                         action += green + "1 " + blue + "minute " + reset + "ago."
                     elif int(differential.seconds / 60) < 60:   # Less then an hour.
-                        action += green + str(int(differential.seconds / 60)) + " minutes " + reset + "ago."
+                        action += green + str(int(differential.seconds / 60)) + blue + " minutes " + reset + "ago."
                     elif int(differential.seconds / 60) ==  60: # 1 hour.
                         action += green + "1 " + blue + "hour " + reset + "ago."
                     elif int(differential.seconds / 3600) < 24 : # Less then a day.

+ 0 - 1
common/do_everything_to.py

@@ -15,7 +15,6 @@ def join(self, connection, channel, key=False):
     elif knownkey:
         connection.join(channel, key)
     else:
-        print("executing join " + channel)
         connection.join(channel)
 
 def unban(connection, channel, user, mask):