summaryrefslogtreecommitdiff
path: root/asciifarm/client
diff options
context:
space:
mode:
Diffstat (limited to 'asciifarm/client')
-rw-r--r--asciifarm/client/inputhandling.hy2
-rw-r--r--asciifarm/client/keymacros.hy12
2 files changed, 13 insertions, 1 deletions
diff --git a/asciifarm/client/inputhandling.hy b/asciifarm/client/inputhandling.hy
index dbe5dd4..64b67e7 100644
--- a/asciifarm/client/inputhandling.hy
+++ b/asciifarm/client/inputhandling.hy
@@ -13,7 +13,7 @@
(defn readCommands [self commandsstring]
(setv self.commands
(dict-comp
- (eval key)
+ (str key)
(
(eval `(do
(require [asciifarm.client.keymacros [*]])
diff --git a/asciifarm/client/keymacros.hy b/asciifarm/client/keymacros.hy
index b39ef5e..65e2993 100644
--- a/asciifarm/client/keymacros.hy
+++ b/asciifarm/client/keymacros.hy
@@ -6,6 +6,18 @@
(defmacro inp [action]
`(send ["input" ~action]))
+(defmacro move [dir]
+ `(inp ["move" ~dir]))
+
+(defmacro say [text]
+ `(inp ["say" ~text]))
+
+(defmacro log [text]
+ `(self.client.log ~text))
+
+(defmacro chat [text]
+ `(send ["chat" ~text]))
+
(defmacro doall [actions]
`(for [action ~actions] (action)))