Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP RuneScape world function, not sure if it belongs here.

Featured Replies

function getRuneScapeWorld($membersOrFree, $emptiestOrFullest)



{



/*



** @author Clooth 



** @params $membersOrFree string, $emptiestOrFullest string.



*/







switch ($emptiestOrFullest)



       {



	case 'emptiest': $prfx = ($membersOrFree == "members") ? "mPWL" : "MPWL";	break;







	case 'fullest': $prfx = ($membersOrFree == "members") ? "mpWL" : "MpWL";	break;







}







$page = curl_init('http://www.runescape.com/lang/en/aff/runescape/serverlist.ws?order='.$prfx);



curl_setopt($page, CURLOPT_RETURNTRANSFER, true);







$output = curl_exec($page);



$output = explode('', $output);



$output = explode('', $output[1]);



$output = strip_tags($output[0]);



$output = explode(' ', $output);







return $output[0].' '.$output[1];







}

 

 

 

 

 

 

 

Usage:

 

 

 

 

 

 

 

<?PHP



echo getRuneScapeWorld('members', 'emptiest'); // Returns the emptiest -members- world.



echo getRuneScapeWorld('free', 'fullest'); // Returns the fullest -free- world, not counting in full worlds.



?>

 

 

 

 

 

 

 

Output:

 

 

 

 

 

 

 

World 85

 

 

 

 

 

 

 

If you wish the output to be only a number, change this line in the function:

 

 

 

 

 

 

 

return $output[0].' '.$output[1];

 

 

 

 

 

 

 

into

 

 

 

 

 

 

 

return $output[1];

 

 

 

 

 

 

 

<3:

 

 

 

 

 

 

 

Edit1. Fixed a typo and changed a variable name. :-w

Best regards,

Nico

This is good for people who want to make Online world switchers. Why cant Jagex let us access worlds through the URL directly :|

Why cant Jagex let us access worlds through the URL directly :|

 

 

 

 

 

 

 

You can. Turn javascript off, open the world url with your browser, turn it back on, login to the "full" world when a slot opens up.

 

 

 

 

 

 

 

As for the script:

 

 

 

 

 

 

 

You typo'ed one of your function calls.

 

 

 

You don't use the $type variable anywhere in it.

 

 

 

You didn't document what $gof is or where it came from.

  • Author

Oops :shock: . :oops:

Best regards,

Nico

And I typo'ed my reply. :wall: The variable "$membersOfFree" is what I noticed, not a function call. :uhh:

  • Author

Yeah I noticed that when I was making the script, dunno why I didn't fix it then. Lol. Should be alright now. :)

Best regards,

Nico

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.