Ver Fonte

Stop PlanetUp if turns < 200.

Steve Thielemann há 5 anos atrás
pai
commit
8ff32cf116
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      flexible.py

+ 6 - 0
flexible.py

@@ -2426,6 +2426,12 @@ class PlanetUpScript(object):
                 _, _, holds = line.partition('[')
                 _, _, holds = line.partition('[')
                 holds, _, _ = holds.partition(']')
                 holds, _, _ = holds.partition(']')
                 self.fetch_amount = int(holds)
                 self.fetch_amount = int(holds)
+            if line.startswith('One turn deducted, '):
+                parts = line.split()
+                turns = int(parts[3])
+                if turns < 200:
+                    self.queue_game.put(self.nl + Boxes.alert("LOW TURNS.") + self.nl)
+                    self.deactivate()                    
         elif self.state == 9:
         elif self.state == 9:
             if re.match(r'You have \d turns left.', line):
             if re.match(r'You have \d turns left.', line):
                 parts = line.split()
                 parts = line.split()