[tut]PHP Tutorial Series
6d23 and dss community is not in charge of what u make with this information. we ask discretion.
Introduction
"Dedications: iLLepidus, Blam, and my brother."
Instructions
Install php (
http://www.php.org) and when installing in extensions check Sockets.
Tutorial:
<?PHP
$servername="dss"; //servername
$nickname= "deskoftstudios"; //nickname
$password= "blabla"; //pass
$ownerpass= "wow?"; //the pass u want to use when using /owner <ownerpass>
$md5 = md5($password); //for converting to pass.
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); //we create new socket.
//syntax:
//socket_create(Net, declare socket, type of connection (TCP or UDP));
$result = socket_connect($socket, "66.230.224.102", 22001); //connect to it.
socket_write($socket, "join $servername\n"); //socket_write(socket, text);
//we join a server
while ($out = socket_read($socket, 2048)) $data .= $out; //while we can read it, $data is all info.
socket_close($socket); //we close socket1.
preg_match("/FORWARD 0;(\S+):(\S+)/", $data, $result); //we forward it.
$cmdsocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); //another socket
$result = socket_connect($cmdsocket, $result[1], $result[2]); //result.
//set this:
$version= "0.0.1"; //version
socket_write($cmdsocket,"NICK $nickname\nmlogin $nickname $md5\nPING\n"); //log in.
socket_write($cmdsocket,"owner " . $ownerpass . "\nsetowner " . $ownerpass . "\n"); //owner pass.
sleep(5); //wait 5 seconds
socket_write($cmdsocket,"fspec " . $nickname . "\n"); //spec bot.
socket_write($cmdsocket,"SAY ^05 Deskoft Studios Bot v." . $version . "\n"); //say bot info.
sleep(5); //wait 5 secs
socket_write($cmdsocket, "set desc " . $serverdesc . "\n"); //set desc
//Sends the script into an infinite loop
while ($out=socket_read($cmdsocket, 2048)){//loop
socket_write($cmdsocket,"PING\n"); //we must say this so bot dont disconnect
sleep(2); //wait 2 seconds
} //continue loop.
socket_close($cmdsocket); //close it.
?>
so u just save this as bottest.php and 2ble click.
be happy
![Biggrin](https://cache.toribash.com/forum/images/smileys2/biggrin.gif)
we continue with more.
plz dont ban me 4 sumthing xDD
if u need help join my irc here:
http://www.dss.freeiz.com/irc.htm
and type /join #programming
not toribash IRC, private.