View Single Post
  #30  
Old 08-25-2005, 11:08 AM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Ah yeah, if you don't want to have the characters name in the ouput, and just the number of connected players, you should use my simple script:

Code:
<?php

$Server = 'Host.com';
$Port = 9000;
$user = "your_user\r"; 
$pass = "your_pass\r"; 

$fp = fsockopen($Server, $Port);
		
       		fputs ($fp, $user);
		//echo("Login Accepted\r\n");
		usleep(125000);   
      		fputs ($fp, $pass);
		usleep(125000);
		//echo("Password Accepted\r\n");
       		fputs ($fp, "who\r"); 
		usleep(125000);
		//echo("Who launched\r\n");

			
       			while (!feof($fp))
			{
       			$ret = fgets($fp, 128);
       				if  (ereg("players", $ret)){
				$ret = ereg_replace("players online","",$ret);
           				echo "$ret \n";
					break;
                                        fclose($fp);
       				}
				
			}
?>
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots

Last edited by Magoth78; 08-25-2005 at 07:12 PM..
Reply With Quote