SRL Archive - Help and Support

Colour help (Very little needed)


Aidan

2007-04-01 09:15:25

Hello thank you very much for opening this thread :D
Ok ill go straight to the point, I want to get the colour of a given x,y! I am using:
getcolor(x,y)
My problem is i want to use it like this

Procedure GetColourOfSomething;
begin
x:=50;
y:=50;
repeat
x:=x+1;
until(getcolor(x,y)=7777777);
mouse(x,y,5,5,true);
end;
The only problem is that runescape changes the colours so id need to have a tolerance on the 7777777 I would like to know how! Please could you tell me :D
Thank you very much in advanced,
Aidan!

Starblaster100

2007-04-01 09:22:51

FindColorSpiralTolerance(ix, iy, Colour_here, x, y, x+1, y+1, Tol)

is the only way i can think of

Aidan

2007-04-01 09:30:04

Yes but that wouldnt work because this is what am using it for:
theirs two shops next to each other one with a general store symbol and anouther with anouther symbol. What i want it to do is find the x,y of the DTM and keep adding 1 to the x untill it find the green (grass) so that it then clicks outside of the shop and on the grass :D

Starblaster100

2007-04-01 09:36:42

[php]
Procedure ClickGrass;
Var
ix, iy: Integer;
begin
If(FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2))then //If we find the DTM, then start the procedure.
begin
Repeat
x := x + 1; //Keep adding 1 to x
If(FindColorSpiralTolerance(ix, iy, ColorOFGrass, x, y-1, x+1, y+1))then //If we find the grass color (with added tol) then break out of the loop
Break;
until (x > MMX2) //If we go too far off screen, then break out as a safety measure
If (ix <> 0) and (iy <> 0) then //If we did find the grass, then click
begin
Mouse(ix, iy, 2, 2, True);
Flag;
end else
Writeln('Grass Not Found!'); //If we didn't find grass then show error message.
end;
end;
[/php]

Something like that?

P.S I dont have SCAR right now, so you may have to fix a few syntax errors etc.

Aidan

2007-04-01 09:39:40

Thanx you very much i shall test it :D