SRL Archive - SRL Archives

My first very useful function! SetOption(What, ToWhat:Integer): Boolean;


JAD

2007-05-31 20:40:52

Edit: Made it over 100 lines shorter! :p


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;
if(FindColor(x,y,9584920,Gx-5,Gy-5,Gx+4,Gy+3))then
begin
Result := True;
Writeln('Option was already set to what you wanted');
Exit;
end;
if(LoggedIn)then
Mouse(Jx,Jy,3,3,true) else
Exit;
Result := True;
wait(150+random(150));
end;

begin
SetupSRL;
ActivateClient;
wait(500+random(500));
SetOption(1,4);
end.

Enjoy! And so you know, in the main loop as I had it set, it would set brightness to highest (first row upward, 4 over).

shaunthasheep

2007-05-31 21:23:22

im sure u can make it shorter =S

JAD

2007-05-31 23:15:02

From: The_Rs_Monkey
im sure u can make it shorter =S


I could if I made a seperate function… :p

Ashur2Good

2007-06-01 08:18:42

Nice one JAD XD. I think you have all the tabs covered :P Maybe make one big procedure with all of them in it? :)



-Ashur:stirthepot:

JAD

2007-06-01 11:19:00

From: ashur2good
Nice one JAD XD. I think you have all the tabs covered :P Maybe make one big procedure with all of them in it? :)



-Ashur:stirthepot:


:p I'm going to have one to hover a magic skill when I get out of school.. Because I've done that quite a few times while playing in game :p

This one is by far the most useful though I'd think, because you do want to always make sure brightness is at least the highest, then I just have other options in there.

R0b0t1

2007-06-01 15:57:51

Oh, like in a setup player proc or somthing? Instead of telling users to set it VB, you can do it!

shaunthasheep

2007-06-01 16:03:19

From: JAD
I could if I made a seperate function… :p


or had 3 variables, x, y, and color, used the case statements to assign the right numbers then do the checking

eg


case blah of
1: case blah of
1:begin x := 23; y := 242; color := 23; end;
end;
end;

if Getcolor(x, y) = color then
Writeln('already set')
else
Mouse(x, y, 0, 0, True);
end if
tada?

JAD

2007-06-01 17:00:56

From: The_Rs_Monkey
or had 3 variables, x, y, and color, used the case statements to assign the right numbers then do the checking

eg


case blah of
1: case blah of
1:begin x := 23; y := 242; color := 23; end;
end;
end;

if Getcolor(x, y) = color then
Writeln('already set')
else
Mouse(x, y, 0, 0, True);
end if
tada?


Yeah.. I know :p I did that in my other functions. I may switch this to do that too, thanks.

n3ss3s

2007-06-05 14:08:37

I'm going to have one to hover a magic skill

Im sorry, but I was just thinking what to script and you gave me an idea :)

JAD

2007-06-05 18:35:21

From: n3ss3s
Im sorry, but I was just thinking what to script and you gave me an idea :)


….. Wow! I didn't know I couldn't trust any SRL member with an idea of mine. Thought people were better then to try to steal my ideas..