Results 1 to 4 of 4

Thread: [OSR] AeroLib GrandExchange

  1. #1
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default [OSR] AeroLib GrandExchange

    Here some Grand Exchange functions, compatible with AeroLib.

    mainly posting them here so @Flight; may add this in the official include.

    few examples how to use it.

    Simba Code:
    {GrandExchange is declared as TGrandExchange in the include}
       GrandExchange.close(); {will close the GrandExchange screen}
       GrandExchange.buyOffer('Wizard boots', 500000, 1);   {will buy 1 wizard boots for 500k}
       GrandExchange.isSlotFree(5);  {will return if slot 5 is free}

    Constants:
    Simba Code:
    {offer types}
      BUY_SLOT = 0;
      SELL_SLOT = 1;
      EMPTY_SLOT = 2;
     
      {offer states}
      STATE_COMPLETED = 0;
      STATE_ABORTED = 1;
      STATE_PENDING = 2;
      STATE_BUSY = 3;
      STATE_FREE = 4;
     
      {screen types}
      BUY_SCREEN = 0;
      SELL_SCREEN = 1;
      STATUS_SCREEN = 2;
      ALL_SCREEN = 3; {buy/sell/status}

    complete function list GrandExchange

    TGrandExchange.isOpen(): Boolean;
    TGrandExchange.close(): Boolean;
    TGrandExchange.getInterfaceBounds(): TBox;
    TGrandExchange.getSlotsBounds(): TBoxArray;
    TGrandExchange.getSlotBounds(slot: Integer): TBox;
    TGrandExchange.getBuyButton(slot: Integer): TBox;
    TGrandExchange.screenOpen(typeScreen: Integer): Boolean;
    TGrandExchange.exitStatusScreen(): Boolean;
    TGrandExchange.getOfferTypes(): TIntegerArray;
    TGrandExchange.getOfferTypeSlot(slot: Integer): Integer;
    TGrandExchange.getBuySlots(): TIntegerArray;
    TGrandExchange.getEmptySlots(): TIntegerArray;
    TGrandExchange.getSlotState(slot: Integer): Integer;
    TGrandExchange.isSlotAborted(slot: Integer): Boolean;
    TGrandExchange.isSlotCompleted(slot: Integer): Boolean;
    TGrandExchange.isSlotPending(slot: Integer): Boolean;
    TGrandExchange.isSlotBusy(slot: Integer): Boolean;
    TGrandExchange.isSlotFree(slot: Integer): Boolean;
    TGrandExchange.isSlotUnlocked(slot: Integer): Boolean;
    TGrandExchange.abortOffer(slot: Integer): Boolean;
    TGrandExchange.collectAll(): Boolean;
    TGrandExchange.collectSlot(slot: Integer): Boolean;
    TGrandExchange.buyOffer(itemName: String; price, quantity: Integer): Boolean;
    TGrandExchange.sellOffer(invSlot, price, quantity: Integer): Boolean;


    of course there is also some offer information.

    example:
    Simba Code:
    {GE_SLOT_1, GE_SLOT_2 ... GE_SLOT_6 are already declared in the include but NOT initialised
    have to talk to flight if he can add it.}

    var
      GE_SLOT_1: TOffer;
    if (GE_SLOT_1.init(1)) then {make sure you initialise your var the first time!}
      writeln(GE_SLOT_1.getOfferType());

    complete function list offerInfo

    TOffer.init(slot: Integer): Boolean;
    TOffer.getOfferType(): Integer;
    TOffer.getItemName(): String;
    TOffer.getPrice(): Integer;
    TOffer.getAmount(): Integer;
    TOffer.getCurrentAmount(): Integer;
    TOffer.getProgessPercent(): Integer;


    NOTES:
    - GrandExchange.buyOffer is CASE SENSITIVE!
    - GE_SLOT_1 until GE_SLOT_6 are declared but NOT initialsed.
    - TGrandExchange is a type TInterface, so you'll have to add it yourself (for now)

    instructions to add TGrandExchange to TInterface:
    1. find: C:/simba/includes/aerolib/core/interfaces.simba
    2. change line 16 to this: Interfaces:
    Simba Code:
    Array [0..10] of TInterface;
    3. add GE_SCREEN = 10 to the constants, it should look like this:
    Simba Code:
    const
      BANKSCREEN      = 0;
      PINSCREEN       = 1;
      PINPENDING      = 2;
      DEPOSITSCREEN   = 3;
      SHOPSCREEN      = 4;
      TRADESCREEN     = 5;
      TRADECSCREEN    = 6;
      DUELSCREEN      = 7;
      DUELCSCREEN     = 8;
      TELEOTHERSCREEN = 9;
      GE_SCREEN       = 10;
    4. finally, replace the setupInterfaces(); procedure with this:
    setupInterfaces

    Simba Code:
    procedure setupInterfaces();
    begin
      with Interfaces[BANKSCREEN] do
      begin
        FontType  := 'SmallChars07';
        FontColor := 2070783;
        ColorTol  := 5;
        Text      := 'Insert';
        TxtBounds := toBox(125, 304, 170, 327);
      end;
      with Interfaces[PINSCREEN] do
      begin
        FontType  := 'UpChars07';
        FontColor := 2070783;
        ColorTol  := 5;
        Text      := 'Please';
        TxtBounds := toBox(105, 62, 150, 75);
      end;
      with Interfaces[PINPENDING] do
      begin
        FontType  := 'CharsNPC07';
        FontColor := 65535;
        ColorTol  := 10;
        Text      := 'asked';
        TxtBounds := toBox(114, 135, 204, 158);
      end;
      with Interfaces[DEPOSITSCREEN] do
      begin
        FontType  := 'UpChars07';
        FontColor := 2070783;
        ColorTol  := 5;
        Text      := 'Box';
        TxtBounds := toBox(356, 47, 383, 60);
      end;
      with Interfaces[SHOPSCREEN] do
      begin
        FontType  := 'SmallChars07';
        FontColor := 2070783;
        ColorTol  := 5;
        Text      := 'shop';
        TxtBounds := toBox(145, 295, 175, 314);
      end;
      with Interfaces[GE_SCREEN] do
      begin
        FontType  := 'UpChars07';
        FontColor := 2070783;
        ColorTol  := 5;
        Text      := 'Grand';
        TxtBounds := toBox(207, 31, 311, 45);
      end;
    end;

    you are free to save this somewhere in your includes folder and load this file yourself.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2013
    Location
    Argentina
    Posts
    758
    Mentioned
    27 Post(s)
    Quoted
    365 Post(s)

    Default

    great job! i was thinking of doing this for some of my scripts, was getting tired of buying stuff by hand.
    Formerly known as Undorak7

  3. #3
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    This looks great, actually i might try making a flipper with cheap items just for testing. Thanks a lot!
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  4. #4
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by Lipcot View Post
    great job! i was thinking of doing this for some of my scripts, was getting tired of buying stuff by hand.
    Quote Originally Posted by begginer View Post
    This looks great, actually i might try making a flipper with cheap items just for testing. Thanks a lot!
    thanks to both of you!

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
  •