Results 1 to 3 of 3

Thread: Choose a random world.

  1. #1
    Join Date
    Jul 2009
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Choose a random world.

    How Could I make a method that logs out, Chooses a random world, but not the one you were just in, and logs back in?

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ownedlikenoob View Post
    How Could I make a method that logs out, Chooses a random world, but not the one you were just in, and logs back in?
    Look in WorldSwitcher.scar in SRL. There are functions you can use.
    RandomWorld, SelectWorld, ChangeWorld

  3. #3
    Join Date
    Oct 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, ima do a rough draft just incase you need it

    First record what World you went to when you go to it.
    eg.
    Code:
    var Curr_World, Next_World: Integer;
    
    begin
      Curr_World := //Whatever way you chose to open a world
      ChangeWorld(Curr_World);
    end.
    Next, when you want to change worlds just make sure Current world is not the same as Nextworld.
    eg.
    Code:
    var Curr_World, Next_World: Integer;
    
    begin
      Curr_World := //Whatever way you chose to open a world
      Next_World := Curr_World; //As to not confuse the script later
      ChangeWorld(Curr_World);
      Repeat
      //Script
      while Curr_World = Next_World do
        Next_World := RandomWorld({Info on wanted worlds here});
      Curr_World := Next_World;
      ChangeWorld(Next_World);
      Until(false)
    end.
    I'm pretty sure that would work, but i'm no pro at SRL or runescape so don't quote me

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •