|
@@ -2576,8 +2576,6 @@ class ColoScript(object):
|
|
|
ask1 = PlayerInput(self.game)
|
|
|
d1 = ask1.prompt("How many times", 3, name="rolls", digits=True)
|
|
|
d1.addCallback(self.loop_chosen)
|
|
|
- self.state = 4
|
|
|
- self.send2game("1\r")
|
|
|
else:
|
|
|
self.deactivate()
|
|
|
|
|
@@ -2589,6 +2587,7 @@ class ColoScript(object):
|
|
|
self.maxloops = self.loops
|
|
|
self.state = 4
|
|
|
self.send2game("1\r")
|
|
|
+ # Jump to moving to sector 1
|
|
|
|
|
|
def game_prompt(self, prompt: str):
|
|
|
log.debug("P {0} | {1}".format(self.state, prompt))
|
|
@@ -2649,7 +2648,7 @@ class ColoScript(object):
|
|
|
elif prompt.startswith('Engage the Autopilot? (Y/N/Single step/Express) [Y]'):
|
|
|
self.queue_player.put("E")
|
|
|
elif prompt.startswith('Stop in this sector (Y,N,E,I,R,S,D,P,?) (?=Help) [N] ?'):
|
|
|
- self.queue_player.put("EY")
|
|
|
+ self.queue_player.put("N")
|
|
|
elif re.match(r"Command \[TL=.* \(\?=Help\)\? :", prompt):
|
|
|
self.state = 4
|
|
|
self.send2game("1\r")
|
|
@@ -2661,7 +2660,7 @@ class ColoScript(object):
|
|
|
elif prompt.startswith('Engage the Autopilot? (Y/N/Single step/Express) [Y]'):
|
|
|
self.queue_player.put("E")
|
|
|
elif prompt.startswith('Stop in this sector (Y,N,E,I,R,S,D,P,?) (?=Help) [N] ?'):
|
|
|
- self.queue_player.put("EY")
|
|
|
+ self.queue_player.put("N")
|
|
|
elif re.match(r"Command \[TL=.* \(\?=Help\)\? :", prompt):
|
|
|
self.state = 5
|
|
|
self.send2game("L")
|
|
@@ -2682,7 +2681,7 @@ class ColoScript(object):
|
|
|
elif prompt.startswith('Engage the Autopilot? (Y/N/Single step/Express) [Y]'):
|
|
|
self.queue_player.put("E")
|
|
|
elif prompt.startswith('Stop in this sector (Y,N,E,I,R,S,D,P,?) (?=Help) [N] ?'):
|
|
|
- self.queue_player.put("EY")
|
|
|
+ self.queue_player.put("N")
|
|
|
elif re.match(r"Command \[TL=.* \(\?=Help\)\? :", prompt):
|
|
|
self.state = 6
|
|
|
self.send2game("L")
|
|
@@ -2719,6 +2718,15 @@ class ColoScript(object):
|
|
|
|
|
|
def game_line(self, line: str):
|
|
|
log.debug("L {0} | {1}".format(self.state, line))
|
|
|
+ # IF at any state we see turns left lets grab it
|
|
|
+ if 'turns left' in line:
|
|
|
+ work = line[19:].replace(' turns left.', '').strip()
|
|
|
+ self.turns = work
|
|
|
+ log.info("TURNS LEFT: {0}".format(self.turns))
|
|
|
+ if int(self.turns) < 200:
|
|
|
+ self.send2player("\r" + Boxes.alert("Low Turns! ({0})".format(self.turns)))
|
|
|
+ self.deactivate()
|
|
|
+ # Now back to our scheduled program
|
|
|
if self.state == 1:
|
|
|
if 'Personal Planet Scan' in line or 'Corporate Planet Scan' in line:
|
|
|
self.state = 2
|
|
@@ -2754,14 +2762,6 @@ class ColoScript(object):
|
|
|
self.planets[number]['ore'] = details[5]
|
|
|
self.planets[number]['org'] = details[6]
|
|
|
self.planets[number]['equ'] = details[7]
|
|
|
- elif self.state == 6:
|
|
|
- if 'turns left' in line:
|
|
|
- work = line[19:].replace(' turns left.', '').strip()
|
|
|
- self.turns = work
|
|
|
- log.info("TURNS LEFT: {0}".format(self.turns))
|
|
|
- if int(self.turns) < 200:
|
|
|
- self.send2player("\r" + Boxes.alert("Low Turns! ({0})".format(self.turns)))
|
|
|
- self.deactivate()
|
|
|
|
|
|
class ProxyMenu(object):
|
|
|
""" Display ProxyMenu
|