Results 1 to 3 of 3

Thread: a little bit to Crafting.Scar

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

    Default a little bit to Crafting.Scar

    just a couple functions I figured would be useful, considering crafting.scar is pretty much empty anyways. First one is just a complete rewrite, OpenOven was originally made by fawaki and definatly was outdated. The second was for selecting the options after clicking the oven (to make bowls, pots, and whatnot). Let me know what you think, they were kind of 10 minute deals but I thought they would be helpful none the less.

    SCAR Code:
    {*******************************************************************************
    function OpenOven: Boolean;
    By: Blumblebee
    Description: Opens crafting oven.
    *******************************************************************************}

    function OpenOven: Boolean;
    var x, y: Integer; Tpa: Tpointarray; Atpa: T2DpointArray; P: Tpoint; h, i, CTS: integer; bool: boolean;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.08, 0.16);
      FindColorsSpiralTolerance(MScx, MScy, tpa, 2247801, MSx1, MSy1, MSx2, MSy2, 15);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
      if Length(Tpa) <= 0 then Exit;
      atpa := TPAtoATPAEx(tpa, 5, 5);
      h := high(atpa);
      for i := 0 to h do
      begin
        p := MiddleTPA(atpa[h]);
        MMouse(P.x, P.y+15, 5, 5);
        wait(150+random(200));
        Result := IsUpText('ire');
        if not Result then continue;
        GetMousePos(x, y);
        bool := Random(4) <> 1;
        Mouse(x, y, 0, 0, bool);
        wait(150+random(200));
        ChooseOption('ire');
        break;
      end;
    end;
    SCAR Code:
    {*******************************************************************************
    function CraftOption(Option: String; HowMany: Integer): Boolean;
    By: Blumblebee
    Description: Chooses one of the four options via the syntax given. Valid arguments
    for "Option" are bowl, pot, pie (dish), plantpot.
    *******************************************************************************}


    function CraftOption(Option: String; HowMany: Integer): Boolean;
    var Coords: TintegerArray; x, y: Integer;
    begin
      SetArrayLength(Coords, 5);
      case lowercase(Option) of
        'bowl': Coords := [294, 391, 344, 425, 738652];
        'pot', 'flourpot': Coords := [49, 388, 104, 435, 1072765];
        'pie', 'dish', 'piedish': Coords := [169, 390, 223, 427, 671314];
        'plantpot', 'plant': Coords := [412, 388, 468, 434, 6325162];
      end;
      FindColorTolerance(x, y, Coords[4], Coords[0], Coords[1], Coords[2], Coords[3], 10);
      Mouse(x, y, 5, 5, False);
      if (HowMany = 0) then Result := ChooseOption('ake 10');
      begin
        Result := ChooseOption('ake X');
        wait(150+random(100));
        TypeSend(IntToStr(HowMany));
      end;
    end;

    I dont really know how to use SRL_warn, so I didnt add them yet.
    “Ignorance, the root and the stem of every evil.”

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

    Default

    Good stuff buddy.

    So, does this mean your back now??

  3. #3
    Join Date
    Aug 2009
    Location
    Albuquerque, New Mexico
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default k

    im gonna try it out thx =)

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
  •