SRL Archive - Help and Support

Why isn't my function working??


JAD

2007-06-06 00:47:39


program New;
{.include SRL/SRL.scar}

{*****************************************************
function SetOption(What, ToWhat: Integer): Boolean;
By: JAD
Description: Sets option in the options tab (tab 11).
Set "What" to what row number you want, up to down.
Set "ToWhat" how far over you want, Left to right.
Example: SetOption(1,4) would set the first column
(Brightness) to four over (highest)...etc.
*****************************************************}
function SetOption(What, ToWhat: Integer): Boolean;
var Jx,Jy, Gx,Gy: Integer;
begin
if(not(LoggedIn))then
Exit;
GameTab(11);
case What of
1: begin
case ToWhat of
1: begin
Gx := 619;
Gy := 229;
Jx := 617;
Jy := 229;
end;

2: begin
Gx := 651;
Gy := 231;
Jx := 648;
Jy := 229;
end;

3: begin
Gx := 681;
Gy := 230;
Jx := 680;
Jy := 229;
end;

4: begin
Gx := 714;
Gy := 230;
Jx := 714;
Jy := 229;
end;
end;
end;

2: begin //Music
case ToWhat of
1: begin
Gx := 616;
Gy := 267;
Jx := 614;
Jy := 266;
end;

2: begin
Gx := 640;
Gy := 267;
Jx := 638;
Jy := 265;
end;

3: begin
Gx := 667;
Gy := 267;
Jx := 666;
Jy := 266;
end;

4: begin
Gx := 692;
Gy := 267;
Jx := 692;
Jy := 265;
end;

5: begin
Gx := 718;
Gy := 268;
Jx := 718;
Jy := 266;
end;
end;
end;

3: begin //Sound effects
case ToWhat of
1: begin
Gx := 615;
Gy := 303;
Jx := 614;
Jy := 302;
end;

2: begin
Gx := 640;
Gy := 304;
Jx := 638;
Jy := 302;
end;

3: begin
Gx := 666;
Gy := 303;
Jx := 666;
Jy := 302;
end;

4: begin
Gx := 693;
Gy := 302;
Jx := 692;
Jy := 302;
end;

5: begin
Gx := 717;
Gy := 303;
Jx := 718;
Jy := 302;
end;

end;
end;

4: begin
case ToWhat of //Area Sound
1: begin
Gx := 615;
Gy := 339;
Jx := 615;
Jy := 339;
end;

2: begin
Gx := 639;
Gy := 339;
Jx := 639;
Jy := 339;
end;

3: begin
Gx := 666;
Gy := 340;
Jx := 666;
Jy := 339;
end;

4: begin
Gx := 692;
Gy := 340;
Jx := 692;
Jy := 339;
end;

5: begin
Gx := 718;
Gy := 340;
Jx := 717;
Jy := 339;
end;
end;
end;
end;
ClearDebug;
if(FindColorTolerance(x,y,9981222,Gx-5,Gy-5,Gx+4,Gy+3,5))then
begin
Result := True;
Writeln('Option was already set to what you wanted');
Exit;
end;
if(not(LoggedIn))then
Exit;
Mouse(Jx,Jy,3,3,true);
Result := True;
wait(150+random(150));
end;


begin
SetupSRL;
ActivateClient;
wait(1000+random(500));
SetOption(0,3);
end.

Whenever I try to run that, it just moves the mouse to the top left corner of the client.. I had Writeln's in there to see things, and I found out that it is resulting true, it is picking the right coordinates for everything, but Mouse just isn't working??

Can anybody help?

Thanks.

n3ss3s

2007-06-06 04:52:44

I often got that too but im not sure what it is about…

JAD

2007-06-06 09:42:11

From: n3ss3s
I often got that too but im not sure what it is about…


It worked when I didn't use a case for the coords… Very strange.

Pentti

2007-06-06 10:13:39

SetOption(0,3);
Maybe becasue you don't have number 0 there…

JAD

2007-06-06 10:16:31

From: Pentti
SetOption(0,3);
Maybe becasue you don't have number 0 there…


Lol.. I know :p I figured that out about a hour ago. Thanks anyways though :p

Pentti

2007-06-06 10:25:31

Today, 05:16 PM
From: JAD
Today, 04:42 PM:
From: JAD
It worked when I didn't use a case for the coords… Very strange.

Lol.. I know :p I figured that out about a hour ago. Thanks anyways though :p

Oh ok. Ye, you sure figured it out an hour ago.

JAD

2007-06-06 11:08:28

From: Pentti
Today, 05:16 PM
Oh ok. Ye, you sure figured it out an hour ago.


LOL! I actually knew you'd say that.. :p But I seriously did. I'd admit to it if I didn't.