소스 검색

Stop PlanetUp if turns < 200.

Steve Thielemann 5 년 전
부모
커밋
8ff32cf116
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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()