SRL Archive - Research & Development Lounge

Audio Settings


Dusk412

2008-07-06 17:14:36

Edit: I made it more compact and got rid of the Open and Close functions and just put the code into the other functions. Tested and work nicely now.

// * procedure SetBar(Bar: String; Point: Integer);              // * by Dusk412
// * procedure MonoOrStereo(Choice: String); // * by Dusk412

{*******************************************************************************
procedure SetBar(Bar: String; Point: Integer);
By: Dusk412
Credits to Nielsie95 who created old procedure this is based off of
Description: Sets Sound Bar To Point
Valid arguments:
* music, volume
* effect, effects, sound effects
* area, area sounds
Point Range: 0 - 4 (0 is mute)
*******************************************************************************}

procedure SetBar(Bar: String; Point: Integer);
var
P: TPoint;
cx, cy: integer;
begin
if (not LoggedIn) then Exit;
if (Point < 0) or (Point > 4) then
begin
Writeln('ERROR: Invalid Point!');
Exit;
end;
GameTab(11);
Wait(200+random(100));
MMouse(642, 249, 10, 10);
Wait(50+random(50));
GetMousePos(cx, cy);
if (IsUpTextMultiCustom(['udio', 'etting'])) then Mouse(cx, cy, 0, 0, True);
Wait(200+random(100));
case LowerCase(Bar) of
'music', 'volume': P := IntToPoint(202 + (Point * 24) , 121);
'effect', 'effects', 'sound effects': P := IntToPoint(202 + (Point * 24) , 177);
'area', 'area sounds': P := IntToPoint(202 + (Point * 24) , 236);
else
begin
Writeln('ERROR: Invalid Bar!');
MMouse(328, 56, 5, 5);
Wait(50+random(50));
GetMousePos(cx, cy);
if (IsUpText('lose')) then Mouse(cx, cy, 0, 0, True);
Exit;
end;
end;
if not FindColorTolerance(cx, cy, 10172937, P.x -6, P.y -6, P.x +6, P.y +6, 10) then
Mouse(P.x, P.y, 3, 3, True);
Wait(200+random(100));
MMouse(328, 56, 5, 5);
Wait(50+random(50));
GetMousePos(cx, cy);
if (IsUpText('lose')) then Mouse(cx, cy, 0, 0, True);
end;

{*******************************************************************************
procedure MonoOrStereo(Choice: String);
By: Dusk412
Description: Sets Sound To Mono Or Stereo
Valid arguments:
* mono
* stereo
*******************************************************************************}

procedure MonoOrStereo(Choice: String);
var
P: TPoint;
cx, cy: Integer;
begin
if (not LoggedIn) then Exit;
GameTab(11);
Wait(200+random(100));
MMouse(642, 249, 10, 10);
Wait(50+random(50));
GetMousePos(cx, cy);
if (IsUpTextMultiCustom(['udio', 'etting'])) then Mouse(cx, cy, 0, 0, True);
Wait(200+random(100));
case (Lowercase(Choice)) of
'mono':
begin
P := IntToPoint(238, 268);
if not (FindColorTolerance(cx, cy, 181, 233, 263, 243, 273, 10)) then
Mouse(P.x, P.y, 3, 3, True);
end;
'stereo':
begin
P := IntToPoint(305, 268);
if not (FindColorTolerance(cx, cy, 181, 300, 243, 310, 273, 10)) then
Mouse(P.x, P.y, 3, 3, True);
end;
else Writeln('ERROR: Invalid Choice!');
end;
Wait(200+random(100));
MMouse(328, 56, 5, 5);
Wait(50+random(50));
GetMousePos(cx, cy);
if (IsUpText('lose')) then Mouse(cx, cy, 0, 0, True);
end;

Metagen

2008-07-07 11:29:43

:D i already made this

Dusk412

2008-07-09 00:53:52

Edited and fixed up if anyone cares lol.