Results 1 to 9 of 9

Thread: WORLDINFO Function by Oldarney

  1. #1
    Join Date
    Oct 2007
    Location
    Atlantis with u'r girlfriend
    Posts
    251
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default WORLDINFO Function by Oldarney

    SCAR Code:
    function worldInfo(worldnum,askedmfdata:Integer):String;
    var
    winfo: array [0..7] of String; dataloader,rawimf,tempwfstr:String; iwf:Integer;
    begin
      dataloader:= GetPage('http://www.runescape.com/slj.ws?hires.x=36&hires.y=223&plugin=0')
      rawimf:= Between('e('+inttostr(worldnum)+',',');',dataloader);
      winfo[0]:=inttostr(worldnum);
      for iwf := 1 to 7 do
      begin
        tempwfstr:=rawimf;
        delete(tempwfstr, pos(',',rawimf), 255);
        winfo[iwf]:=tempwfstr;
        delete(rawimf, pos(',',rawimf)-Length(tempwfstr), 1+Length(tempwfstr));
      end;
      if(Length(winfo[1])=0) then
      begin
       //will return null if there is an error.
       winfo[askedmfdata]:= '"null"';
      end;
      Result:= winfo[askedmfdata];
    end;

    world number: 0, returns the current world number given.
    members bool: 1, returns 0 if its an F2P world and 1 if Members.
    status: 2, returns 0 if its online, 1 if its offline and 2 if its FULL.
    activity str: 3, returns the activity in that world. eg:worldInfo(17,3) returns '"Bounty Hunter"'.
    activity bol = 4, returns a 0 if no activity 1 if there is. activity str returns '-' if none.
    world prefix = 5, returns string with the prefix of a world eg: worldInfo(17,3) returns '"nav1"'
    population = 6, returns the current population, usefull when calculating respawn.
    world location = 7, returns a number representing the worlds location.

    if you need to fomat the world location here:
    SCAR Code:
    Function formatWorldLocation(fwlnum:Integer):String;
    begin
      case (inttostr(fwlnum)) of
              '0' : Result:= 'US West 1';
              '1' : Result:= 'US West 2';
              '2' : Result:= 'US West 3';
              '3' : Result:= 'UK 2';
              '4' : Result:= 'US West 5';
              '5' : Result:= 'UK 1';
              '6' : Result:= 'Canada East';
              '7' : Result:= 'US East 2';
              '8' : Result:= 'US Central 3';
              '9' : Result:= 'US Central 2';
              '10' : Result:= 'Netherlands 1';
              '11' : Result:= 'US Central 1';
              '12' : Result:= 'US West 4';
              '13' : Result:= 'US East 1';
              '14' : Result:= 'US East 3';
              '15' : Result:= 'Australia';
              '16' : Result:= 'Sweden';
              '17' : Result:= 'Canada West';
              '18' : Result:= 'Finland';
              '19' : Result:= 'Netherlands 2';
              '20' : Result:= 'US Central 2';
              '21' : Result:= 'United States 1';
              '22' : Result:= 'United States 2';
              '23' : Result:= 'United States 3';
              else    Result:= 'Unknown';
      end;
    end;

    eg: writeln(worldInfo(1,6)); // returns the population of the respective world.
    eg: writeln(worldInfo(1,2)); // returns the the status respective world.(online = 0, offline = 1, full = 2 )

    ill be back to add stuff later bye comment.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Just so you know, very few things suggested/coded by the public get added to SRL, but you never know.
    Also, doesn't work properly - tried with 52,0 and it gave me all the info (you need to remove the writeln in the for bit). Also, you need to make sure you do it via html code and not just 'what you can see' (instead of 1 giving me a boolean, I get an integer and same with a few others, though this may be because you have it setup wrong at the bottom of your post). A tip - using 'case askedmfdata of' would be more efficient in the running of it.
    Hope this doesn't sound too negative - it's a good idea, just not working 100%.
    Edit: Also remember to use scar tags when posting scar script (not code) as it makes it easier to check through etc.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Oct 2007
    Location
    Atlantis with u'r girlfriend
    Posts
    251
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    Just so you know, very few things suggested/coded by the public get added to SRL, but you never know.
    Also, doesn't work properly - tried with 52,0 and it gave me all the info (you need to remove the writeln in the for bit). Also, you need to make sure you do it via html code and not just 'what you can see' (instead of 1 giving me a boolean, I get an integer and same with a few others, though this may be because you have it setup wrong at the bottom of your post). A tip - using 'case askedmfdata of' would be more efficient in the running of it.
    Hope this doesn't sound too negative - it's a good idea, just not working 100%.
    Edit: Also remember to use scar tags when posting scar script (not code) as it makes it easier to check through etc.
    i did say i was in a rush... its all good now (sry about the left over writeln's). i added a script to format the world location and fixed the 50 char limitation witch 3 worlds where breaking... (things like "High level - duel tournaments" broke the limatation) thats about it.

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your standards aarrghhhh your inents are good but you have to use captialised letters :S that looks much nicer
    ~Hermen

  5. #5
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Herm, his standards are slightly off.


    Google DelFor for a standardizer app. ^_^

  6. #6
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    Herm, his standards are slightly off.


    Google DelFor for a standardizer app. ^_^
    Delfor isn't completely accurate by the way, especially when dealing with cases.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  7. #7
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    You told me that, I remember.
    Is there a better program available?

  8. #8
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    SourceFormatX owns all. For the unlimited demo version, http://astalavista.ms
    I made a new script, check it out!.

  9. #9
    Join Date
    Oct 2007
    Location
    Atlantis with u'r girlfriend
    Posts
    251
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    SourceFormatX owns all. For the unlimited demo version, http://astalavista.ms
    thanks i was asking ben for soemthing like this, if not i was going to undoubtably make it. maybe not in scar but in AS3 or maybe C++. no offense scar stinks at stings.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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