rswildy Posted November 4, 2007 Report Share Posted November 4, 2007 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 More sharing options...
reportingsjr Posted November 4, 2007 Report Share Posted November 4, 2007 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 More sharing options...
rswildy Posted November 4, 2007 Author Report Share Posted November 4, 2007 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 More sharing options...
reportingsjr Posted November 4, 2007 Report Share Posted November 4, 2007 I see no fgets() or fread(), also $status is not set anywhere in that script, Maybe that could be the issue? Link to comment Share on other sites More sharing options...
rswildy Posted November 4, 2007 Author Report Share Posted November 4, 2007 its working now, so how can i make a command go !msg (message) then it will say it. Link to comment Share on other sites More sharing options...
reportingsjr Posted November 4, 2007 Report Share Posted November 4, 2007 Tokenize the string, check for !msg, then do array_shift($tokens); and implode the rest for what to say. Link to comment Share on other sites More sharing options...
rswildy Posted November 4, 2007 Author Report Share Posted November 4, 2007 Hm, It wont jus let me use /me, How do i add colours/the /me command to: fputs($socket, "PRIVMSG $to :Dodian is $status\n"); Link to comment Share on other sites More sharing options...
reportingsjr Posted November 4, 2007 Report Share Posted November 4, 2007 Erm, thats a client side command. Try reading the RFC first. That always helps a bit considering it has all of the commands -.-. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now