# HG changeset patch # User Steve Losh # Date 1314398277 14400 # Node ID cb2d6c82204ae5fabdb84673692b11ce6811cb6a # Parent d65fe7dddf1f0c20e0c44438c8584e71524977d0 More docs. diff -r d65fe7dddf1f -r cb2d6c82204a docs/source/basics.rst --- a/docs/source/basics.rst Fri Aug 26 18:25:34 2011 -0400 +++ b/docs/source/basics.rst Fri Aug 26 18:37:57 2011 -0400 @@ -1,10 +1,45 @@ Basic Concepts ============== -When you connect to a server you get a ``Bot`` object back. You can connect with -``(clojurecraft.core/connect {:name "hostname" :port INT} "username")``. +The basic flow of creating a Minecraft bot with Clojurecraft looks like this: + +* Connect to a Minecraft server to get a ``Bot`` object. +* Define and add events handlers to the bot. +* Define and add loops to the bot. +* Let the bot do its thing. +* Disconnect the bot from the server. + +You can also manually tell a bot to perform actions from a REPL. + +Connecting +---------- + +You can connect to a Minecraft server with the ``connect`` function:: + + (clojurecraft.core/connect {:name "hostname" :port INT} "username") + +You can also pass ``nil`` as a username to get a random string of letters. -Once you've got a bot you can query it for data about its world and tell it to -perform actions. +When you connect to a server you get a ``Bot`` object back. Once you've got a bot +you can query it for data about its world, tell it to perform actions, and add event +handlers and loops. + +Event Handlers +-------------- + +Event handlers are functions that let your bot react to things that happen in the +world. Check out the :doc:`Event Handlers ` page for more information. +Loops +----- +Loops are functions that run every ``N`` milliseconds and let your bot query the +world and perform actions. Check out the :doc:`Loops ` page for more +information. + +Disconnecting +------------- + +To disconnect a bot from the server you simply call the ``disconnect`` function:: + + (clojurecraft.core/disconnect bot) diff -r d65fe7dddf1f -r cb2d6c82204a docs/source/index.rst --- a/docs/source/index.rst Fri Aug 26 18:25:34 2011 -0400 +++ b/docs/source/index.rst Fri Aug 26 18:37:57 2011 -0400 @@ -9,7 +9,13 @@ Check out the :doc:`Quick Start Guide ` if you want to poke around. -Concepts: +* Mercurial Repo: http://bitbucket.org/sjl/clojurecraft/ +* Git Repo: http://github.com/sjl/clojurecraft/ +* Documentation: http://clojurecraft.rtfd.org/ +* Issue Tracker: http://github.com/sjl/clojurecraft/issues/ + +Table of Contents +----------------- .. toctree:: :maxdepth: 2 @@ -21,11 +27,3 @@ actions events loops - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`search` -