Gratitude

June 19th, 2009

So something awesome happened this morning.  The hard drive in Vy’s computer died.

That’s not the awesome part.  The awesome part is that because I took the advice of jwz AND paid for the SuperDuper program AND consulted the wise and informative ifixit.com site, I was able to restore her system with no data loss.  That’s pretty awesome.

So I wanted to say how thankful I am to jwz for his great advice, to the fine coder(s?) behind ShirtPocket who made a program which does well what it says it will do and the technicians at iFixit who are able to explain clearly and usefully exactly how to get into the guts of Mac hardware.  I couldn’t have had a morning this awesome without all of you.  Keyboard cat, play us some Danny Halfelf.

Grieving

June 16th, 2009

Yeah, so, my friend died.

On purpose.

I’ve tried to think of something intelligent or even intelligible to say about it but I’m past the clarity of anger into the morass of despair about it.  He was a good guy and he did his best and I don’t have any idea why he did himself in.

I miss him.

Encounter Conversion: The Armorer

May 17th, 2009

This is TSR 9177 REF 3 The Book of Lairs by James M. Ward and Mike Breault p5.

Don’t worry.  If you’ve no idea what that means, this post isn’t directed at you.

  1. Door
    • Animated two-handed swords (2)
  2. Weapon forge
    • Animated hammers (6)
    • Animated spears (6)
    • Animated long swords (6)
    • Animated two-handed swords (6)
    • Animated morning stars (6)
  3. Armor forge
    • Suits of animated armor (2 * characters)
  4. Resting place
    • Iron golems (2)

If I ran this in 3.5 edition d20, the system I use most of the time I’m running these days, here’s how these four encounters might be converted.

Door:  Animated Object, obviously.  I’d make them Medium Greatswords, presuming them to be weapons crafted for Medium creatures and being two-handed, the same size class as the wielder.  Hardness 10 and flight seem appropriate additional special defense and special quality. I’d let them do Greatsword + 1 damage and leave their attack modifier at +2. I’d bump up the CR for these to 3 each instead of the CR2 for an ordinary Medium Animated Object monster.  So EL4, overall.

Weapon forge:  More Animated Objects.  The softer version considers the hammers to be light warhammers and thus Tiny, otherwise Small for the non-light version.  If the spears are short, Small.  If longspear, Medium.  Longswords are Small.  The two-handed swords become Medium Animated Object Greatswords, like the ones at the door.  The morning stars are Small. Again granting them Hardness 10, flight, and normal damage +1 for weapons of their type at +2 to hit over conventional Animated Object monsters bumps up the CRs.  The lowest range I’d use would be 6 + 12 + 12 + 18 + 12 and the high end would be 12 + 18 + 12 + 18 + 12.  Either way this is EL9 or EL10 territory.  If the party got clever and split up the attackers somehow, controlled terrain to only let a few come at them at a time, I’d award the full xp for an EL10 encounter.  Perversely if they went in against all the weapons at once, only EL9 xp.  I’m mean that way.

Armor forge: Surprise.  More Animated Object monsters.  I’d make them unmodified Medium.  At 2 suits per character, that makes this one EL (party size + 4).

Resting place:  Straight up pair of by the book Iron Golem monsters.  The only thing unusual about them is that these are chatty and being chatty isn’t a special attack.  EL15.

Given all that, I’d run this scenario for a party with an average character level of 10 or so.  Slightly lower would probably be okay if they are good at managing terrain or willing to back out when they hit the blade storm in the Weapon Forge.

Alphabetically, Starting with 9

May 17th, 2009

While on the course of wondering something almost as silly, I decided to see what kind of distribution of software packages my laptop has installed.  It turns out to be skewed wildly in favor of the letter L.

dpkg –get-selections |  grep -v deinstall | cut -c 1 | sort | uniq -c

  • 1 9
  • 44 a
  • 44 b
  • 74 c
  • 44 d
  • 66 e
  • 57 f
  • 178 g
  • 26 h
  • 33 i
  • 9 j
  • 29 k
  • 1015 l
  • 61 m
  • 40 n
  • 44 o
  • 134 p
  • 8 q
  • 23 r
  • 65 s
  • 99 t
  • 45 u
  • 10 v
  • 17 w
  • 117 x
  • 1 y
  • 6 z

The First Rule of AV Club

May 17th, 2009

Some of my favorite stories were all written by the same person, Philip K. Dick. So I’m always on the lookout for more stories which remind me of those stories. If you’re similar, you may want to give a read to Walter Mosley’s Blue Light. It’s a story about a group of people around the San Francisco Bay Area who experience an uncanny blue light which changes them. They then work, together and apart, to change the world they live in. Or perhaps it’s the aftermath of a cult recorded by a delusional chronicler, an interpretation which would squint towards the inaccurate if not downright unreliable narrator.

I came to read this book not because it turned up in a search of stories like those PKD wrote but because when out walking near Berkeley one day at dusk, a pedestrian saw me and asked me if I read sf. When I acknowledged his intuition, he insisted that I seek out Walter Mosley’s science fiction stories.

People who might like this book

  • Fans of PKD
  • People who live, lived or want to live in Northern California
  • Fans of the early stages of a utopia

People who might not like this book

  • Those sensitive souls who think the past was a golden age where everyone was nice
  • Those who need complete closure to a story
  • Those who think the only interesting science fiction is the most currently written

Couldn’t Stop Searching

April 19th, 2009

I was fiddling around for something to do with a Yahoo API and so now the MUD chatbot returns (simple) websearch results. Isn’t that nice? I think it’s nice.

#!/usr/bin/perl

# mudbot by Shannon Prickett 
# connect a pandorabots.com chatbot with a particular TinyMUCK, Pegasus.

package mudbot;

use Smart::Comments;
use Modern::Perl;
use Net::Telnet;
use Net::AIML;
use DB_File;
use WWW::Mechanize;

use vars qw{$being_quiet %global_exit $mud_connection $mud_conversation $mud_host $mud_name
            $mud_pass $mud_port $mud_sent $pid $robot %room_name $yahoo_id};
use subs qw{setup sometimes speak};

$mud_host       = 'ginka.armageddon.org';
$mud_port       = '4242';
$mud_name       = 'Somebot';
$mud_pass       = 'YRMEME';
$being_quiet    = 0;
$pid            = $$;

tie %room_name, 'DB_File', 'mapfile' or
    die "can't tie to mapfile: $!\n";

$robot          = Net::AIML->new( botid => 'BOTIDGOESHERE' ); 

$mud_connection = new Net::Telnet( Host => $mud_host, Port => $mud_port )
                    or die "Can't connect to $mud_host $mud_port: $!";

$yahoo_id = 'LALALALA';
setup( $mud_connection );

TALKLOOP: while (1) {
    ### TALKLOOP start

    my $atme = 0;
    my $prematch = '';
    my $postmatch = '';
    my $who_said;

    my ($stub_said, $what_said) =
        $mud_connection->waitfor(   Match => '/ says, ".*"/',
                                    Errmode => 'return', );

    next TALKLOOP unless defined $what_said;

    $stub_said =~ qr{ START \d+ .+ \b(\w+)\b }msx;
    $who_said = $1;

    $what_said =~ s{says, \"(.*)\"}{$1}g;

    ### Got: $who_said
    ### Got: $what_said

    if ($what_said =~ qr{$mud_name}msxi){
        ### saw my name
        $atme = 1;
    }

    $what_said =~ s{$mud_name}{}g;

    if ( ($atme) && ($what_said =~ qr{QUIT}) ) {
        $mud_connection->print("QUIT");
        exit;
    }

    if ( ($atme) && ($what_said =~ qr{be quiet}) ) {
        if ($being_quiet) {
            $mud_connection->print("say Maximum verbosity achieved.");
            $being_quiet = 0;
        } else
        {
            $mud_connection->print("say Shutting up now.");
            $being_quiet = 1;
        }
    }

    if ( ($atme) && ($what_said =~ qr{search for ([\w\s]+)}) ) {
        ### requested to search
        my $terms = $1;
        ### got: $terms

        my @terms = split ' ', $terms;
        my $querystring = join '+', @terms;

        if (sometimes( )) {
            $mud_connection->print("say Found http://lmgtfy.com/?q=$querystring");
        } else
        {
            my $web_connect = WWW::Mechanize->new( autocheck => 1);
            $web_connect->get( "http://boss.yahooapis.com/ysearch/web/v1/$querystring?appid=$yahoo_id&format=xml");

            my $results = $web_connect->content();
            if (defined $results) {
                speak( 'Found some URLs:' );
            }
            my @lines = split /\n/, $results;
            for my $line ( @lines ) {
            ### got: $line
                if ($line =~ qr{(.+)}) {
                    my $output = $1;
                    speak( $output );
                }
            }
        }

        next TALKLOOP;
    }

    if ( ($atme) && ($what_said =~ qr{explore}) ) {
        $mud_connection->print("say OK, going to poke around now.");
        sleep 3;
        $mud_connection->print('home');
        goto EXPLORELOOP;
    }

    if ($being_quiet) {
        next TALKLOOP;
    }

    my $response = $robot->tell($what_said);
    if ($atme) {
        print "response: $response\n";
        speak( $response );
    }
    else {
        if ( !$being_quiet && (sometimes()) ) {
            print "jumping in with $response\n";
            speak( $response );
        }
    }
}

EXPLORELOOP: while (1) {
    ### exploring

    my ($name, $desc);

    $mud_connection->print('look');
    my $startmark   = $mud_connection->getline( );
    $name           = $mud_connection->getline( );
    while (my $line = $mud_connection->getline( Errmode => 'return', )) {
        $desc .= $line;
    }

    $mud_connection->waitfor( Match => '/END$pid/', Errmode => 'return');
    chomp $name;
    chomp $desc;

    ### got: $name
    ### got: $desc

    $room_name{$name} = $desc;

    sleep 10;

    $mud_connection->print('out');
}

sub setup {
    my $mc = shift;

    $mc->dump_log('/home/binder/src/mb/logfile');

    $mc->waitfor('/connect\s+guest\s+guest/');
    $mc->print("connect $mud_name $mud_pass");

    $mc->waitfor('/Vote to ban the MisInformation SuperHighway/');
    $mc->print('@desc me=Just a Perl toy of Binder\'s.');

    $mc->print("OUTPUTPREFIX START$pid");
    $mc->print("OUTPUTSUFFIX END$pid");

    $mc->waitfor('/Description set/');
    $mc->print("home\nout\nvillage");
}

sub sometimes {
    return (rand() > .75);
}

sub speak {
    my $response = shift;
    my @lines = split /\n/, $response;
    for my $line (@lines) {
        $mud_connection->print("say $line");
    }
}

The Bot Who Came In Out of the Cold

April 19th, 2009

I’ve now sunk a number of hours into it and added some functionality, none of which really works yet. But in the interest of keeping things going, here’s where things stand now. Explore doesn’t quite work, and there are still weird undef matches in the dialogue. But I pulled out all of Expect.pm and went to Smart::Comments.


#!/usr/bin/perl

# mudbot by Shannon Prickett
# connect a pandorabots.com chatbot with a particular TinyMUCK, Pegasus.

package mudbot;

use Smart::Comments;
use Modern::Perl;
use Net::Telnet;
use Net::AIML;
use DB_File;

use vars qw{$being_quiet %global_exit $mud_connection $mud_conversation $mud_host $mud_name
$mud_pass $mud_port $mud_sent $pid $robot %room_name };
use subs qw{setup};

$mud_host = 'ginka.armageddon.org';
$mud_port = '4242';
$mud_name = 'Somebot';
$mud_pass = 'YRMEME';
$being_quiet = 0;
$pid = $$;

tie %room_name, 'DB_File', 'mapfile' or
die "can't tie to mapfile: $!\n";

$robot = Net::AIML->new( botid => 'GETFROMPANDORABOTS' );

$mud_connection = new Net::Telnet( Host => $mud_host, Port => $mud_port )
or die "Can't connect to $mud_host $mud_port: $!";

setup( $mud_connection );

TALKLOOP: while (1) {
### TALKLOOP start

my $atme = 0;
my $prematch = '';
my $postmatch = '';
my $who_said;

my ($stub_said, $what_said) =
$mud_connection->waitfor( Match => '/ says, ".*"/',
Errmode => 'return', );

next TALKLOOP unless defined $what_said;

$stub_said =~ qr{ START \d+ .+ \b(\w+)\b }msx;
$who_said = $1;

$what_said =~ s{says, \"(.*)\"}{$1}g;

### Got: $who_said
### Got: $what_said

if ($what_said =~ qr{$mud_name}msxi){
### saw my name
$atme = 1;
}

$what_said =~ s{$mud_name}{}g;

if ( ($atme) && ($what_said =~ qr{QUIT}) ) {
$mud_connection->print("QUIT");
exit;
}

if ( ($atme) && ($what_said =~ qr{be quiet}) ) {
if ($being_quiet) {
$mud_connection->print("say Maximum verbosity achieved.");
$being_quiet = 0;
} else
{
$mud_connection->print("say Shutting up now.");
$being_quiet = 1;
}
}

if ( ($atme) && ($what_said =~ qr{search for '(.*)'}msxi) ) {
my $terms = $1;
my @terms = split $terms;
my $querystring = join '+', @terms;
$mud_connection->print("say Found http://lmgtfy.com/q=$querystring");
}

if ( ($atme) && ($what_said =~ qr{explore}) ) {
$mud_connection->print("say OK, going to poke around now.");
sleep 3;
$mud_connection->print('home');
goto EXPLORELOOP;
}

if ($being_quiet) {
next TALKLOOP;
}

my $response = $robot->tell($what_said);
if ($atme) {
print "response: $response\n";
speak( $response );
}
else {
if ( !$being_quiet && (rand() > .75) ) {
print "jumping in with $response\n";
speak( $response );
}
}
}

EXPLORELOOP: while (1) {
### exploring

my ($name, $desc);

$mud_connection->print('look');
my $startmark = $mud_connection->getline( );
$name = $mud_connection->getline( );
while (my $line = $mud_connection->getline( Errmode => 'return', )) {
$desc .= $line;
}

$mud_connection->waitfor( Match => '/END$pid/', Errmode => 'return');
chomp $name;
chomp $desc;

### got: $name
### got: $desc

$room_name{$name} = $desc;

sleep 10;

$mud_connection->print('out');
}

sub setup {
my $mc = shift;

$mc->dump_log('/home/binder/src/mb/logfile');

$mc->waitfor('/connect\s+guest\s+guest/');
$mc->print("connect $mud_name $mud_pass");

$mc->waitfor('/Vote to ban the MisInformation SuperHighway/');
$mc->print('@desc me=Just a Perl toy of Binder\'s.');

$mc->print("OUTPUTPREFIX START$pid");
$mc->print("OUTPUTSUFFIX END$pid");

$mc->waitfor('/Description set/');
$mc->print("home\nout\nvillage");
}

sub speak {
my $response = shift;
my @lines = split /\n/, $response;
for my $line (@lines) {
$mud_connection->print("say $line");
}
}

SEO what.

April 18th, 2009

I was feeling restless so I looked at what Google Webmaster Tools had to say about this blog. Mostly it thought my title tags weren’t interesting enough, which was true. So I took the tip from Perishable Press on making title tags without Yet Another Plugin.

Humans shouldn’t notice anything exciting but perhaps the Googlebot will be thrilled.

Another Sixty Minutes Down

April 17th, 2009

And the bot is now both more and less annoying. Updated code below.


#!/usr/bin/perl

# mudbot by Shannon Prickett 
# connect a pandorabots.com chatbot with a particular TinyMUCK, Pegasus.

package mudbot;
use Modern::Perl;
use Net::Telnet;
use Net::AIML;
use Expect;

use vars qw{$mud_connection $mud_conversation $mud_host $mud_name $mud_pass $mud_port $mud_sent $robot};

$mud_host = 'ginka.armageddon.org';
$mud_port = '4242';
$mud_name = 'Somebot';
$mud_pass = 'YRMEME';

$robot = Net::AIML->new( botid => 'GETTHISNUMBERFROMPANDORABOTS' ); 

$mud_connection = new Net::Telnet( Host => $mud_host, Port => $mud_port )
    or die "Can't connect to $mud_host $mud_port: $!";

$mud_conversation = Expect->exp_init($mud_connection);

$mud_conversation->log_group(1);
$mud_conversation->log_user(1);
$mud_conversation->log_stdout(1);
$mud_conversation->log_file("/home/binder/src/mb/logfile", 'w');

$mud_conversation->expect(30,   '-re', qr{connect       # pretty standard MUCK greeting
                                    \s+
                                    guest
                                    \s+
                                    guest}msx,
                                sub {
                                    my $fh = shift;
                                    $fh->send("connect $mud_name $mud_pass\n");
                                    });

$mud_conversation->expect(30, 'Vote to ban the MisInformation SuperHighway',
                            sub {
                                my $fh = shift;
                                $fh->send("\@desc me=Just a Perl toy of Binder's.\n");
                                });

$mud_conversation->expect(30, 'Description set',
                            sub {
                                my $fh = shift;
                                $fh->send("home\nout\nvillage\n");
                                });

TALKLOOP: while (1) {
    print "TALKLOOP start\n";

    my $being_quiet = 0;
    my $atme = 0;
    my $prematch = '';
    my $postmatch = '';

    my $index = $mud_conversation->expect( 60, '-re', qr{ says, "} );  

    $prematch = $mud_conversation->before();
    $postmatch = $mud_conversation->after();
    $mud_conversation->clear_accum();

    next TALKLOOP unless $prematch;

    $postmatch =~ s{\"}{};
    print "$prematch said $postmatch\n";

    if ($postmatch =~ qr{$mud_name}){
        print "saw my name\n";
        $postmatch =~ s{$mud_name}{Persephone}g;
        $atme = 1;
    }

    if ( ($atme) && ($postmatch =~ qr{QUIT}) ) {
        $mud_conversation->send("QUIT\n");
        exit;
    }

    if ( ($atme) && ($postmatch =~ qr{be quiet}) ) {
        if ($being_quiet) {
            $mud_conversation->send("say Maximum verbosity achieved.\n");
            $being_quiet = 0;
        } else
        {
            $mud_conversation->send("say Shutting up now.\n");
            $being_quiet = 1;
        }
    }

    if ($being_quiet) {
        next TALKLOOP;
    }

    if ($atme) {
        my $response = $robot->tell($postmatch);
        print "response: $response\n";
        $mud_conversation->send("say $response\n");
    }
    else {
        if ( !$being_quiet && (rand() > .75) ) {
            print "jumping in\n";
            my $response = $robot->tell($postmatch);
            print "response: $response\n";
            $mud_conversation->send("say $response\n");
        }
    }
}
continue {
    $mud_conversation->clear_accum();
}

The Sixty Minute MUDbot.

April 16th, 2009

I decided to scratch an itch and practice a little bit of the Manifesto of the Cult of Done tonight.  So I wrote a clunky and fragile Perl wrapper which ties a chatbot to a MUCK.  Here’s the code.

#!/usr/bin/perl

# mudbot by Shannon Prickett 
# connect a pandorabots.com chatbot with a particular TinyMUCK, Pegasus.

package mudbot;
use Modern::Perl;
use Net::Telnet;
use Net::AIML;
use Expect;

use vars qw{$mud_connection $mud_conversation $mud_host $mud_name $mud_pass $mud_port $mud_sent $robot};

$mud_host = 'ginka.armageddon.org';
$mud_port = '4242';
$mud_name = 'Somebot';
$mud_pass = 'YRMEME';

$robot = Net::AIML->new( botid => 'GETTHISNUMBERFROMPANDORABOTS' ); 

$mud_connection = new Net::Telnet( Host => $mud_host, Port => $mud_port )
    or die "Can't connect to $mud_host $mud_port: $!";

$mud_conversation = Expect->exp_init($mud_connection);

$mud_conversation->log_group(1);
$mud_conversation->log_user(1);
$mud_conversation->log_stdout(1);
$mud_conversation->log_file("/home/binder/src/mb/logfile", 'w');

$mud_conversation->expect(30,   '-re', qr{connect       # pretty standard MUCK greeting
                                    \s+
                                    guest
                                    \s+
                                    guest}msx,
                                sub {
                                    my $fh = shift;
                                    $fh->send("connect $mud_name $mud_pass\n");
                                    });

$mud_conversation->expect(30, 'Vote to ban the MisInformation SuperHighway',
                            sub {
                                my $fh = shift;
                                $fh->send("\@desc me=Just a Perl toy of Binder's.\n");
                                });

$mud_conversation->expect(30, 'Description set',
                            sub {
                                my $fh = shift;
                                $fh->send("home\nout\nvillage\n");
                                });

while (1) {
    my $command;
    $mud_conversation->expect(3,
                             '-re',
                             qr{ Somebot }msx,
                             sub {  my $fh = shift;
                                    $command = $mud_conversation->after();
                                    $command =~ tr{\,\"\.\!}{}d;
                                    print "matched: $command\n";
                                    if ($command =~ qr{QUIT}) {
                                        $fh->send("QUIT\n");
                                        exit;
                                    } else
                                    {
                                        if (length($command)>3) {
                                            my $response = $robot->tell($command);
                                            $fh->send("say $response\n");
                                        }
                                    }
                                }
                            );
}

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...