Results 1 to 24 of 24

Thread: FireMaking.Scar TinderBoxExists(); and updated .bmp

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default FireMaking.Scar TinderBoxExists(); and updated .bmp

    Updated TinderBox.bmp:
    SCAR Code:
    TinderBox := BitmapFromString(7, 3, 'beNoLCrC2stRSZdNVByEDL' +
           'XYI8vJ0t7O1VldihYhDpMJCgoKDAgL9/YDI39cbiIIBYsIMuA==');


    I couldn't think of any reason this shouldn't be in there.
    SCAR Code:
    {*******************************************************************************
    function TinderBoxExists(var x, y: Integer): Boolean;
    By: NCDS
    Description: Checks if there is TinderBox present in inventory. Returns 'x' and 'y' values it is found at.
    *******************************************************************************}

    function TinderBoxExists(var x, y: Integer): Boolean;
    begin
      Gametab(tab_Inv);
      Wait(300 + Random(300));
      Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
    end;

    Tested with:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/firemaking.scar}

    function TinderBoxExists(var x, y: Integer): Boolean;
    begin
      Gametab(tab_Inv);
      Wait(300 + Random(300));
      Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
    end;

    var
      x, y: Integer;
    begin
      SetupSRL;
      ActivateClient;
      LoadFiremakingBitmaps;
      if TinderBoxExists(x, y) then
      begin
        Writeln('x := '+IntToStr(x)+';');
        Writeln('y := '+IntToStr(y)+';');
      end;
    end.
    Output:
    SCAR Code:
    New client targeted
    Successfully compiled (2060 ms)
    SRL Compiled in 16 msec
    x := 572;
    y := 233;
    Successfully executed

  2. #2
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

    Good work, but if my opinion mattered, I'd say this shouldn't be commited.

  3. #3
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    I'm gonna support this. Good job fixing the bitmap also.
    There used to be something meaningful here.

  4. #4
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

    Good work, but if my opinion mattered, I'd say this shouldn't be commited.
    I understand completely what your saying, but the bitmap was in there along with very similar functions so I figured this should be too.

    If people want to learn they can easily still make they're own.

  5. #5
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Wouldn't the invslot be more useful then the coords?

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by MylesMadness View Post
    Wouldn't the invslot be more useful then the coords?
    The other functions return the coords, that's why this does, and you could always just use CoordsToItem();?

  7. #7
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Now that I think about it more, I'm not sure how I feel. In some ways, I think it would hurt the learning process. In others, maybe there's a hope that they could spend more time with more advanced (or important) aspects of the script than simply finding a static item. However, that is putting a bit of faith into the scripter to assume he'd strive for difference/greatness/adjective. I'm torn.

    But I do realize that they don't have to use it, but from past knowledge, people tend to use FindRange rather than making their own function for it.

    I also fear this could lead to more and more functions similar to it.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Now that I think about it more, I'm not sure how I feel. In some ways, I think it would hurt the learning process. In others, maybe there's a hope that they could spend more time with more advanced (or important) aspects of the script than simply finding a static item. However, that is putting a bit of faith into the scripter to assume he'd strive for difference/greatness/adjective. I'm torn.

    But I do realize that they don't have to use it, but from past knowledge, people tend to use FindRange rather than making their own function for it.

    I also fear this could lead to more and more functions similar to it.
    I don't care much either way. I don't really see how it's different from any of the other functions in /skill.

    I guess I'll just wait for words from the wise

  9. #9
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    :< /me isn't wise.


  10. #10
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks for the bitmap!

    I'd have to say no to the function, I believe it has a better place in the barebones idea for scripts.

    Thanks once again for the bitmap though! Remind me and I will commit it tomorrow.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  11. #11
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Thanks for the bitmap!

    I'd have to say no to the function, I believe it has a better place in the barebones idea for scripts.

    Thanks once again for the bitmap though! Remind me and I will commit it tomorrow.
    Barebones will have to use the include..... hello?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  12. #12
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    Barebones will have to use the include..... hello?

    ~RM
    I think he meant it would fit better inside a script, than the include

  13. #13
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    I think he meant it would fit better inside a script, than the include
    I think we might as well get rid of /skills/ then, no?

    The point of /skills/ is to have this sort of thing.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  14. #14
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    I think we might as well get rid of /skills/ then, no?

    The point of /skills/ is to have this sort of thing.

    ~RM
    I agree with you, add the function to the include

  15. #15
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I don't much care what happens to the function. I only made it because it seemed to fit, but someone should at least commit the .bmp.

    I have to agree with RM though, if something like this doesn't fit than what use is /skill besides .bmp's?

    Edit:
    Basically the same function?:
    SCAR Code:
    {*******************************************************************************
    function WeHaveLogs(var WhereX, WhereY: Integer): Boolean;
    By: WT-Fakawi
    Description: Checks if there is Logs in your Inventory Returns X,Y Cords of Log
    *******************************************************************************}

    function WeHaveLogs(var tx, ty: Integer): Boolean;
    begin
      GameTab(tab_Inv);
      Wait(500 + Random(350));
      Result := FindBitmapMaskTolerance(LogMask, Tx, Ty, MIX1, MIY1, MIX2, MIY2, 10, 2);
    end;
    Last edited by NCDS; 07-02-2010 at 07:12 PM.

  16. #16
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I personally don't think /skills/ should be in SRL, which is why I oppose this. That's all.

  17. #17
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Updated bitmap. Thank you

  18. #18
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    I personally don't think /skills/ should be in SRL, which is why I oppose this. That's all.
    I'm kinda in between on it I guess.

    Quote Originally Posted by Bebe View Post
    Updated bitmap. Thank you
    Thanksss

  19. #19
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

    Good work, but if my opinion mattered, I'd say this shouldn't be commited.
    I understand what you're saying, but to older scripters this saves a bit of valuable time. For example, I'm very lazy therefore making DTMs can take weeks because I never feel like actually creating them. I know how to create DTMs, DDTMS, TPAs, Bitmaps, etc; but this is still extremely useful as I don't have to get off my butt to do something.

    NAH, just kidding. I agree with you. Things keep getting easier and easier as time passes. I keep hearing people complain about how we never advance our coding (make things easier such as something like if FindObject(name) then Attack; ). They just don't understand that we are a community that likes to learn and therefore create more advanced and efficient scripts.

  20. #20
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    you can only 'advance' once the 'current step' is settled. Otherwise you're leaving things unfinished.

    And you're only going to spend x time per script. If you don't spend time on looking for your tinderbox, you can maybe spend the time making a procedure that'll withdraw it from the bank if it isn't in your inv. And BAM, we have advancement because FindTinderbox was in the include.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  21. #21
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

    We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

    That's all.

  22. #22
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    ^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

    We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

    That's all.
    But there is no 'MakeFire;', it stops at TinderBoxExists();, so they really don't have a choice but to advance.

    From what I see, /skill is made for assistance for the skills not to do the skills. That's why I feel it fit's. It help's complete a certain skill, but does not actually do the skill. There is plenty still left to the scripter's themselves.

  23. #23
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    ^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

    We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

    That's all.
    Then why do we bother having the tinderbox "anywhere" in the inv, rather than just "on the first spot" ?

    Simplest would be on the first spot and coord click it.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

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
  •