-
Notifications
You must be signed in to change notification settings - Fork 33
Tutorial: Your first launch
Before you can run Autumn and try out the example leaves, you’ll need to set up a few things. Here are the steps:
Autumn requires RubyGems and the Bundler gem. Install RubyGems then run gem install bundler && bundle install
in a command line in order to run Autumn.
If you wish to use a database backend for your bot, you may need to edit the Gemfile and replace the existing DataMapper adapter (dm-adapter-mysql
by default) with the one for your database.
The included example bot Scorekeeper uses a DataMapper backend. The other example bot, Insulter, is much simpler and can run under any Autumn configuration.
In Autumn, your leaves run in an environment, called a “season.” Each season has
different leaves and different settings for those leaves. By default, Autumn
comes with a season called “testing” already set up for you. You can edit that
season or create a new one with script/generate season [season name]
. The files for your season are stored in the config/seasons directory.
First, edit the stems.yml file. This file stores information about your IRC connection. Edit it to connect to an IRC server of your choosing. For more information, see the README.
Next, edit the database.yml file. As mentioned previously, Scorekeeper requires the DataMapper gem because it uses a persistent store. By default it’s set up to use a MySQL database, but you can use PostgreSQL or SQLite 3 if you’d like. (Remember to edit the Gemfile!) If you’d prefer not to install any of these database solutions, delete the database.yml file and remove the Scorekeeper leaf from the leaves.yml and stems.yml files.
Lastly, view the leaves.yml file. You shouldn’t have to make any changes to this file, but it’s a good idea to look at it to see how leaves are configured. You can do the same with the season.yml file. See the README for more.
If you’re going to be trying Autumn with the Scorekeeper leaf, you need a configured and migrated database. Create your database, then run DB=Scorekeeper rake db:migrate
to set up the tables. (There are no migration files in Autumn; each table is automatically created or updated from the schema of the model.)
Run the shell command script/server
to start the server. After a short while, your leaf should appear in the channel you specified. You can type “!points Coolguy +5” and then “!points” to get started using Scorekeeper, or “!insult” to play with Insulter. Have some fun, and when you’re satisfied, stop the server by typing “!quit”.
If you’d like to daemonize your server, you can use the shell commands
rake app:start
and rake app:stop
. For more information, see the README.