From 0f4234dfc36bd813e6cf0c9e541b46d1e0882ddd Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 12 Aug 2014 19:58:44 +0100 Subject: [PATCH] Add checks for !hit --- dropbot/bot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dropbot/bot.py b/dropbot/bot.py index 572cd9a..39ff2df 100644 --- a/dropbot/bot.py +++ b/dropbot/bot.py @@ -337,8 +337,18 @@ class DropBot(ClientXMPP): if isinstance(dest, basestring): return dest + if self.map.node[dest]['security'] >= 0.5: + return '{} is a highsec system'.format(self.map.get_system_name(dest)) + ly = self.map.system_distance(source, dest) + if ly > 6.5 * (1 + (0.25 * 5)): + return '{} to {} is greater than {}ly (maximum jump range of all ships)'.format( + self.map.get_system_name(source), + self.map.get_system_name(dest), + 6.5 * (1 + (0.25 * 5)) + ) + res = [] for ship_class in base_range.keys(): res1 = []