$admin = 'MyNick'; $channel = '#MyRoom'; $servername = 'irc.anywhere.tld'; # The init function is the entry point of the script. # It is called when the botscript has been parsed # without exception into a runnable block. # Here you set up the bot as you would do in the # constructor of a PircBot. It should contain a # call to connectServer(server [, port[, password]]) # or a call to a function which contains a call to # that function. bot init { setName('HelloBot'); setAutoNickChange(1); connectServer($servername); } bot onConnect { joinChannel($channel); } bot onJoin { local('$nick'); $nick = getNick(); if ( "$2" ne "$nick" ) { sendMessage($1, 'Hello ' . $2 ); } } bot onUserList { local('@users $user'); @users = $2; foreach $user (@users) { if ( userGetNick( $user ) ne getNick() ) { sendMessage($1, 'Hello ' . userGetNick( $user ) ); } } } bot onPrivateMessage { if ( ($1 eq $admin) && ($4 eq '!shutdown') ) { partChannel($channel, 'bye @all' ); [System exit: 0]; } }