diff options
| author | troido <troido@protonmail.com> | 2020-04-05 13:15:55 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-05 13:15:55 +0200 |
| commit | b0980b660caa822f2e7654dfdd4f514e0c1b63a3 (patch) | |
| tree | adafb86ba628f50511d494a7fc4ca47281f0dde0 /asciifarmclient | |
| parent | b6910ef70d25898ffb787181a6d486283094068a (diff) | |
added interact command
Diffstat (limited to 'asciifarmclient')
| -rw-r--r-- | asciifarmclient/commandhandler.py | 6 | ||||
| -rw-r--r-- | asciifarmclient/inputhandler.py | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/asciifarmclient/commandhandler.py b/asciifarmclient/commandhandler.py index ec5baa3..99d8b5a 100644 --- a/asciifarmclient/commandhandler.py +++ b/asciifarmclient/commandhandler.py @@ -38,7 +38,9 @@ class CommandHandler: "j": self.json, "ijson": self.ijson, "ij": self.ijson, - "hy": self.hy + "hy": self.hy, + "interact": self.interact, + "q": self.interact } self.evalArgs = { @@ -147,4 +149,6 @@ class CommandHandler: def ijson(self, text): self.input(json.loads(text)) + def interact(self, arg): + self.input(["interact", [None, "north", "south", "east", "west"], arg]) diff --git a/asciifarmclient/inputhandler.py b/asciifarmclient/inputhandler.py index 4281c01..0dd356f 100644 --- a/asciifarmclient/inputhandler.py +++ b/asciifarmclient/inputhandler.py @@ -40,7 +40,7 @@ class InputHandler: try: self.commandHandler.execute([command, arg]) except Exception as e: - self.log(e) + self.client.log(e) except InvalidCommandException as e: self.client.log(", ".join(e.args)) else: |
