Results 1 to 9 of 9

Thread: Danlib - Resizable OSRS Include

  1. #1
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default Danlib - Resizable OSRS Include

    Hi all,

    Thought I would drop my resizable OSRS include here for those that are wanting something to use outside of fixed mode.

    A lot of the code came from Aerolib and SRL/OSR (because why reinvent the wheel), so hats off to Flight, Olly and Slacky for that.

    The include is pretty straight forward. In order to initiate it, declare it at the top of the script with:
    Simba Code:
    {$i Danlib/Danlib.Simba}

    It doesn't require any initiation functions in order to run.

    Since it works in resizable, it doesn't have static locations declared like AL and SRL/OSR does. A lot of the locations are calculated using the client dimensions.

    A few example functions:
    Simba Code:
    function GetMSDimensions: TBox;                 // Outputs a tbox for the bounds of the client
    function GetMMBox:TBox;                         // Outputs a tbox for the bounds of the minimap
    function GetChatBox: TBox;                      // Outputs a tbox for the bounds of the chatbox
    function GetMenuBox(MPanel:string): TBox;       // Outputs the tbox for the inventory tab
    function GetInventoryDimensions: Tbox;          // Outputs the tbox for the inventory
    function GetOrbAmount(OrbType: string): integer;// Outputs the amount of hp we have left
    function GetBankScreenBox(var BankBox:TBox; TabbedBanking:boolean):boolean; // Gets the BankScreenBox if it is visible and stores it into the tbox var. Checks if using tabs or not.
    When the box locations are searched for the first time, it will store the locations into a global var, allowing for faster finding in future calls.

    An example of how these can be used:
    Simba Code:
    program new;
    {$i Danlib/Danlib.Simba}

    var
      Col:TColEx;
      TPA:TPointArray;
    begin
      Col.create(0, 0);
      if Col.findAllIn(GetMSDimensions, TPA) then
        DebugTPA(TPA, '');
    end.

    Include also supports discord notifications.
    Open chat.simba in Danlib\Chat and add your hook URL to line 2.
    You can make your own function, or use the functions in Discord.simba in Danlib\Utility
    Simba Code:
    program new;
    {$i Danlib/Danlib.Simba}
    var
      XpGained:integer;

    begin
      ScriptName := 'TestExample';
      SendDiscordWebhook(FormatDiscordMsg(XpGained, 'Terminated for whatever reason'));
    end.
    Would output:
    Code:
    [13:25:43]
    
    __
    Script Name: TestExample
    Player Name: 
    Start Time: 01:25:43 PM
     Stop Time: 01:25:43 PM
    Duration: 0 Seconds
    XP Gained: 0
    Terminate Reason: Terminated for whatever reason
    __
    If there is enough interest in this, I will write a few tutorials and add more explanations around each function.

    Let me know if you have any questions.

    Github link: https://github.com/ImTheNewGuy/Danlib

  2. #2
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Nice +Rep. I will probably try to include this in my scripts at some point. Idk if Jamflex looks for it in their bot searching. But will definitely help. Ill keep this bookmarked. I personally don't play on fixed myself.

    The End Awaits. . .

  3. #3
    Join Date
    Apr 2019
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    rarararep! nice work m8

  4. #4
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Thanks for sharing.

  5. #5
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

  6. #6
    Join Date
    Jul 2018
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Sweet, thanks!

  7. #7
    Join Date
    Apr 2019
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Error: Access violation please help?

  8. #8
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Jenslilleman View Post
    Error: Access violation please help?
    Need more details. When are you getting this error?

  9. #9
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    hey Dan, thank you for sharing! havent tried much but it looks promising

    Some changes needed to make it compatible with newer Simba versions & get it running. Let me know if you'd like me to make a pull request with what I did.

    Quote Originally Posted by Jenslilleman View Post
    Error: Access violation please help?
    There is other stuff you will need to fix, but to get you started:
    open Danlib/Danlib.simba replace
    {$loadlib libsimpleocr}
    with
    {$IFDEF SIMBAMAJOR1200}
    {$loadlib SimpleOCR}
    {$ELSE}
    {$loadlib libsimpleocr}
    {$ENDIF}

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
  •