Results 1 to 9 of 9

Thread: FindItem - Generates DDTMs

  1. #1
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindItem - Generates DDTMs

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               » Item Routines                               --//
    //-----------------------------------------------------------------//
    // * function BankBox(i: Integer): TBox;                                                           // * by Boreas
    // * function GetItemName(Slotx, Sloty: integer; Debug: Boolean): string;                          // * by mat_de_b
    // * function CreateItemDTM(x1, y1, x2, y2: integer; var DDTM: integer; Debug: boolean): Boolean;  // * by mat_de_b
    // * procedure SaveDTM(Debug: boolean);                                                            // * by mat_de_b
    // * function FindBankDTM(var x, y: integer; DDTM: integer; UpText2: string): boolean;             // * by mat_de_b
    // * procedure GenerateBankDTMs(Debug: boolean);                                                   // * by mat_de_b
    // * function LoadItem(UpText2: string; var ItemDTM: integer): boolean;                            // * by mat_de_b
    // * function FindItemInv(var x, y:integer; UpText2: String): boolean;                             // * by mat_de_b
    // * function FindItemBank(var x, y:integer; UpText2: String): boolean;                            // * by mat_de_b

    {*******************************************************************************
    function BankBox(i: Integer): TBox;
    By: Boreas - simplified by mat_de_b
    Description: Returns the Tbox of the given bankslot
    *******************************************************************************}


    {*******************************************************************************
    function GetItemName(Slotx, Sloty: integer; Debug: Boolean): string;
    By: mat_de_b
    Description: Moves the mouse to a give slot and then returns the item name
                 - Debug writes the changes to the Uptext etc...
    *******************************************************************************}


    {*******************************************************************************
    function CreateItemDTM(x1, y1, x2, y2: integer; var DDTM: integer; Debug: boolean): Boolean;
    By: mat_de_b
    Description: Takes a bitmap of the Box then finds all the 65536 pixels
                  then creates subpoints and a main point
                 - Debug displays in the debug window the finding of points
    *******************************************************************************}


    {*******************************************************************************
    function FindBankDTM(var x, y: integer; DDTM: integer; UpText2: string): boolean;
    By: mat_de_b
    Description: Finds a DTM in a bank slot by going from slot to slot and
                 then checking the UpTest if the DTM is found
    *******************************************************************************}


    {*******************************************************************************
    procedure GenerateBankDTMs(Debug: boolean);
    By: mat_de_b
    Description: Makes DTMs of the first 48 items in your bank
                 -Debug displays info along the way
    *******************************************************************************}


    {*******************************************************************************
    function LoadItem(UpText2: string; var ItemDTM: integer): boolean;
    By: mat_de_b
    Description: Loads a Item DTM from a file and saves it to the ItemDTM integer
    *******************************************************************************}


    {*******************************************************************************
    function FindItemInv(var x, y:integer; UpText2: String): boolean;
    By: mat_de_b
    Description: Finds an Item in your inventroy and returns the x and y
                 ! The uptext is case sensative and should be as in game...
    *******************************************************************************}


    {*******************************************************************************
    function FindItemBank(var x, y:integer; UpText2: String): boolean;
    By: mat_de_b
    Description: Finds an Item in your bank and returns the x and y
                 ! The uptext is case sensative and should be as in game...
    *******************************************************************************}


    There are the functions now for an explanation

    This will generate DTMs for the first 48 slots of your bank and if succesful will save each one to thier own individual file, they can then be used to find items in your inventory and bank at a later date...

    Current issues:
    It creating working DTMs for all items...

    Features :
    Creats DTMs of all items
    Excludes black pixles in the amount
    Can be loaded and saved
    Can find items in bank and Inventory

    How to Install:
    Extract the included .rar to includes/srl/srl/misc
    Then if you want you can try out the ItemTest.scar in includes/srl/srl/misc/Item


    How You can help:
    Upload a .rar of any DTMs you have generated

    Thanks to Boreas for the BankBox Code and to pwnaz0r for the original code for the DTM from client
    The truth finally came out...


  2. #2
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sweet

  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mat_de_b View Post
    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               » Item Routines                               --//
    //-----------------------------------------------------------------//
    // * function BankBox(i: Integer): TBox;                                                           // * by Boreas
    // * function GetItemName(Slotx, Sloty: integer; Debug: Boolean): string;                          // * by mat_de_b
    // * function CreateItemDTM(x1, y1, x2, y2: integer; var DDTM: integer; Debug: boolean): Boolean;  // * by mat_de_b
    // * procedure SaveDTM(Debug: boolean);                                                            // * by mat_de_b
    // * function FindBankDTM(var x, y: integer; DDTM: integer; UpText2: string): boolean;             // * by mat_de_b
    // * procedure GenerateBankDTMs(Debug: boolean);                                                   // * by mat_de_b
    // * function LoadItem(UpText2: string; var ItemDTM: integer): boolean;                            // * by mat_de_b
    // * function FindItemInv(var x, y:integer; UpText2: String): boolean;                             // * by mat_de_b
    // * function FindItemBank(var x, y:integer; UpText2: String): boolean;                            // * by mat_de_b

    {*******************************************************************************
    function BankBox(i: Integer): TBox;
    By: Boreas - simplified by mat_de_b
    Description: Returns the Tbox of the given bankslot
    *******************************************************************************}


    {*******************************************************************************
    function GetItemName(Slotx, Sloty: integer; Debug: Boolean): string;
    By: mat_de_b
    Description: Moves the mouse to a give slot and then returns the item name
                 - Debug writes the changes to the Uptext etc...
    *******************************************************************************}


    {*******************************************************************************
    function CreateItemDTM(x1, y1, x2, y2: integer; var DDTM: integer; Debug: boolean): Boolean;
    By: mat_de_b
    Description: Takes a bitmap of the Box then finds all the 65536 pixels
                  then creates subpoints and a main point
                 - Debug displays in the debug window the finding of points
    *******************************************************************************}


    {*******************************************************************************
    function FindBankDTM(var x, y: integer; DDTM: integer; UpText2: string): boolean;
    By: mat_de_b
    Description: Finds a DTM in a bank slot by going from slot to slot and
                 then checking the UpTest if the DTM is found
    *******************************************************************************}


    {*******************************************************************************
    procedure GenerateBankDTMs(Debug: boolean);
    By: mat_de_b
    Description: Makes DTMs of the first 48 items in your bank
                 -Debug displays info along the way
    *******************************************************************************}


    {*******************************************************************************
    function LoadItem(UpText2: string; var ItemDTM: integer): boolean;
    By: mat_de_b
    Description: Loads a Item DTM from a file and saves it to the ItemDTM integer
    *******************************************************************************}


    {*******************************************************************************
    function FindItemInv(var x, y:integer; UpText2: String): boolean;
    By: mat_de_b
    Description: Finds an Item in your inventroy and returns the x and y
                 ! The uptext is case sensative and should be as in game...
    *******************************************************************************}


    {*******************************************************************************
    function FindItemBank(var x, y:integer; UpText2: String): boolean;
    By: mat_de_b
    Description: Finds an Item in your bank and returns the x and y
                 ! The uptext is case sensative and should be as in game...
    *******************************************************************************}


    There are the functions now for an explanation

    This will generate DTMs for the first 48 slots of your bank and if succesful will save each one to thier own individual file, they can then be used to find items in your inventory and bank at a later date...

    Current issues:
    It creating working DTMs for all items...

    Features :
    Creats DTMs of all items
    Excludes black pixles in the amount
    Can be loaded and saved
    Can find items in bank and Inventory

    How to Install:
    Extract the included .rar to includes/srl/srl/misc
    Then if you want you can try out the ItemTest.scar in includes/srl/srl/misc/Item


    How You can help:
    Upload a .rar of any DTMs you have generated

    Thanks to Boreas for the BankBox Code and to pwnaz0r for the original code for the DTM from client
    How recent was the bankfinding? as in, did you get this off Boreas's thread or did he send to you?

    Join the fastest growing merchanting clan on the the net!

  4. #4
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    at most a month old, he posted it in my thread
    The truth finally came out...


  5. #5
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    function FindItemInv(var x, y:integer; UpText2: String): boolean;
    By: mat_de_b
    Description: Finds an Item in your inventroy and returns the x and y
    ! The uptext is case sensative and should be as in game...
    EEK! I've been trying to get something like this to work. Damn you for making one! >.< oh well *Downloads file*

    Edit: wait not what i want
    But it gives me some ideas to try on mine.
    Basically mine checks if item exits in [i] if it does moves mouse, if uptext is up will left/right click and choose option. Problem is, it won't detect the non-white uptext.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  6. #6
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeh it will? isUpText finds it?
    The truth finally came out...


  7. #7
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I tried many times with that. It sometimes misses a letter or something. But I found a guaranteed way with rs_GetUpText.

    SCAR Code:
    function MouseInvText(istextup, option:string; leftclick: Boolean; inv1, inv2, waitfor, xtimes:integer): Boolean; //by Narcle
    var
    i,x,y, times:integer;
    begin
    gametab(4);
    for i := inv1 to inv2 do
    if (ExistsItem(i)) then
      begin
      MMouseItem(i);
      GetMousePos(x, y);
      wait(100+random(50));
      if (pos(istextup, rs_GetUpText) > 0) then
        begin
          if (leftclick = true) then Mouse(x,y,5,5,true);
          if (leftclick = false) then
          begin
            Mouse(x,y,5,5,false);
            Chooseoption(option);
          end;
          result := true;
          times := times + 1;
          wait(waitfor+random(100));
          if (times = xtimes) then exit;
        end;
      end else
      result := false;
      exit;
    end;
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Gj

  9. #9
    Join Date
    Sep 2007
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DDTMs
    By Jackrawl in forum OSR Help
    Replies: 19
    Last Post: 12-23-2007, 02:56 AM
  2. Ddtms?
    By RudeBoiAlex in forum OSR Help
    Replies: 6
    Last Post: 09-11-2007, 04:07 PM

Posting Permissions

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