Is there a command to click on a certain color? Thanks! :cartman:
Printable View
Is there a command to click on a certain color? Thanks! :cartman:
SCAR Code:FindColor(xvariable, yvariable, color);
Mouse(xvariable, yvariable, 4, 4, true);
heres a way, to like fish. old rsc code
Shows how to find a color, and clicks.Code:
repeat
x:=300
y:=200
findcolor(x,y,16578808,278,165,366,219)
MoveMouse(x,y);
Wait(200 + Random(300));
until(IsTextAt(6,26,'fish:'))
ClickMouse(x - 100,y,true);
Can be easy to convert to rs2
just look in your SRL folder and you can see all of the includes, which contain almost every function you will ever need...
and for normal scar functions you can look in the scar manual ;)
SCAR Code:procedure FindTheColor;
var x, y: Integer;
FindColor(x, y, <Color>, 0, 0, 500, 336);
Mouse(x, y, 1, 1, true);
Don't be scared, ille explain it all.
I hope you understand the 'procedure FindTheColor'...
And these vars arent as hard as they look:
FindColor : The name of the command that will find a color for you.
(x, y) : These are empty cordinates awaiting to be filled, this means that the cordinates will be stored, at the place of the color.
(0, 0, 500, 336) : I use these personally to find a color IN the RS applet, these cordinates are excactly between the most Upper-Left Corner if the RS applet, and the Lower-Right Corner. This Excludes the inventory.
Mouse : A command that will move the mouse and click on the given coordinates.
(x, y) : Here we are again, now, the cordinates stored in the (x, y) of FindColor, will be found IN the mouse command, so the mouse clicks Exactly
the given Color in FindColor.
(1, 1) : This means that WITH the (x, y) of FindColor, there will be added a random 1, wich makes not very much difference, but it can come in handy sometimes.
I hope you understand a little more of it now?
` - Floor66