SRL Archive - Help

How to make SIMBA do a task when it can't recognize a color


Daher

2012-08-20 06:56:24

How can i make SIMBA do a task when it can't recognize the color

maybe?

var
A:Integer
B:Integer

const
GOLDC = 1816341; // Goldcharms color

begin
repeat;
if findcolor(A,B,4143674,790,301,983,550)then
clickmouse(A,B,0,0,mouse_left);
until(false);
end.

begin
ClickMouse(790,549,391,493,mouse_left) // This is the task it should do if it can't find the color ?,
end;
So basically i have the main task loop, but if it can't find it then it'll go to the clickmouse one


Please give me the syntax what i did at up, is just a example….

P1ng

2012-08-20 06:59:21

This would work, but I recommend using the SRL include and checking out Mouse, MMouse and ClickMouse2 if this is for runescape. Also, tolerance is likely to be needed because the colours in RS change a fair bit.
var
A:Integer
B:Integer

const
GOLDC = 1816341; // Goldcharms color

begin
repeat;
if findcolor(A,B,4143674,790,301,983,550)then
clickmouse(A,B,0,0,mouse_left) else
ClickMouse(790,549,391,493,mouse_left);
until(false);
end.

riwu

2012-08-20 06:59:50

if findcolor(A,B,4143674,790,301,983,550)then
clickmouse(A,B,0,0,mouse_left)
else
ClickMouse(790,549,391,493,mouse_left);

Daher

2012-08-20 07:00:53

From: riwu
if findcolor(A,B,4143674,790,301,983,550)then
clickmouse(A,B,0,0,mouse_left)
else
ClickMouse(790,549,391,493,mouse_left);


So the syntax is else ?

Daher

2012-08-20 07:01:54

From: P1ng
This would work, but I recommend using the SRL include and checking out Mouse, MMouse and ClickMouse2 if this is for runescape. Also, tolerance is likely to be needed because the colours in RS change a fair bit.
var
A:Integer
B:Integer

const
GOLDC = 1816341; // Goldcharms color

begin
repeat;
if findcolor(A,B,4143674,790,301,983,550)then
clickmouse(A,B,0,0,mouse_left) else
ClickMouse(790,549,391,493,mouse_left);
until(false);
end.


It's for private servers.

P1ng

2012-08-20 07:06:40

Then that code should work perfectly fine

Daher

2012-08-20 10:02:05

Thanks p1ng, great member :)