Results 1 to 15 of 15

Thread: Cooking.Scar

  1. #1
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default Cooking.Scar

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--                      Cooking routines                       --//
    //-----------------------------------------------------------------//
    // * Function FindRange(Var x, y : Integer; x1, y1, x2, y2 : Integer) : Boolean; | By Squigglyo edited by Bebemycat2
    // * Function FindCRange(Col : integer): Boolean;                              | By Tickyy
    // * Function CookMenu: Boolean;                                               | By Tickyy
    // * Function CookAnything(Color : Integer; Uptext : string; RangColor : Integer): boolean; | by Tickyy

    {*******************************************************************************
    function FindRange(var x, y : Integer; x1, y1, x2, y2: Integer): Boolean;
    By: Squigglyo edited by Bebemycat2
    Description: Will find a range inside the variables given, it wont
    click it, but it will put the coords in the first 2 variables
    *******************************************************************************}


    function FindRange(var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
    var
      DTMRange: Array [1..6] of Integer;
      FX, FY, i: Integer;
    begin
      DTMRange[1] := DTMFromString('78DA6364606460B8CD0006AC108AA14D868F4' +
        '10E48036518FE0301E30B20E30AAA1A2D0D0DB81A1060E406B22E' +
        'A3AAB9612083AA4600C8BA89AAC6DCC808550D2B907517554D517' +
        '636A69A8BA86AD2EC3851D40000287B0FD4');
      DTMRange[2] := DTMFromString('78DA637464646058CA0006AC108A212F2D8D4' +
        '10E48036518FE0301A30990B51655CD726531B81A10603403B2E6' +
        'A3AA3137324255E30964ED475563626080AA460FC83A82AA264D8' +
        'C13450D00E6AA0D1F');
      DTMRange[3] := DTMFromString('78DA63D461646098C30006AC108A61AEA2108' +
        '31C9006CA30FC07024679206B2AAA1A732323B81A10607406B256' +
        '11506300644D445593939282AA460DC85A84AA668D9A18AA1A0B2' +
        '06B3BAA1A3D1D1D14350062B70E6A');
      DTMRange[4] := DTMFromString('78DA6314666460686200035608C5A0A7A3C32' +
        '007A481320CFF81809103C86A435573514F12AE060418F580AC76' +
        '54355A1A1AA86A5881AC1A543587B5D0CC01B9A71B554DAF9C108' +
        'A1A00FF8B0B8D');
      DTMRange[5] := DTMFromString('78DA637CC9C0C03089010C582114C3491D490' +
        '63920CD08C4FF8180F133905185AA464612A1060418BF02891E54' +
        '35FD7242A86A1E00896E54357E1E1E286A00B11B0D5E');
      DTMRange[6] := DTMFromString('78DA637CC1C0C03087010C582114839E8E0E8' +
        '31C906604E2FF40C0780DC8988DAAC6CBD515AE0604181F018989' +
        'A86AD4949551D5DC02125351D5E4A4A4A0AA790E24A6A0AA690BE' +
        '243510300B6840FE8');
      for i := 1 to 6 do
      begin
        if (FindDtm(DTMRange[i], FX, FY, x1, y1, x2, y2)) then
        begin
          if  (FX > 10) and (FY > 10) and (FX < 500) and (FY < 330) then
          begin
            MMouse(FX, FY, 6, 6);
            Result := True;
            Exit;
          end;
        end;
        Wait(10);
      end;
      For i := 1 to 6 do
        FreeDTM(DTMRange[i]);
    end;

    {*******************************************************************************
    Function FindCRange(Col : integer): Boolean;
    By: Tickyy
    Description: Finds the range based on your color and MMouses on it.
    *******************************************************************************}

    Function FindCRange(Col : integer): Boolean;
    var
      TPA : TPointArray;
      ATPA : T2DPointArray;
      I, GCT, H, X, Y : Integer;
    begin
      if not LoggedIn then
        Exit;

      GCT := GetColorToleranceSpeed;
      If Not GCT = 2 Then
        ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 5);
      If Length(TPA) = 0 Then
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 10);
      If Length(TPA) = 0 Then
        Exit;
      ATPA := TPAtoATPA(TPA, 15);
      H := High(ATPA);
      For i := 0 To H do
      begin
        MiddleTPAex(ATPA[i], X, Y);
        MMouse(X, Y, 3, 3);
        Wait(250 + Random(100));
        if IsUpTextMultiCustom(['ange', 'ptions']) then
        begin
          Wait(100);
          GetMousePos(x, y);
          Result := True;
          ColorToleranceSpeed(1);
          Exit;
        end;
      end;
    end;

    {*******************************************************************************
    Function CookMenu: Boolean;
    By: Tickyy
    Description: Returns true if the Cooking menu appears..
    *******************************************************************************}

    Function CookMenu: Boolean;
    begin
      Result := FindTextTPA(128, 0, 119, 351, 369, 419, 'bject', StatChars, nothing);
    end;

    {*******************************************************************************
    Function CookAnything(Color : Integer; Uptext : string; RangColor : Integer; CookAll : Boolean): boolean;
    By: Tickyy
    Description: Finds the item based on your color and Uptext, and will Click on
    the Cook-all Button.
    Color = The color of your item
    Uptext = The uptext of your item
    RangColor = The color of the cooking range
    CookAll = If you wanna cook them all
    *******************************************************************************}

    Function CookAnything(Color : Integer; Uptext : string; RangColor : Integer; CookAll : Boolean): boolean;
    var
      x, y : integer;
    begin
      if not LoggedIn then
        exit;
      if GetCurrentTab <> 4 then
        GameTab(4);

      if FindColor(x, y, Color, MIX1, MIY1, MIX2, MIY2) then
        MMouse(x, y, 2, 2);

      If IsUpText(uptext)then
      begin
        GetMousePos(x, y);
        Mouse(X, Y, 0, 0, True);
      end;
      Wait(200);
      FindCRange(RangColor);
      if CookMenu then
      if CookAll =: True then
      begin
        MouseBox(224, 391, 285, 433, 2);
        Result := WaitOption('All', 250);
      End else
        MouseBox(224, 391, 285, 433, 1);
      end;
    end;

    Uhhmmm... i like just like it is atm, don't do shorting stuff pl0x

    Tell me if anything is missing.
    Hi

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    D=. [scar] tags pl0x
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by akwardsaw View Post
    D=. [scar] tags pl0x
    uhhmmm.. what?
    Hi

  4. #4
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    uhhmmm.. what?
    oh your good.

    and as for the procedures, they all look good tbh(not talking about how it can be shortened) although there are things that i would do a little different, although it does the same thing :P
    Last edited by Awkwardsaw; 07-04-2009 at 09:41 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    in findCRange you dont set the ColorSpeed back to the original.
    “Ignorance, the root and the stem of every evil.”

  6. #6
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    in findCRange you dont set the ColorSpeed back to the original.
    The normal ColorToleranceSpeed is 2....
    Hi

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    The normal ColorToleranceSpeed is 2....
    SCAR Code:
    program New;
    {.Include SRL/SRL.Scar}

    Var x, y : Integer;

    begin
      SetupSRL;
      WriteLn(GetColorToleranceSpeed);
    end.

    . Good work rep+

  8. #8
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    SCAR Code:
    program New;
    {.Include SRL/SRL.Scar}

    Var x, y : Integer;

    begin
      SetupSRL;
      WriteLn(GetColorToleranceSpeed);
    end.

    . Good work rep+
    oww, i thought it was 2, thanks tho...

    Fixed.
    Hi

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

    Default

    Ok, let me just ask you this: what the hell is the point of adding this, if people will still have to go and pick colors?

    And if the CookFish goes by colors, then why not 'CookAll' ?

    ~RM

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

  10. #10
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    Ok, let me just ask you this: what the hell is the point of adding this, if people will still have to go and pick colors?

    And if the CookFish goes by colors, then why not 'CookAll' ?

    ~RM
    2 Things:

    There are 60,000+ members out there, maybe one of them is going to make a simple script, then why not use a TPA instant of simple Findcolor thing, i made it in color because ranges always can change in the future, so this never gets outdated....

    Quote Originally Posted by Rasta Magician View Post

    And if the CookFish goes by colors, then why not 'CookAll' ?

    ~RM
    SCAR Code:
    MouseBox(224, 391, 285, 433, 2);
      Result := WaitOption('All', 250);
      end;

    Did you even read it properly?
    Hi

  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 Tickyy View Post
    2 Things:

    There are 60,000+ members out there, maybe one of them is going to make a simple script, then why not use a TPA instant of simple Findcolor thing, i made it in color because ranges always can change in the future, so this never gets outdated....



    SCAR Code:
    MouseBox(224, 391, 285, 433, 2);
      Result := WaitOption('All', 250);
      end;

    Did you even read it properly?
    1: FindObjectCustom, FindObjectTPA, FindObjectRecord pretty much cover and are better than your first function.

    2: I mean 'cookAll' as a name, as in being able to cook meat, since all it does is look for colors anyway. And for this again, FindObject + WaitOption.

    ~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
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    I Like it as it is, and i use it all the time, if you don't like it then don't use it.

    Simple.
    Hi

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

    Default

    lol, if you post it in public svn then i'm guessing you were expecting it to get added, otherwise i can move it to public test corner if you'd rather have it there.

    and i was explaining why it wouldn't be added instead of just simply posting no.

    ~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
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Dude, i am trying to contribute, i don't choose which one should be added and which one not, if they like just one of them then take just one of them, JaGeX is doing everything to prevent Marcoing, i am just trying my best for a better future, even if i'm not such a good scripter, i'm trying my best, i hope you understand what i mean.

    And yes, i like your idea with the cook all, if you don't mind i'll change the name right now !
    Hi

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

    Default

    relax, i know you're trying your best, which is why i criticize your function. It's not to put you down, it's to help you develop your skills more.

    ~RM

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

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
  •