dfb084418ef9

Tweaks.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 12 Aug 2011 18:06:44 -0400
parents 0ae169e20952
children 0ee291b1702d
branches/tags (none)
files docs/source/events.rst docs/source/quickstart.rst src/clojurecraft/events.clj

Changes

--- a/docs/source/events.rst	Wed Aug 10 02:01:06 2011 -0400
+++ b/docs/source/events.rst	Fri Aug 12 18:06:44 2011 -0400
@@ -19,12 +19,12 @@
 
 Then register the handler for the action::
 
-    (clojurecraft.events/add-handler bot :chat `jump-on-chat)
+    (clojurecraft.events/add-handler bot :chat #'jump-on-chat)
 
 Notice that you don't pass the function directly to the ``add-handler`` function.
-You pass a syntax quoted symbol to the function.  This is an extra character to type,
-but it means you can redefine the function in the REPL and your changes will take
-effect immediately in all of the currently running bots.
+You pass a symbol to the function.  This is two extra characters to type, but it
+means you can redefine the function in the REPL and your changes will take effect
+immediately in all of the currently running bots.
 
 Available Events
 ----------------
--- a/docs/source/quickstart.rst	Wed Aug 10 02:01:06 2011 -0400
+++ b/docs/source/quickstart.rst	Fri Aug 12 18:06:44 2011 -0400
@@ -6,6 +6,11 @@
     hg clone http://bitbucket.org/sjl/clojurecraft
     git clone http://github.com/sjl/clojurecraft.git
 
+Or if you don't want to bother you can just download and extract a tarball::
+
+    wget https://bitbucket.org/sjl/clojurecraft/get/tip.tar.gz -O clojurecraft.tar.gz
+    tar xzf clojurecraft.tar.gz
+
 Grab the dependencies using Leiningen (Cake will probably work too) and fire up
 a REPL::
 
--- a/src/clojurecraft/events.clj	Wed Aug 10 02:01:06 2011 -0400
+++ b/src/clojurecraft/events.clj	Fri Aug 12 18:06:44 2011 -0400
@@ -11,11 +11,10 @@
 
 
 (defn- fire-handler [bot event-type & args]
-  (let [action-groups (map #(apply (eval %) (into [bot] args))
+  (let [action-groups (map #(apply (deref %) (into [bot] args))
                            (event-type @(:event-handlers bot)))
         queue-action #(.put (:actionqueue bot) %)
         queue-action-group #(map queue-action %)]
-    (println action-groups)
     (dorun (map queue-action-group action-groups))))
 
 (defn fire-chat [bot message]