SKy Scripter
2007-10-22 16:51:29
WoodCutting Results!
Lorax
Lorax
Techinque - I Really liked how he had one color for every tree. Also he found the middle point of every tree. (22/ 25)
Creativity - Not much creativity just average but good. :) (15/ 20)
Speed - I really like the speed. it found every tree in about 30-40.msc on my computer ;) (25/ 25)
Accuracy - The accuracy was very good except. I didnt like how it would return more then one point on the same tree. also it moves the mouse on other things. like "Bushes" (18/ 25)
Debugging - The Debugging was low.. when i mean debugging i want to see pictures and ect.. :p (10/ 20)
Total (90/115)
program New;
{.include SRL/SRL.scar}
const
ShowMode = True; // If true, it won't stop, it will just show what it found.
TreeSizeTol = 60; // Maximum size of a tree.
var
x, y: Integer;
function FindMiddle(var Tree: TPoint): Boolean;
var
b: TPointArray;
C: TIntegerArray;
begin
Result := False;
FindColorsTolerance(b, 2186836, Tree.x - 30, Tree.y - 30, Tree.x + 30, Tree.y + 30, 15); // Looks for 'normal' green points around black points
try
c := GetColors(b);
except
Writeln('GetColors failed');
end;
ClearSameIntegersAndTPA(C, b); // Shortens arrays by deleting duplicates
Writeln(IntToStr(Length(C)) + ' different tree colors');
if ( Length(C) > 15 ) then // Considered a tree. Could perhaps be lowered.
begin
Result := True;
Tree := MiddleTPA(b); // Return the middle of the TPA.
end;
end;
function FindTree(var x, y: Integer; SizeTolerance: Integer): Boolean;
var
i: Integer;
b: TPointArray;
t: TPointArrayArray;
Tree: TPoint;
begin
Result := False;
FindColorsSpiralTolerance(MSCX, MSCY, b, 1536, MSX1, MSY1, MSX2, MSY2, 10); // Every tree has black-like points. This will search for them.
if ( Length(b) = 0 ) then
begin
Writeln('No black dots'); // Thus no trees.
Exit;
end;
t := SplitTPAex(b, SizeTolerance); // Divides the TPA into smaller groups with longer distances.
for i := 0 to High(t) do
begin
if ( Length(t[i]) > 5 ) then
begin
Tree := MiddleTPA(t[i]); // Gets center of TPA
if FindMiddle(Tree) then
begin
MMouse(Tree.x, Tree.y, 5, 5);
Wait(100 + Random(100));
if IsUpTextMultiCustom(['p down ', 'Chop d', 'hop do']) then
begin
GetMousePos(Tree.x, Tree.y);
if not(ShowMode)then
Break;
end;
end;
end;
end;
end;
begin
SetupSRL;
if(FindTree(x, y, TreeSizeTol))then
Writeln('Tree finding succeeded.');
end.Santa_Clause
Techinque - I Liked how you used muilti colors then made them all one tpointarray. Then you found the middle. (18/ 25)
Creativity - There was some creativity making muilti colors one tpointarray, nothing special really though. (15/ 20)
Speed - Speed wasnt as fast.. took awhile.. (17 / 25)
Accuracy - it Was Accurate and found a the tree everytime. however, it would skip a tree or two somtimes. (20/ 25)
Debugging - it debugged through SCAR However, i couldnt see much of what was going on.. also i wanted to actually see a canvas display or somthing… (15 / 20)
Total (85/115)
{.include srl/srl.scar}
function FindItem(Item : string; ItemColours : TIntegerArray) : Boolean;
var
DoubleArray : Array Of Array Of TPoint;
SingleArray : Array Of TPoint;
x, y : integer;
I, J, K : integer;
ItemText : string;
MiddlePoint : TPoint;
begin
Disguise('Fixing Uptext');
ItemText := LowerCase(Item);
Delete(ItemText, 1, 1);
for I := 0 to 1 do
begin
Wait(2);
Disguise('Finding Colors ' + IntToStr(I));
for K := 0 to GetArrayLength(ItemColours) - 1 do
FindColorsSpiralTolerance(MICX, MICY, SingleArray, ItemColours[K], MSX1, MSY1, MSX2, MSY2, I); //Finds all ItemColours with a tolerance of 0 to 10, and adds them to SingleArray
Disguise('Re-arranging Array');
SingleArray := ReArrangeAndShortenArray(SingleArray, 10);
Disguise('Splitting TPA');
DoubleArray := SplitTPA(SingleArray);//Finds all clusters of points in SingleArray that were found together in groups of 5 pixels.
WriteLn(IntToStr(length(DoubleArray)));
for J := 0 to length(DoubleArray) - 1 do
begin
Wait(2);
Disguise('Finding Middle Point');
MiddlePoint := MiddleTPA(DoubleArray[J]);//Finds the middle point of TPoints in DoubleArray.
MMouse(MiddlePoint.X, MiddlePoint.Y, 2, 2);
Wait(5);
if IsUpText(ItemText) then
begin
GetMousePos(X, Y);
WriteLn(IntToStr(GetColor(X, Y)));
// Mouse(X, Y, 0, 0, False);
// ClickOption(ItemText, 1);
Result := True;
WriteLn(BoolToStr(Result));
//Exit;
end;
end;
end;
end;
var m, z : Integer;
begin
MarkTime(Z);
SetupSRL;
ClearDebug;
Disguise('SCAR');
ActivateClient;
Wait(2000);
M := TimeFromMark(Z);
FindItem('hop', [2245949, 3897966, 4558465]);
WriteLn(IntToStr(GetTimeRunning - M));
Disguise('Finished');
end.
1st Place goes to : Lorax
Congratz, Lorax