SRL Archive - RS3 Outdated / Broken Scripts

Yew Cutter NEED Procedures


JuKKa

2007-03-26 09:55:53

[LEFT]anyones got a yew chopping function, i cant get mine to work fully 100%.
it will be for my edge yew cutter i have the walking done 100%. also autocolor.
Then i just need one procedure more i need a function or procedure that will click a symbol in the NORTH and South if anyone haves one..

[/LEFT]

EDIT: i got them all thanks

nielsie95

2007-03-26 11:18:28

This is the new procedure I will use in my next version of my Yew Retriever :) :

function FindYew(var x, y: integer): Boolean;
var
Points: TPointArray;
I, Ci, Tol: Integer;
begin
repeat
if FindMSColorTol(x, y, 598048, Tol) then Break else Tol := Tol +2
until Tol > 15
if Tol > 15 then
begin
Result := False;
exit;
Tol := 0
end else
begin
FindColorsSpiralTolerance(MSCX, MSCY, Points, 598048, MSX1 + 50, MSY1 + 30, MSX2 - 50, MSY2 - 50, tol)
ci := 0;
for I := 1 to GetArrayLength(Points) - 1 do
begin
if (Distance(Points[ci].x, 0, Points[i].x, 0) >= 2) and
(Distance(0, Points[ci].y, 0, Points[i].y) >= 2) then
ci := I
else
begin
Points[I].x := 0;
Points[I].y := 0;
end;
end;
for i := 0 to GetArrayLength(Points) - 1 do
begin
if (Points[i].x <> 0) then
if FindColorTolerance(x, y, 2373688, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
if FindColorTolerance(x, y, 4159600, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
if FindColorTolerance(x, y, 2900024, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
begin
//TempColor := GetColor(Points[i].x, Points[i].y); This is 1 thing i use to see if the Yew is gone.. Don't know if you gonne use it..
MMouse(Points[i].x, Points[i].y, 0, 0)
Wait(50);
if (IsUpText('Yew')) then
begin
WriteLn('Yew found at a Tol of ' +IntToStr(Tol));
Result := True;
Break;
end;
end;
end;
if (Result) then
begin
x := Points[i].x;
y := Points[i].y;
//TreeX := x; Also an extra failsafe, don't know if you wanna use it
//TreeY := y; Same as above..
end;
end;
Tol := 0;
end;

If you use this, plz credit me..

JuKKa

2007-03-26 12:31:17

thank you very much, ill add big credits to joo!

Ejjman

2007-03-26 12:36:47

From: nielsie95
This is the new procedure I will use in my next version of my Yew Retriever :) :

function FindYew(var x, y: integer): Boolean;
var
Points: TPointArray;
I, Ci, Tol: Integer;
begin
repeat
if FindMSColorTol(x, y, 598048, Tol) then Break else Tol := Tol +2
until Tol > 15
if Tol > 15 then
begin
Result := False;
exit;
Tol := 0
end else
begin
FindColorsSpiralTolerance(MSCX, MSCY, Points, 598048, MSX1 + 50, MSY1 + 30, MSX2 - 50, MSY2 - 50, tol)
ci := 0;
for I := 1 to GetArrayLength(Points) - 1 do
begin
if (Distance(Points[ci].x, 0, Points[i].x, 0) >= 2) and
(Distance(0, Points[ci].y, 0, Points[i].y) >= 2) then
ci := I
else
begin
Points[I].x := 0;
Points[I].y := 0;
end;
end;
for i := 0 to GetArrayLength(Points) - 1 do
begin
if (Points[i].x <> 0) then
if FindColorTolerance(x, y, 2373688, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
if FindColorTolerance(x, y, 4159600, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
if FindColorTolerance(x, y, 2900024, Points[i].x -5, Points[i].y -5, Points[i].x +5, Points[i].y +5, 5 +Tol) then
begin
//TempColor := GetColor(Points[i].x, Points[i].y); This is 1 thing i use to see if the Yew is gone.. Don't know if you gonne use it..
MMouse(Points[i].x, Points[i].y, 0, 0)
Wait(50);
if (IsUpText('Yew')) then
begin
WriteLn('Yew found at a Tol of ' +IntToStr(Tol));
Result := True;
Break;
end;
end;
end;
if (Result) then
begin
x := Points[i].x;
y := Points[i].y;
//TreeX := x; Also an extra failsafe, don't know if you wanna use it
//TreeY := y; Same as above..
end;
end;
Tol := 0;
end;

If you use this, plz credit me..


Thats a good function for a non-srl member :)

nielsie95

2007-03-26 12:42:31

Thank you Ejj :)