<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Furc!Wank &#187; FurBot</title>
	<atom:link href="http://wank.furced.net/tags/tutorials/furbot/feed/" rel="self" type="application/rss+xml" />
	<link>http://wank.furced.net</link>
	<description>WERE IN UR DREAMZ... WERE JUDGIN UR RPZ!</description>
	<lastBuildDate>Fri, 08 Jun 2007 10:43:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building a Basic Dream Bot</title>
		<link>http://wank.furced.net/archive/building-a-basic-dream-bot/</link>
		<comments>http://wank.furced.net/archive/building-a-basic-dream-bot/#comments</comments>
		<pubDate>Thu, 10 May 2007 03:24:07 +0000</pubDate>
		<dc:creator>the skullkitty</dc:creator>
				<category><![CDATA[FurBot]]></category>

		<guid isPermaLink="false">http://furc.void-star.net/wank/archive/building-a-basic-dream-bot/</guid>
		<description><![CDATA[ Every dream needs a bot.  Well, this probably isn&#8217;t strictly true but bots can definitely add some ease-of-use functionality to your dream, particularly with their ability to auto-summon players.  They&#8217;re also useful for various other sneaky dream maintenance tasks like logging visitors, and acting as a kind of &#8216;messaging service&#8217; for people [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot000.png" rel="flashbox[fb]" title="The FurBot main window."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot000.thumbnail.png' alt="FurBot: Main Window" class="postimg imgleft"></a> Every dream needs a bot.  Well, this probably isn&#8217;t strictly true but bots can definitely add some ease-of-use functionality to your dream, particularly with their ability to auto-summon players.  They&#8217;re also useful for various other sneaky dream maintenance tasks like logging visitors, and acting as a kind of &#8216;messaging service&#8217; for people to leave comments about how awesome your dream is.</p>
<p>The good news is that bots are not hard to make.  In fact, by the end of this post you will not only have a bot that does all of the above, but will also hopefully become familiar enough with the interface to extend its functionality to suit your own dream.  So let&#8217;s get started.</p>
<p>First off, you&#8217;re going to need to <a href="http://furbot.dreammakersguild.com/" class="ext" title="FurBot">download FurBot</a>. Originally developed by <a href="http://furc.sanct.net/" class="ext" title="sanctimonious' ultimate DISASTER site">sanctimonious</a>, it is probably <em>the</em> most popular bot client currently running in Furcadia.  As a bonus to anyone experienced with dreamweaving, the command scripting interface is fairly similar to the DragonSpeak editor, which is always nice.</p>
<p>Okay, so go download FurBot and run the installer. I&#8217;ll wait here until you get back&#8230;</p>
<p>&#8230; okay great.  Now it&#8217;s time to open the client. You should be presented with a window similar to the one above. We don&#8217;t currently have a bot open, so it&#8217;s a good idea to create one straight away (it&#8217;s highly likely that you <em>will</em> crash the client, so remember to save early and save often). The first thing we need to do is check some settings, so go <strong>File > Configuration</strong>. In the configuration window, make sure the following information is filled in:</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot000.png" rel="flashbox[fb]" title="FurBot configuration settings."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot001.png' alt='FurBot: Configuration' class="postimg"></a></div>
<p>Obviously make sure that the <strong>Furcadia client program</strong> points to your <code>Furcadia.exe</code> application.  There&#8217;s also a caveat here with the <strong>Who Is Online Detection</strong> setting; I can never make this work by simply ticking the box (it always unticks itself).  Instead, change the number in the <em>Execute map Who every</em> box and hit <strong>Save</strong>.  You can tell if the WhoIs is working (and we <em>will</em> need it) because &#8212; once connected to Furcadia &#8212; the results will appear in the log message on the main FurBot screen.  But we&#8217;re getting a bit ahead of ourselves.</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot002.png" rel="flashbox[fb]" title="FurBot bot command settings."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot002.png' alt='FurBot: Bot' class="postimg"></a></div>
<p>Next we need to turn on the parts of our bot that we will be using.  Bots can perform several different tasks:</p>
<ul>
<li><strong>Actions</strong> are triggered when the bot &#8216;hears&#8217; another furre. Whispers, speech and emits can all be triggers for actions.</li>
<li><strong>Filters</strong> don&#8217;t actually make the bot &#8216;do&#8217; anything. Instead they govern what data is recorded in the logs and presented in the main bot window.</li>
<li><strong>Timers</strong> cause something to happen after a certain period of time has elapsed.</li>
<li><strong>Triggers</strong> are a bit like actions but are (a-har) triggered by non-speech events.</li>
<li>Finally, <strong>who detection</strong> commands manipulate data returned by the bot&#8217;s <code>`who</code> tick.</li>
</ul>
<p>We are going to be using <em>actions</em>, <em>triggers</em> and <em>who detection</em>, so make sure these three options are ticked.</p>
<p>Our next step is to actually make a character to use as our bot.  Boot up the Furcadia client and make a character in the usual way.  I&#8217;ve called mine <strong>F!W Test Bot</strong>.  Get it into the game and park it somewhere reasonably private (preferably a private dream).  Remember, that while bots are legal on Furcadia they are still governed by the same rules as normal players.  It&#8217;s highly likely that at least once you&#8217;ll end up making your bot do something stupid (such as spam random text), so it&#8217;s best to put it somewhere it won&#8217;t bother other users (and they won&#8217;t bother it).  Once you&#8217;re happy with your spot, log out of the client.</p>
<p>Back in FurBot, Click the <strong>Edit</strong> button under <em>Current bot</em>.</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot003.png" rel="flashbox[fb]" title="FurBot bot settings."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot003.png' alt='FurBot: Edit Bot' class="postimg"></a></div>
<p>From this window, click <strong>Load from .INI&#8230;</strong> and select the <code>.ini</code> file for the bot character you just made.  Make sure all the details are correct, and press <strong>Save</strong>.</p>
<p><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot004.png" rel="flashbox[fb]" title="The bot goes live!"><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot004.thumbnail.png' alt='FurBot: The Bot' class="postimg imgleft"></a>Now we save the bot (<strong>File > Save bot</strong>).  Make sure to put it somewhere you&#8217;ll easily find it again; I put mine inside <code>My Documents/Furcadia/Bots</code>.  Now it&#8217;s time to connect the bot to the game, so from the main FurBot window press <strong>Connect</strong>.  If all is well and good, the Furcadia client should open up and your bot should appear on the screen, standing wherever it was when you logged it out.  Assuming you&#8217;ve set FurBot&#8217;s options correctly, after a few moment a message should appear in the client window telling you that you may close the client (that&#8217;s Furcadia, <em>not</em> FurBot).  Do so.  If you look back at the FurBot window, it should still appear connected. The easiest way to tell is to look at the icon in the system tray (next to the clock); if the traffic light is green, the bot is online.  Also make sure that your bot is who&#8217;ing appropriately; you should see the output of the who appear in FurBot&#8217;s log every now and again.  If it doesn&#8217;t, open back up the configuration window and change the time increment until it starts.</p>
<p><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot005.png" rel="flashbox[fb]" title="Setting up an auto-summon."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot005.thumbnail.png' alt='FurBot: Edit Triggers' class="postimg imgright"></a>Okay, so we&#8217;ve got a bot but it doesn&#8217;t actually <em>do</em> anything at the moment.  Time to fix that.  First off, we&#8217;re going to make it auto-summon.  Open up the <strong>Editing Triggers</strong> window and click <strong>Add</strong>.  Fill in the details as shown.  To get the <strong>Editing Effects</strong> pane open, click <strong>Add</strong> underneath the the &#8216;then&#8217; textbox.  To save the trigger, click <strong>Save</strong>, then <strong>Update</strong>, then <strong>Save Changes</strong> (and yes, it&#8217;s convoluted; I &#8216;drop&#8217; rules all the time due to mis-clicks!).</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot010.png" rel="flashbox[fb]" title="Testing the summoning bot..."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot010.png' alt='FurBot: Join Bot 1' class="postimg"></a></div>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot011.png" rel="flashbox[fb]" title="... success!"><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot011.png' alt='FurBot: Join Bot 2' class="postimg"></a></div>
<p>Once you&#8217;ve clicked save (or <strong>Apply</strong>) in the triggers window, save your bot again.  Now it&#8217;s time to test your rule.  Boot up Furcadia again and open a different character.  Request to join your bot; hopefully, you should be instantly whisked away to its location!</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot006.png" rel="flashbox[fb]" title="Creating the log arrivals rule..."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot006.thumbnail.png' alt='FurBot: Log Arrivals' class="postimg"></a> <a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot007.png" rel="flashbox[fb]" title="... and the log departures rule."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot007.thumbnail.png' alt='FurBot: Log Departures' class="postimg"></a></div>
<p>Now we&#8217;re going to make the log arrivals and departures rule.  For this, we&#8217;re going to need open up <strong>Edit Who Detection</strong>.  In a similar way that you created the auto-summon trigger, fill in the WhoIs window as above.  This time we&#8217;re making two separate rules, so you&#8217;ll have to go through the process twice.  You&#8217;ll notice we&#8217;ve got some words in square brackets.  These represent <em>variables</em> in FurBot.  A variable is a word that, when the script is executed, will be replaced with another value.  There are quite a number of internal FurBot variables (full details can be found on the website), and you can define your own using WolfScript, but for now the ones we&#8217;ll be using are as follows:</p>
<ul>
<li><code>[DATE]</code> will be replaced by the current date in US format (mm-dd-yyyy).</li>
<li><code>[TIME]</code> will be replaced by the current time (24-hours, no seconds).</li>
<li><code>[PLAYER]</code> will be replaced by the name of the furre that triggers the script (in this case, the furre entering or leaving the dream).</li>
<li><code>[APPDIR]</code> will be replaced by the path to the directory where the bot is run from; usually the FurBot install directory. You can replace this with a hard-coded path (i.e. to the folder where you saved your bot).</li>
</ul>
<p>You&#8217;ll also notice that where it says <em>If _______ comes to the map</em> we have an asterisk (<code>*</code>) in place of a name.  The asterisk is what&#8217;s known as a <em>wildcard character</em>, and in this case it will match anything.  You can, of course, put an actual name in this space however that would mean the script was triggered only when that furre entered the dream.  Since we want this to log <em>everyone</em>, we use the wildcard.</p>
<p>Save your two new detections and it&#8217;s time to test them out once more.  To do this, simply leave and then re-enter the dream containing your bot (or, if you&#8217;re on a public or otherwise popular map, just let it run for a while).  Note that FurBot gets its player information on each tick of the <code>`who</code> command, so it&#8217;s theoretically possible to jump in an out of a dream quickly enough to not be &#8216;detected&#8217; by the bot.  If you&#8217;re having a problem with &#8216;missing&#8217; players in this fashion, you can simply set the who tick to a shorter duration.  Anyway, when you think you&#8217;ve got a few records, open up your <code>visitors.log</code> file from wherever you decided to save it (it&#8217;s a plain text file, so opening it with Notepad is okay).  If all is well, you should see some lines that look similar to:</p>
<p><code class="codeblock">"05-10-2007 12:04   IN    Loki|Laufeyjarson"<br />
"0"<br />
"05-10-2007 12:06   OUT   Loki|Laufeyjarson"<br />
"0"</code></p>
<p>Don&#8217;t worry about the numbers in the quotation marks for now; these are markers for more complex log manipulations by FurBot.</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot008.png" rel="flashbox[fb]" title="The whisper log. First we reply to the user..."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot008.thumbnail.png' alt='FurBot: Whisper Reply' class="postimg"></a> <a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot009.png" rel="flashbox[fb]" title="... then we log their message."><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot009.thumbnail.png' alt='FurBot: Whisper Log' class="postimg"></a></div>
<p>We&#8217;re almost done.  The final thing we want out bot to do is reply to anyone who whispers it, and to log their message in a file so we can read it later.  Open up <strong>Editing Actions</strong> and create a new action as follows.  This action has two parts to its <em>Then</em> clause instead of the one we&#8217;ve previously been using.  The first one replies to the whisperer (note that to get the &#8216;large&#8217; editing text box, simply double-click in the small text box normally provided).  If you want to insert your own dream URL into the message as opposed to F!Ws (though of course we wouldn&#8217;t say no to the publicity), you can use <code>[DREAMURL]</code>.  Note that this will take the last dream retrieved from <code>`who</code>, so it will only work <em>if your bot is sitting in your own dream</em>.</p>
<p>The next part of the rule we&#8217;re going to add will log the message that was whispered to our bot; this is similar to what we did for logging arrivals and departures, except this time our <em>0 Record Name</em> line looks like:</p>
<p><code class="codeblock">[DATE] [TIME]   [PLAYER]: [MESSAGE]</code></p>
<p><code>[MESSAGE]</code> is another internal variable which returns the message from the triggering player (more technically, it&#8217;s everything after the first space character).</p>
<div style="text-align: center"><a href="http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot012.png" rel="flashbox[fb]" title="The bot talks back!"><img src='http://furc.void-star.net/wank/wp-content/uploads/2007/05/furbot012.png' alt='FurBot: Auto-Reply' class="postimg"></a></div>
<p>Save your new action (and your bot) and test it out by booting up Furcadia and whispering your bot. You should get a response back, and your <code>whispers.log</code> should record the message.</p>
<p>And that&#8217;s it!  Congratulations, you&#8217;ve successfully made a very simple yet hugely useful dream bot.</p>
<h4>More&#8230;</h4>
<ul>
<li><strong>Tutorial Files:</strong> <a href='http://furc.void-star.net/wank/wp-content/uploads/2007/05/fwtestbot00.zip' title='Download the full test bot.'>fwtestbot00.zip</a>.</li>
</ul>
<img src="http://wank.furced.net/?ak_action=api_record_view&id=53&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://wank.furced.net/archive/building-a-basic-dream-bot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
