|
@@ -543,9 +543,7 @@ class ScriptPort(object):
|
|
|
self.observer.connect("game-line", self.game_line)
|
|
|
|
|
|
self.defer = None
|
|
|
- self.queue_game.put(
|
|
|
- self.nl + "Script based on: Port Pair Trading v2.00" + self.r + self.nl
|
|
|
- )
|
|
|
+ self.send2player("Script based on: Port Pair Trading v2.00")
|
|
|
|
|
|
self.possible_sectors = None
|
|
|
|
|
@@ -585,6 +583,16 @@ class ScriptPort(object):
|
|
|
def player(self, chunk: bytes):
|
|
|
|
|
|
self.deactivate()
|
|
|
+
|
|
|
+ def send2game(self, txt):
|
|
|
+ log.debug("ScriptPort.send2game({0})".format(txt))
|
|
|
+ self.queue_player.put(txt)
|
|
|
+
|
|
|
+ def send2player(self, txt):
|
|
|
+ log.debug("ScriptPort.send2player({0})".format(txt))
|
|
|
+ self.queue_game.put(
|
|
|
+ self.nl + txt + self.r + self.nl
|
|
|
+ )
|
|
|
|
|
|
def game_prompt(self, prompt: str):
|
|
|
log.debug("{0} : {1}".format(self.state, prompt))
|
|
@@ -711,9 +719,9 @@ class ScriptPort(object):
|
|
|
self.sell_percent += 1
|
|
|
self.queue_player.put("{0}\r".format(price))
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
elif self.state == 8:
|
|
|
|
|
@@ -1088,9 +1096,11 @@ class ScriptExplore(object):
|
|
|
self.deactivate(True)
|
|
|
|
|
|
def send2game(self, txt):
|
|
|
+ log.debug("ScriptExplore.send2game({0})".format(txt))
|
|
|
self.queue_player.put(txt)
|
|
|
|
|
|
def send2player(self, txt):
|
|
|
+ log.debug("ScriptExplore.send2player({0})".format(txt))
|
|
|
self.queue_game.put(
|
|
|
self.nl + txt + self.r + self.nl
|
|
|
)
|