diff options
| author | troido <troido@hotmail.com> | 2018-01-04 14:05:06 +0100 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2018-01-04 14:05:06 +0100 |
| commit | 1bc93078cc5c2801236a5a6f57bb56ae5081a844 (patch) | |
| tree | 84491cab4dd2c9de438199311b66497e9f22e6c3 /asciifarm/client | |
| parent | d5acb180fd04b6dced596ada2a005467b2e75382 (diff) | |
no quotes necessary anymore in keybindings keys. Added some macros
Diffstat (limited to 'asciifarm/client')
| -rw-r--r-- | asciifarm/client/inputhandling.hy | 2 | ||||
| -rw-r--r-- | asciifarm/client/keymacros.hy | 12 |
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))) |
