1 ================================================================================
3 Creating a Greeting Bot
5 In our second lesson, we'll create an IRC bot that greets and interacts
8 Copy the code for autogreet.pl to your home folder:
10 $ cp autogreet.pl ~/autogreet.pl
12 Next, open up autogreet.pl using a text editor and make a few changes.
13 (We recommend vim because it provides syntax highlighting)
15 1. Edit the server in line 89. Replace irc.example.com with the server's
16 real address. NOTE: Only IPv4 is supported.
17 2. Edit line 92 to replace nickname with the nickname you want for the bot.
18 WARNING: The nickname must not already be taken, or else the bot will
20 3. Edit line 93 to replace username with the username you want for the bot.
21 The username is what appears in a /whois on IRC; it can be different
24 Next, you'll want to make the perl script executable:
26 $ chmod u+x ~/autogreet.pl
32 On IRC, /join #perl102
34 Whenever a user joins or parts the channel, the bot will send a message.
35 Try sending a /me action and a notice in the channel tos ee the bot respond.
36 Lastly, try changing your nick or changing the topic in the channel.
39 ================================================================================
41 Understanding AutoGreet
43 Next, take a look at the file called ~/comments to see an explanation of
44 key lines in the program.
46 ================================================================================