
Any questions, just post them here.
<?php
$nick = "TestBot"; // What do you want the nick for the IRC Bot to be?
$server = "irc.rizon.net"; // What server do you want the IRC Bot to join?
$port = "6667"; // What port do you want the IRC Bot to connect to the server on?
$channel = "#tviyh"; // What channel do you want the IRC Bot to join?
$nickpass = "password"; // What is the bot's nickserv pass?
$s = fsockopen( $server , $port ); // Open a connection to the server
fputs( $s, "USER $nick $nick $nick $nick :$nick\n" ); // Send your user to the server, etc
fputs( $s, "NICK $nick\n" ); // Set your desired nick
while ( $data = fgets( $socket ) ) { // While the connection is open
flush(); // Flush the write buffers
$info = split( " ", $data ); // Split the raw message into an array separated by spaces
if ( $info[1] == "001" ) { // If the server sends us the Welcome message
fputs( $s, "PRIVMSG NickServ :identify $nickpass\n" ); // Send our nickserv pass
sleep(.75); // Wait 3/4 second
} elseif ( strstr( $data, "Password accepted" ) or strstr( $data, "You are already identified" ) or strstr( $data, "Your nick isn't registered" )) { // If NickServ recognized us as a user
fputs( $s, "JOIN $channel\n" ); // Join the desired channel
sleep(.75); // Wait 3/4 second
}
}
?>
Copyright © 2026, NextGenUpdate.
All Rights Reserved.