Adblock breaks this site

Get Least Full World [Source]

Discussion in 'Archives' started by Covey, Jan 28, 2007.

  1. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Get Least Full World [Source]

    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
     
  2. ViruZ3

    ViruZ3 Member

    Joined:
    May 21, 2007
    Posts:
    55
    Referrals:
    0
    Sythe Gold:
    0
    Get Least Full World [Source]

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

    Code:
    If Inet1.StillExecuting
    
    Can you help me?
     
  3. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Get Least Full World [Source]

    is your inet called inet1..
     
  4. Aussie King

    Aussie King Apprentice
    Banned

    Joined:
    Jan 25, 2007
    Posts:
    667
    Referrals:
    1
    Sythe Gold:
    0
    Get Least Full World [Source]

    nice ty mate.
     
  5. roflm40

    roflm40 Member
    Banned

    Joined:
    May 22, 2007
    Posts:
    97
    Referrals:
    0
    Sythe Gold:
    0
    Get Least Full World [Source]

    Nice, ty for sharing.
     
  6. ViruZ3

    ViruZ3 Member

    Joined:
    May 21, 2007
    Posts:
    55
    Referrals:
    0
    Sythe Gold:
    0
    Get Least Full World [Source]

    Ok i got it but where do i put it so it says the least full world? In a textbox? Label? :confused:
     
  7. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Get Least Full World [Source]

    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"))
     
< need pcer!!! | In Need of Runecrafting Trainer (I supply) >


 
 
Adblock breaks this site