I'm trying to code one myself, but for some reason I can't seem to get the /msg command to work well...
<?php
$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
$connection = socket_connect($socket,'irc.rizon.net',6667);
socket_write($socket,"USER RHAP RHAP RHAP :RHAP\r\n");
socket_write($socket,"NICK Oni \r\n");
socket_write($socket,"JOIN #wannabefansubs \r\n");
while($new = socket_read($socket,2046))
{
$data = "$data" . "$new";
if (strpos($data, 'got') == true) {
socket_write($socket,"/MSG Ilich list \r\n");
str_replace("got", "trigger", $data);
}
print $data;
flush();
ob_flush();
}
?>
Is what I have so far.
So I PM the bot, with the phrase 'got' and it tries to message me back 'list'.
However, the IRC doesn't like the way the command is sent...
'Oni /MSG :Unknown command'
Is the reply.
I also try:
socket_write($socket,"MSG Ilich list \r\n");
What can be the problem? 🙁