Skip to content

Commit

Permalink
Change stats message
Browse files Browse the repository at this point in the history
Change greeter grace period, ignore commands not founds
  • Loading branch information
th3-z committed Apr 14, 2018
1 parent 7f75ee4 commit b26d0c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
3 changes: 0 additions & 3 deletions magicked_admin/chatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ def command_handler(self, username, args, admin=False):
response = command.execute(username, args, admin)
if not self.silent:
self.chat.submit_message(response)
# What would be the best way of handling CD commands?
elif username != "server" and not self.silent:
self.chat.submit_message("Sorry, I didn't understand that request.")

def execute_script(self, file_name):
logger.debug("Executing script: " + file_name)
Expand Down
2 changes: 1 addition & 1 deletion magicked_admin/chatbot/commands/event_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CommandGreeter(Command):
def __init__(self, server, admin_only=True):
Command.__init__(self, server, admin_only)

self.new_game_grace = 0.5 * 60
self.new_game_grace = 35
self.new_game_time = datetime.datetime.now()

def execute(self, username, args, admin):
Expand Down
20 changes: 9 additions & 11 deletions magicked_admin/chatbot/commands/info_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from chatbot.commands.command import Command
from server.player import Player
from utils.time import seconds_to_hhmmss
from utils.text import millify

import datetime

Expand Down Expand Up @@ -91,16 +92,13 @@ def execute(self, username, args, admin):
time = seconds_to_hhmmss(
player.total_time + session_time
)
message = "Stats for " + player.username + ":\n" + \
"Sessions:\t\t\t" + str(player.total_logins) + "\n" + \
"Play time:\t\t" + time +"\n" + \
"Deaths:\t\t\t" + str(player.total_deaths) + "\n" + \
"Kills:\t\t\t\t" + str(player.total_kills) + "\n" + \
"Dosh earned:\t\t" + str(player.total_dosh) + "\n" + \
"Dosh spent:\t\t" + str(player.total_dosh_spent) + "\n" + \
"Health lost:\t\t" + str(player.total_health_lost) + "\n" + \
"Dosh this game:\t" + str(player.game_dosh) + "\n" + \
"Kills this wave:\t\t" + str(player.wave_kills) + "\n" + \
"Dosh this wave:\t" + str(player.wave_dosh)
message = "Stats for {}:\n".format(player.username) +\
"Total play time: {} ({} sessions)\n"\
.format(time, player.total_logins) +\
"Total deaths: {}\n".format(player.total_deaths) +\
"Total kills: {}\n".format(millify(player.total_kills)) +\
"Total dosh earned: {}\n"\
.format(millify(player.total_dosh)) +\
"Dosh this game: {}".format(millify(player.game_dosh))

return message

0 comments on commit b26d0c5

Please sign in to comment.