Jump to content

konnwat

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by konnwat

  1. OSX is the best, then linux windows is bad, they deserve every virus they can get ^^  :P
  2. dreamweaver, PHP studio (it exectues scripts without apache) or Textedit :')
  3. got it, when you parse the $google thing it should have this [code]<img style="border: 1px solid ;" src="/images?q=tbn:zL2xxNRHzRtnJM:http://cdupload.com/files/download/451_5pjc3/lol.jpg" height="148" width="95">[/code] so if that bit is [color=blue]$imgcode[/color] (you parse it :P)you do [code] <?PHP $stuff = explode(":http://", $imgcode); $stuff = explode("\" height=", $stuff[1]); $imgsrc = "http://".$stuff[0]; ?> [/code] and your $imgsrc is the link to the fullsize image xD
  4. good thinking xD i shall try that and tell you what happens thank you!
  5. my localhost suddenly stopped working  :-\ i think i mucked up my httpd.conf file so i reinstalled entropy php for mac still dont work though :s any suggestions?
  6. oh right yes i see what you mean, hmmm i downloaded that from a site. instead of 0 you think it should be 1 or >0 am i right in thinking that :D ?
  7. dont think so ===  means exact equals (including type eg. boolean, string, integer etc.) !=    means doesn't equal :D
  8. not sure if its possible to do the part when you said "get original image size" unless theres a direct link to that on google. but that page html you could parse from will be like [code] <?PHP $google = file("http://images.google.co.uk/images?hl=en&q=".$_POST['search']); ?>[/code] and then [color=blue]$google[/color] will be the html code of the google image page. you could parse that to only show thumbnails.
  9. yeah it used to run on my localhost but 1. i needed it to run after i close my laptop :P 2. i made a php gd pic that get info from the bot that needs to be on also, all the time. and 3. my php is now broken :( dunno what i did but i go to tick personal web sharing and it take forever to load. i might post that in the other forum though :P i cant remember what it was like on my computer. also can i try copy and paste your code just to see if your bot stays on, then we will know its my script and not the server.
  10. WOW impressive :D so does your bot stay on forever? also i see yours is done in classes, would that make a difference?
  11. oh right missed that bit [code]//pong at pings if (strpos($line,"PING :")===0) { fwrite($socket, "PONG :irc.barafranca.com\r\n"); }[/code]
  12. okay its a bit long though, its about 550 lines :s and it uses a lot of includes to make it simple. [code]<?PHP //add sripos if (!function_exists("stripos")) {   function stripos($str,$needle) {   return strpos(strtolower($str),strtolower($needle));   } } //connect to IRC set_time_limit(0); //set vars $host = 'irc.barafranca.com'; $port = '6667'; $nickname = "bot"; $channel = file('../bot/channels.txt'); //open data.txt $savedline = file('../image/data.txt'); $savedline[3] = $savedline[2]; $savedline[2] = $savedline[1]; $savedline[1] = $savedline[0]; $killmode['#chan'] = 'on'; $ks = array(); //connect $socket = fsockopen($host, $port); stream_set_timeout($socket, 60*60*24*365); fwrite($socket, "NICK ".$nickname."\r\n"); fwrite($socket, "USER ".$nickname." 8 * :nick's Bot\r\n"); fwrite($socket, "MODE ".$nickname." +B\r\n"); while ($line=fgets($socket)) {   if (strpos($line, "433")>0) die();   if (strpos($line, "004")>0) {       $chancount = count($channel);       fwrite($socket, "PRIVMSG nickserv :IDENTIFY bot hello123\r\n");       for ($i = 0; $i < $chancount; $i++) {             fwrite($socket, "JOIN ".$channel[$i]."\r\n");       }       break;   } } //fuctions while ($line=fgets($socket)) { $chan = explode("PRIVMSG ", $line); $chan = explode(" :", $chan[1]); $chan = explode("#", $chan[0]); $chan = "#".$chan[1]; $nick = explode(":", $line); $nick = explode("!", $nick[1]); $nick = $nick[0]; $tempstuff = explode("\r\n", $line); if (stripos($line, ":@")>0) {   $tempstuff = explode(":@", $tempstuff[0]); } else {   $tempstuff = explode(":!", $tempstuff[0]); } $tempstuff = explode(" ", $tempstuff[1]); $two = $tempstuff[1]; $three = $tempstuff[2]; $four = $tempstuff[3]; ?>[/code] and then the scripts are like these [code]if (stripos($line, ":hello bot")>0) { fwrite($socket, "PRIVMSG $chan :hello $nick\r\n"); }[/code]
  13. yeah i thought it was that, no i got a ping script and i got and "echo $line" and i can see the pings and thats not what disconnects it.
  14. okay i have a PHP irc bot hosted on a server (not my localhost) and it keeps on leaving at times. theres no pattern, sometimes it leaves after 5 mins of starting, sometimes hours after. but i need it to stay on  >:( i thought it was there 3 things but i checked: PHP safe mode is on set_time_limit(0); is in the script and the timeout is at a year  :P there are no unknown characters anywhere what is wrong? someone please help me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.