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.