Jump to content

Roy

Banned
  • Posts

    2,853
  • Joined

  • Last visited

  • Days Won

    383

Posts posted by Roy

  1. That does sound like a cool idea :)

     

    I'll talk to @denros about this.

     

    P.S. I slightly optimized/modified the script (not using as many loops, etc):

    <html>
    	<head>
    		<title>Overwatch Leaderboard</title>
    	</head>
    	<body>
    		<h1>Overwatch Leaderboard</h1>
    		<ul>
    		<?php
    			$users = Array
    			(
    				'Shuruia' => Array
    				(
    					'tag' => 'Shuruia-2405',
    					'region' => 'eu'
    				),				
    				
    				'PaxPlay' => Array
    				(
    					'tag' => 'PaxPlay-2484',
    					'region' => 'eu'
    				),				
    				
    				'Dano' => Array
    				(
    					'tag' => 'Dano-21397',
    					'region' => 'eu'
    				),				
    				
    				'Walkure' => Array
    				(
    					'tag' => 'Walkure-2268',
    					'region' => 'eu'
    				),				
    				
    				'Eli' => Array
    				(
    					'tag' => 'Eli-12576',
    					'region' => 'us'
    				),				
    				
    				'Carrick' => Array
    				(
    					'tag' => 'Carrick-1247',
    					'region' => 'us'
    				)
    			);
    			
    			$lootboxurls = array();
    			$contents = array();
    			$usernames = array();
    			$level = array();
    			$rank = array();
    			
    			echo 'Number of Battletags: ' , count($users);
    			
    			
    			foreach ($users as $k => $v)
    			{
    				$lootboxurls[$k] = 'https://api.lootbox.eu/pc/' . $v['region'] . '/' . $v['tag'] . '/profile';		//creating url out of battletag
    				$contents[$k] = file_get_contents($lootboxurls[$k]);		//get data
    				$usernames[$k] = substr($contents[$k], strpos($contents[$k], 'username') + 11, strpos($contents[$k], 'level') - strpos($contents[$k], 'username') - 14);		//find username, create substring
    				$level[$k] = substr($contents[$k], strpos($contents[$k], 'level') + 7, strpos($contents[$k], 'games') - strpos($contents[$k], 'level') - 9);		//find level, create substring
    				$rank[$k] = substr($contents[$k], strpos($contents[$k], 'rank') + 7, strpos($contents[$k], 'rank_img') - strpos($contents[$k], 'rank') - 10);		//find rank, create substring
    
    				echo '<li>';
    					echo 'Battletag: ', str_replace('-','#', $v['tag']), '; ';
    					echo 'Username: ', $usernames[$k], '; ';
    					echo 'Level: ', $level[$k], '; ';
    					echo 'Rank: ', $rank[$k];
    				echo '</li>';
    			}
    
    		?>
    		</ul>
    		<h3>Sorted by Skillrating:</h3>
    		<ol>
    		<?php
    			$hindex = array();
    			$hnumber = array();
    			foreach ($users as $k => $v)
    			{
    				$hnumber[$k] = 0;
    				
    				foreach ($users as $k2 => $v2)
    				{
    					if($k != 0) 
    					{
    						if($rank[$k2] > $hnumber[$k] && $rank[$k2] < $hnumber[$k-1])
    						{
    							$hindex[$k] = $k2;
    							$hnumber[$k] = $rank[$k2];
    						}
    					} 
    					else 
    					{
    						if($rank[$k2] > $hnumber[$k]) 
    						{
    							$hindex[$k] = $k2;
    							$hnumber[$k] = $rank[$k2];
    						}
    					}
    				}
    				
    				echo '<li>', $rank[$hindex[$k]], '; Username: ', $usernames[$hindex[$k]], '</li>';
    			}
    		?>
    		</ol>
    	</body>
    </html>

    Tested with a couple users and working fine, but I need to find out why the FcgidIOTimeout Directive isn't being changed on my personal server (leading to the script timing out).

     

    Thanks.

  2. 42 minutes ago, RTiopl said:

    Can i be an admin for this server and plus the member kits and what nut gives me an error when i try loading it and i am a member

    The Rust server has been shut down due to the server using too many resources while idle and lack of management. When we move to OVH, we are most likely going to give Rust another try!

     

    Thanks.

×
×
  • Create New...