Explorar o código

Stop PlanetUp if turns < 200.

Steve Thielemann %!s(int64=5) %!d(string=hai) anos
pai
achega
8ff32cf116
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      flexible.py

+ 6 - 0
flexible.py

@@ -2426,6 +2426,12 @@ class PlanetUpScript(object):
                 _, _, holds = line.partition('[')
                 holds, _, _ = holds.partition(']')
                 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:
             if re.match(r'You have \d turns left.', line):
                 parts = line.split()