Pārlūkot izejas kodu

Stop PlanetUp if turns < 200.

Steve Thielemann 5 gadi atpakaļ
vecāks
revīzija
8ff32cf116
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  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()