summaryrefslogtreecommitdiff
path: root/asciifarm/client/keymacros.hy
blob: 65e2993515446e9cf749e92cef5c06f5bd147013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


(defmacro send [data]
    `(self.client.send ~data))

(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)))

(defmacro selector [name]
    `(self.display.getSelector ~name))

(defmacro selectorvalue [name]
    `(.getValue (selector ~name)))

(defmacro log [text]
    `(self.client.log ~text))