Log in

View Full Version : Need help finding/clicking a color.



iridektm
02-13-2012, 09:11 PM
This is a small piece of my script, I need it to find the coordinates of that green plant thing on the stall, then click it basicly. thats all im stuck on. Right now it just moves the mouse to (0,0) for whatever reason. This isn't RS so i have to write all my own procedures mostly.


program Awesomestuff;
{$I SRL/SRL.simba}
var
a, r: integer;

Procedure Thieveit;
begin
if(FindColor(a, r, 1348368, MMX1, MMY1, MMX2, MMY2))then
wait(150);
Mouse(a, r,1,1,true);
end;
begin
SetupSRL;
ActivateClient;
Thieveit;
end.


http://i356.photobucket.com/albums/oo1/andyy367/huh2.pngThanks a ton - Andy.

JuKKa
02-13-2012, 09:13 PM
MMX1, MMY1, MMX2, MMY2

should be MS

then you can try changing findcolor to findcolortolerance.

iridektm
02-13-2012, 09:14 PM
On a private server? and when i change it to if(FindColor(a, r, 1816597, MS))then
it still just moves mouse to (0,0)

iridektm
02-13-2012, 09:34 PM
please help i really need this finished

Kasi
02-13-2012, 09:38 PM
if(FindColor(a, r, 1816597, MS))
should be

if(FindColor(a, r, 1348368, MSX1, MSY1, MSX2, MSY2))then

iridektm
02-13-2012, 09:45 PM
It doesnt work, im using that, It moves the mouse to (0,0) and just sits there

Harry
02-13-2012, 09:51 PM
You need begin/end after an if statement if you want it to do more than one thing. Chances are it's not returning the color for some reason (thus making x,y=0,0).

iridektm
02-13-2012, 10:11 PM
@Harry, I love you haha, ive been trying to get this answered for so long now, *Tucks first script under belt* thanks Man!