• Log in or sign up for an account here: https://www.sythe.org/login

Get Least Full World [Source]

Covey

Creator of EliteSwitch

Retired Sectional Moderator
Visual Basic Programmers
Joined
Sep 9, 2005
Sythe Gold
9
Messages
4,510
Age
17
Location
Fuckin' BAM!
This function will ONLY get the least full world (members or free) and tell you what world it is. It will NOT connect to that world or tell you how many players are in it. It includes simple error handling so it won't die if something has gone wrong.

Code:
Public Function GetLeastFull(sType As String) As Integer
    Dim mStr As String, sWorld() As String
    If Inet1.StillExecuting Then Exit Function
    If LCase(sType) = "free" Then mStr = Inet1.openurl("http://www.runescape.com/lang/en/aff/runescape/serverlist.ws?lores.x=1&plugin=0&order=MPWL") Else mStr = Inet1.openurl("http://www.runescape.com/lang/en/aff/runescape/serverlist.ws?lores.x=1&plugin=0&order=PWML")
    sWorld() = Split(mStr, " Type")
    sWorld() = Split(sWorld(1), "World ")
    sWorld() = Split(sWorld(1), "</a>")
    If Not IsNumeric(sWorld(0)) Then MsgBox "An error has occurred please contact the program designer", vbInformation, "Get Least Full World": Exit Function
    GetLeastFull = sWorld(0)
End Function

How to call the Least Full Members World:
Code:
GetLeastFull("members")

How to call the Least Full Members World:
Code:
GetLeastFull("free")

I was going to post my old looping function but i thought meh it was pretty simple to make so i won't be a code whore (for once :) ) and release it.

Enjoy
 
I get an error when it trys to find the least full world... Look like this:

Code:
If Inet1.StillExecuting
Can you help me?
 
nice ty mate.
 
you would usually connect straight to that world.

Example:
First you'll need your loadworld code. lets pretend you loadyour world buy doing calling the function LoadWorld(10), 10 being the world number you wish to load.

so to load the least full world you would do, loadworld(GetLeastFull("free"))
 
Runescape Gamblingrunescape gambling
Back
Top