SCAR Code:
program TreeSwitching;
{.include SRL/SRL.scar}
var wx, wy, tx, ty, cx, cy: Integer;
x, y, DirtDTM: Integer;
DirtMP: TDTMPointDef;
DirtSP: array[0..3] of TDTMPointDef;
DirtDTMSkel: TDTM;
DDTMTol, DDTMArea: Integer;
procedure LoadDDTMs;
begin
DDTMTol:=60;
DDTMArea:=1;
DirtMP.x:=597;
DirtMP.y:=79;
DirtMP.areasize:=1;
DirtMP.areashape:=0;
DirtMP.color:=2196070;
DirtMP.tolerance:=255;
DirtSP[0].x:=626;
DirtSP[0].y:=78;
DirtSP[0].areasize:=DDTMArea;
DirtSP[0].areashape:=0;
DirtSP[0].color:=2315614;
DirtSP[0].tolerance:=DDTMTol;
DirtSP[1].x:=624;
DirtSP[1].y:=78;
DirtSP[1].areasize:=DDTMArea;
DirtSP[1].areashape:=0;
DirtSP[1].color:=1337192;
DirtSP[1].tolerance:=DDTMTol;
DirtSP[2].x:=622;
DirtSP[2].y:=74;
DirtSP[2].areasize:=DDTMArea;
DirtSP[2].areashape:=0;
DirtSP[2].color:=2196093;
DirtSP[2].tolerance:=DDTMTol;
DirtSP[3].x:=624;
DirtSP[3].y:=74;
DirtSP[3].areasize:=DDTMArea;
DirtSP[3].areashape:=0;
DirtSP[3].color:=1723009 ;
DirtSP[3].tolerance:=DDTMTol;
DirtDTMSkel.MainPoint:=DirtMP;
DirtDTMSkel.SubPoints:=DirtSP;
DirtDTM:=AddDTM(DirtDTMSkel);
end;
procedure FindIt;
begin
MakeCompass('E');
// SetRun(true);
for DDTMTol := 0 to 5 do
begin
if (DTMRotated(DirtDTM, x, y, mmx1, mmy1, mmx2, mmy2)) then
Mouse(x, y, 3, 3, true);
Exit;
WriteLn('Yay it worked');
end;
WriteLn('It didnt work');
end;
procedure SwitchTrees;
var
LC: Integer;
begin
if (not(LoggedIn)) then
Exit;
LC :=FindLadderColor;
begin
MakeCompass('E');
SetRun(true);
WriteLn('switching trees');
RadialRoadWalk(LC, 25, 60, 60, -1, 1);
WriteLn('Walking to rocks');
repeat
Wait(1350);
FindIt;
WriteLn('looking for craft symbol');
Until FindSymbol(wx, wy, 'spin');
Mouse(wx, wy, 2, 2, true);
Wait(1000);
MakeCompass('N');
repeat
RadialRoadWalk(LC, 0, 20, 60, -1, 1);
Wait(5000+random(50));
WriteLn('looking for tree symbol');
FindSymbol(tx, ty, 'tree')
Mouse(tx, ty, 2, 2, true);
WriteLn('at next tree');
Until FindObjCustom(cx, cy, ['Magic', 'agic', 'agi'],[1385251, 1780264, 3098949], 3)
end;
end;
begin
SetupSRL;
LoadDDTMs;
SwitchTrees;
end.