SCAR Code:
{*******************************************************************************
Function LoadToolDTM(tool: string): integer;
By: akwardsaw
Description: It loads the tool dtms. Only use is for GetToolDTM
*******************************************************************************}
Function LoadToolDTM(tool: string): integer;
var
Spadedtm, Diberdtm, Rakedtm, Curedtm, Compostdtm: integer;
Sackdtm, Secaturesdtm, Basketdtm, Troweldtm: integer;
begin
case tool of
'Spade': Spadedtm := DTMFromString('78DA63B465626078C28006189148206D0954F' +
'398801A63A09AB704D45800D57C20A0C61EA8E61901355E403557' +
'F1AB0100476C06E8');
'Dibber': Diberdtm := DTMFromString('78DA634C62626078C68006189148209D03547' +
'387809A54A09A1704D4C403D5BC23A0A610A8E6117E3500AADB06' +
'97');
'Rake': Rakedtm := DTMFromString('78DA63EC67626078C5800618914820DD4D849' +
'A0EA09A9704D44CA28E1A000742076F');
'Cure': Curedtm := DTMFromString('78DA63DCCFC4C07099010D30229140FA3050C' +
'D43026A8E01D5BC25A0662F50CD07026AB600D5BC24A0662750CD' +
'2DFC6A00C07E09E5');
'Compost': Compostdtm := DTMFromString('78DA634C656260F8C58006189148209D49849' +
'A62A01A4E46FC6AB2806A8409A84902AAE125A02697B07B00EBAF' +
'05B3');
'Sack': Sackdtm := DTMFromString('78DA633466626060676440058C482490B606A' +
'A1126A0C60FA88685801A6FA09A7F0CF8D57800D57CC7AF060000' +
'D5037F');
'Secatures': Secaturesdtm := DTMFromString('78DA634C64626058CDC8800A189148201D035' +
'4B39608359B08A8C902AA394C404D1150CD01026ACA806AF6E257' +
'03002E0406DA');
'Basket': Basketdtm := DTMFromString('78DA639CC2C4C0F08B010D302291407A3A50C' +
'D3F026A2602D53033E257338109898743CD0C22CC990A5423C248' +
'D8CD3FF0BB190041A40742');
'Trowel': Troweldtm := DTMFromString('78DA6394656460086640038C4824905626428' +
'D2690E54D408D3E90E54E408D2A90154E408D1A90154A408D3490' +
'158B5F0D00D0A4035C');
end;
result:= 0;
end;
{*******************************************************************************
Function GetToolDTM(tool: string): integer;
By: akwardsaw
Description: It's result is the Tool's dtm
*******************************************************************************}
Function GetToolDTM(tool: string): integer;
begin
case tool of
'Spade': result:= LoadToolDTM('Spade');
'Dibber': result:= LoadToolDTM('Dibber');
'Rake': result:= LoadToolDTM('Rake');
'Cure': result:= LoadToolDTM('Cure');
'Compost': result:= LoadToolDTM('Compost');
'Sack': result:= LoadToolDTM('Sack');
'Secatures': result:= LoadToolDTM('Secatures');
'Basket': result:= LoadToolDTM('Basket');
'Trowel': result:= LoadToolDTM('Trowel');
end;
end;
{*******************************************************************************
Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer; click: boolean ): boolean;
By: akwardsaw
Description: It returns true or false if the tool is found. If so it either clicks
left, or right, depending in what you put in for Click. True is Left
and im sure as hell theres a way to shorten this procedure :P
*******************************************************************************}
Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer; click: boolean ): boolean;
var
x, y, D: integer;
TSA: TStringArray;
begin
TSA := ['Dibber','Rake','Cure','Compost' +
'Sack','Secatures','Basket','Trowel']
d := GetToolDTM(Tool);
if FindDTM(d, x, y, cx1, cy1, cx2, cy2) then
begin
mmouse(x, y, 4, 4);
wait(100+random(100));
if IsuptextMultiCustom([TSA]) then
begin
getmousepos(x, y);
result := True;
mouse(x, y, 0, 0, click);
end;
end;
FreeDTM(D);
end;
{*******************************************************************************
procedure StoreTool(tool: string);
By: akwardsaw
Description: It stores the tool. Only if You are at the storing screen, and if it
is in your inventory. it works with every thing other than Compost
*******************************************************************************}
procedure StoreTool(tool: string);
var x, y: integer;
begin
case tool of
'Spade': if FindColor(x, y, 6608765, 575, 264, 614, 281)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Dibber': if FindColor(x, y, 6608765, 669, 216, 710, 232)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Rake': if FindColor(x, y, 6608765, 578, 215, 611, 231)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Secatures': if FindColor(x, y, 6608765, 659, 265, 720, 279)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Trowel': if FindColor(x, y, 6608765, 668, 311, 709, 328)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Watering Can': if FindColor(x, y, 6608765, 556, 313, 632, 327)then FindTool(tool, mix1, miy1, mix2, miy2, true);
'Scarecrow': if FindColor(x, y, 6608765, 565, 361, 624, 376)then FindTool(tool, mix1, miy1, mix2, miy2, true);
end;
end;
{*******************************************************************************
procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
By: akwardsaw
Description: It stores the Compost. Only if You are at the storing screen, and if it
is in your inventory
im also sure there is a way to shorten this :P
*******************************************************************************}
procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
var x, y: integer;
begin
case Compost of
'Compost': begin
if FindColor(x, y, 6608765, 568, 407, 622, 425)then
begin
if All then
begin
FindTool(Compost, mix1, miy1, mix2, miy2, false);
Chooseoption('Store All');
wait(50 + random(50));
exit;
end;
if Number = 1 then FindTool(Compost, mix1, miy1, mix2, miy2, true);
if Number = 5 then
begin
FindTool(Compost, mix1, miy1, mix2, miy2, false);
Chooseoption('Store 5');
wait(50 + random(50));
exit;
end;
if all = false then
if Number > 1 then
if Number <> 5 then
begin
FindTool(Compost, mix1, miy1, mix2, miy2, false);
Chooseoption('Store X');
wait(50 + random(50));
typesend(inttostr(number));
exit;
end;
end;
end;
'Supercompost': begin
if FindColor(x, y, 6608765, 649, 409, 731, 422)then
begin
if All then
begin
mousebox(678, 431, 694, 451, 2);
Chooseoption('Store All');
wait(550 + random(500));
exit;
end;
if Number = 1 then mousebox(678, 431, 694, 451, 1);
if Number = 5 then
begin
mousebox(678, 431, 694, 451, 2);
Chooseoption('Store 5');
wait(550 + random(500));
exit;
end;
if not all then
if Number < 1 then
if Number <> 5 then
begin
mousebox(678, 431, 694, 451, 2);
Chooseoption('Store X');
wait(2500 + random(500));
typesend(inttostr(number));
exit;
end;
end;
end;
'Bucket': begin
if FindColor(x, y, 6608765, 664, 360, 713, 375)then
begin
if All then
begin
mousebox(678, 385, 694, 402, 2);
Chooseoption('Store All');
wait(250 + random(500));
exit;
end;
if Number = 1 then mousebox(678, 385, 694, 402, 1);
if Number = 5 then
begin
mousebox(678, 385, 694, 402, 2);
Chooseoption('Store 5');
wait(250 + random(500));
exit;
end;
if not all then
if Number < 1 then
if Number <> 5 then
begin
mousebox(678, 385, 694, 402, 2);
Chooseoption('Store X');
wait(250 + random(500));
typesend(inttostr(number));
exit;
end;
end;
end;
end;
end;