SRL Archive - General

Something is wrong


Zeta Matt

2012-10-19 17:17:58

program new;
{$i srl/srl.simba}

Procedure Detection;
var
x, y:integer;
begin
if findcolortolerance(x, y, 16711680, 594, 767, 1081, 782, 1) then
writeLn('Someone is talking to you!');
playsound('C:\Simba\alarm.wav');
wait(2000);
StopSound;
wait(5000);
end;



begin
SetupSRL
repeat
Detection
until(false);
end.

Note that it's working on another client, I changed the client to full screen, and minimized all screens but the one I want to be checked.

It is playing sound everytime, even if I change the coordinates to (1,1) and (2,2). I just want it to playsound when it find the colors of the blue letters on runescape's chatbox. Can someone help me please?

Footy

2012-10-19 17:21:29

An if then will check the condition, and if its true, it will run the next line of code. After that, everything else will run through. To fix that, add a begin after your if..then statement, then all the stuff you want to happen if the statement is true, then an end;.

program new;
{$i srl/srl.simba}

Procedure Detection;
var
x, y:integer;
begin
if findcolortolerance(x, y, 16711680, 594, 767, 1081, 782, 1) then
begin
writeLn('Someone is talking to you!');
playsound('C:\Simba\alarm.wav');
wait(2000);
StopSound;
wait(5000);
end;
end;



begin
SetupSRL
repeat
Detection
until(false);
end.

Zeta Matt

2012-10-19 17:39:31

Working flawless now, thank you very much!