From a9b5576be273a17c9f5100599c6f6eeb22685c3c Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 12 Aug 2014 19:16:25 +0100 Subject: [PATCH] Added map stats. --- dropbot/bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dropbot/bot.py b/dropbot/bot.py index 06bc4b5..7cc76b1 100644 --- a/dropbot/bot.py +++ b/dropbot/bot.py @@ -333,4 +333,11 @@ class DropBot(ClientXMPP): dest_system = dest_systems[0] self.map.add_jumpbridge(source_system, dest_system) - return "Done" \ No newline at end of file + return "Done" + + def cmd_mapstats(self, args, msg): + return '{} systems, {} gate jumps, {} jump bridges'.format( + len(self.map.nodes()), + len([u for u, v, d in self.map.edges_iter(data=True) if d['link_type'] == 'gate']), + len([u for u, v, d in self.map.edges_iter(data=True) if d['link_type'] == 'bridge']) + ) \ No newline at end of file