Jump to content

Command in my IRC Bot (PHP)


rswildy
 Share

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 comment
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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...