Results 1 to 8 of 8

Thread: Herblore.scar Try 2

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Herblore.scar Try 2

    This is my second try, I added another Function

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--                     Herblore routines                       --//
    //-----------------------------------------------------------------//
    // * procedure SetupHerblore;               // * SRL
    // * Function VialCheck;                    // * The Man
    // * Function ClickedVialCheck;             // * The Man
    {*******************************************************************************
    procedure SetupHerblore;
    By: SRL
    Description: Declares Global Bitmaps.
    *******************************************************************************}

    procedure SetupHerblore;
    begin
    end;
    {*******************************************************************************
    procedure VialCheck;
    By: The Man
    Description: Returns true if there is a vial in the inventory
    *******************************************************************************}

    Function VialCheck: Boolean;
    var
    VialDTM, x, y : Integer;
    begin
    VialDTM := DTMFromString('78DA6314646060506040038C4824906607125' +
           '204D4F002091E22D4B0135003720F33013562408293801A512021' +
           '40408D349090C6AF0600B0BB0126');

    Result := FindDTM(VialDTM, x, y, MIX1, MIY1, MIX2, MIY2);
    FreeDTM(VialDTM);
    end;
    {*******************************************************************************
    procedure ClickedVialCheck;
    By: The Man
    Description: Returns true if the vial is clicked
    *******************************************************************************}

    Function ClickedVialCheck: Boolean;
    var
    CVialDTM, x, y : Integer;
    begin
    CVialDTM := DTMFromString('78DA63E467606090674001FFFFFF07D38C503' +
           'E232B909024A0861348F013A1868B801A90194C04D48800090E22' +
           'D408105003F293147E3500CC6C18F4');

    Result := FindDTM(CVialDTM, x, y, MIX1, MIY1, MIX2, MIY2);
    FreeDTM(CVialDTM);
    end;
    Please post feedback.

    T~M

  2. #2
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I suggest using bitmap.scar instead of making DTMs..

    Otherwise good going

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Oh yeh, I keep forgetting that bitmaps are faster now.
    OK when I get time I will do.
    thank you.

    T~M

  4. #4
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    procedure CountVials;
    By: Torrent of Flame
    Description: Returns the number of full and empty vials in your inventory.
    *******************************************************************************}

    procedure CountVials;
    var
      empty, full, emptyDTM, fullDTM: integer;
    begin
      emptyDTM := DTMFromString('78DA63E462606010644001151595609A11CA6' +
                '7E401122CA86A5A2B6C51D57061AAD9B63404550D2790E0236017' +
                '2B9010435553525286AA46004848A2AAF1F60EC454238CAAC6DCC' +
                '206450D00FE550971');
      fullDTM := DTMFromString('78DA63E4626060106740014B571C02D38C503' +
               'E232F9060415553536081AA06640E1BAA9A6D4B4350D530030931' +
               '543575AD1B50D5B003092954350B16EF47552308242451D524A4F' +
               '5A3AAE10712C2A86AA213DB51D40000086C0C06');
               
      empty := CountItems('dtm', emptyDTM, []);
      full := CountItems('dtm', fullDTM, []);
      Writeln('You have '+ IntToStr(empty) +' empty vials and '+ IntToStr(full) +' full vials.');
     
      FreeDTM('emptyDTM');
      FreeDTM('fullDTM');
    end;

    I made that y-day. Surely mine would be more useful? ^_^
    Jus' Lurkin'

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Why would you need to know how many?
    You just withdraw how many you need...
    And mine checks whether it is clicked, so the script doesnt loop.
    And... Dont thread hi-jack.

    T~M

  6. #6
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Well it works both ways mine. Also what if your script withdraws the wrong type?

    And mine gives an output, too. + The script wouldnt loop. If it finds the vials it will move onto the next procedures right?


    EDIT: Not trying to thread hijack. Was just posting what I had.
    Jus' Lurkin'

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    on scripts i have used before, it misclicks the vial then clicks tje herb and loops around and never gets it.
    anyway i was just trying to contribute.

    T~M

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    anyway i was just trying to contribute.
    That's good, you shouldn't get criticized for contributing

    I think those functions could be pretty useful, nice going. I also think you could expand on them, make them do a little more then see if the Vial is there, maybe Count the vials? Know what I mean?
    Last edited by Coh3n; 07-06-2009 at 09:57 AM.

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
  •