Results 1 to 9 of 9

Thread: how to get numbers?

  1. #1
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how to get numbers?

    hi hey i've seen a few script that have gettext comments, i want to add this also to a script.
    I want prices from the g.E Site
    how can i get text from a website on a specific location? and on the runescape ge site ( here http://services.runescape.com/m=itemdb_rs/frontpage.ws ) there's also the problem that it's not static, when you type in an item, an extra box comes
    does any of you know how i could do this? i thought about getting the numbers from other sites like runescape wiki etc.

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Here is one that a member called NexPB made:
    Simba Code:
    procedure GetPriceGe;
    var
      url, price, final: String;
    begin

      Case (Lowercase(Ore)) of
        'iron', 'iron ore': oreID := 440;
      end;

      url := ('http://www.master-bot.org/files/GEPrice.php?id=' + IntToStr(oreID));
      price := GetPage(url);

      if (orePrice = 0) then
      begin
        final := Trim(price);
        if (final = '') then writeln('FAILED TO GET PRICES! RESTART SCRIPT.');
        writeln('Price ore: ' + final);
        orePrice := StrToInt(final);
      end else
        Exit;

    end;

    I've been given full rights to update his script but have chosen not to, so you can edit that function appropriately.

    Just give credit to NexPB

  3. #3
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so for example the price for nature runes would be

    procedure GetPriceGe;
    var
    url, price, final: String;
    begin

    Case (Lowercase(Ore)) of
    'Nature', 'Nature rune': oreID := 561;
    end;

    url := ('http://www.master-bot.org/files/GEPrice.php?id=' + IntToStr(oreID));
    price := GetPage(url);

    if (orePrice = 0) then
    begin
    final := Trim(price);
    if (final = '') then writeln('FAILED TO GET PRICES! RESTART SCRIPT.');
    writeln('Price ore: ' + final);
    orePrice := StrToInt(final);
    end else
    Exit;

    end;
    and the variable final is the number at the end?

    sorry i am new to pascal and want to try out editing existing scripts to get more knowledge^^

  4. #4
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by joj0r View Post
    so for example the price for nature runes would be


    and the variable final is the number at the end?

    sorry i am new to pascal and want to try out editing existing scripts to get more knowledge^^
    Final is the price in String (text) format like '160'. orePrice is the price in Integer (number) format like 160.

    You can't do number operations to numbers in text format.

    if '160' < '200' then //NOT ALLOWED

    if '160' < 200 then //NOT ALLOWED

    if 160 < 200 then //ALLOWED

    '150' + '50' would be '15050'
    but
    150+50 would be 200.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  5. #5
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay i have addet the function and edited it, now it's compiling =)
    but it's count the prices as 0 since the link is not working
    www.master-bot.org/files/GEPrice.php?id=561 - page not found
    does anyone know a working site?

    when i use this link for esample from the rs site

    http://services.runescape.com/m=item...tem.ws?obj=440

    how can get the "current guide price" into my script?


    thanks alot guys =)
    Last edited by joj0r; 05-11-2012 at 05:11 PM.

  6. #6
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    When you open that url via the function. Use a GetText function to grab the price:
    http://docs.villavu.com/simba/script...l#reading-text

  7. #7
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    When you open that url via the function. Use a GetText function to grab the price:
    http://docs.villavu.com/simba/script...l#reading-text
    woot it seems a bit difficult to me since i am really new to pascal^^
    is there any other way? sites where the prices are already in a .txt data and simba can easily read them?
    but thanks so much for helping

  8. #8
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    You can just include Online.simba then use GetGEPrice(ID); to get the price

  9. #9
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    and how should i fix this? just a normal procedure?

    procedure GetPrice;
    begin
    GetGEPrice(NUMBER);
    end;

    where should i put that Online.Simba? thanks =]

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
  •