Jump to content

Command in my IRC Bot (PHP)


Recommended Posts

case ':!status':if($ex[2] != $nick){$to = $ex[2];}else{$arr = explode('!', $ex[0]);$to = ltrim($arr[0],':');}		$portS   = 43594;		$ipS	 = dodian.com;		$sock = @fsockopen($ipS, $portS, $errno, $errstr, 5);  	if ($sock) { 		$status = online;	} elseif (!$sock) {		$status = offline;	}	fputs($socket, "PRIVMSG $to :Dodian is $status\n");break;

Is there a reason why this will always return offine even when its clearly online.Im fairly new to IRC Bots and i was wondering how can we do something like !msg (message) and bot will say it?

Link to post
Share on other sites

Hi, I'm guessing you're from the swiftirc network, correct? I was on there for quite a while, seems like every person who knew anything about programming had their own bot.Anyways, you need to have the text for $ipS in quotes so it is identified as a string, plus you don't have the irc sub domain so it won't connect to irc anyways. That is what I have noticed, so get $ipS fixed up and it should be good to go!

Link to post
Share on other sites

I'm not part of the SwiftIRC network although i was once. I'm not trying to connect to the IRC.. thats what this does.

$socket = fsockopen("irc.dodian.com", 6667) or die('Could not connect to the server');

I'm trying to print the status of a runescape private server.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...