Here we go, i just made a function to set audio options (modified bank procedure and modified old audio bar procedure)
function AudioMenu : boolean; //basically a copy of bankscreen?
begin
if FindColor(x, y, 2070753, 187, 35, 302, 67) then
begin
writeln(inttostr(x) + ' ' + inttostr(y));
Result := IsTextAtEx(x - 3, y - 2 , 'Audio', 0, upchars, True, False, 0, 0,
2070753)
end else if FindColorTolerance(x, y, 2070753, 187, 35, 302, 67, 30) then
begin
writeln(inttostr(x) + ' ' + inttostr(y));
Result := IsTextAtEx(x - 3, y - 2 , 'Audio', 30, upchars, True, False, 0, 0,
GetColor(x, y));
end;
end;
function OpenAudioMenu : Boolean; //entirely new
var
M : integer;
begin
if (not LoggedIn) then Exit;
if AudioMenu then
begin
result := true;
Exit;
end;
GameTab(11);
Wait(100 +Random(50));
Mouse(640, 248, 10, 10, true);
MarkTime(M);
repeat
wait(50);
if AudioMenu then
begin
result := true;
exit;
end;
until (TimeFromMark(M) > 5000)
Writeln('Could not open Audio Menu');
result := false;
end;
procedure SetAudioBar(Bar: String; Point: Integer; Mono : Boolean); //modification of the old one
var
P: TPoint;
x, y: integer;
begin
if (not LoggedIn) then Exit;
if (Point < 0) or (Point > 4) then Exit;
GameTab(11);
Wait(100 +Random(50));
if not OpenAudioMenu then Exit;
if Mono then
begin
if not FindColorTolerance(x, y, 181, 238 -6, 268 -6, 238 +6, 268 +6, 10) then
Mouse(238, 268, 3, 3, True);
end else
if not FindColorTolerance(x, y, 181, 305 -6, 268 -6, 305 +6, 268 +6, 10) then
Mouse(305, 268, 3, 3, True);
case LowerCase(Bar) of
'volume': P := IntToPoint(202 + (Point * 26) , 121);
'effect': P := IntToPoint(202 + (Point * 26) , 177);
'area': P := IntToPoint(202 + (Point * 26) , 236);
else WriteLn('ERROR: Unknown bar!');
end;
if not FindColorTolerance(x, y, 10172937, P.x -6, P.y -6, P.x +6, P.y +6, 10) then
Mouse(P.x, P.y, 3, 3, True);
end;
properly tagged ones here
{*******************************************************************************
function AudioMenu: Boolean;
by: SRL Dev Team, Modified by: Metagen
Description: Finds AudioMenu. Returns true if Found.
*******************************************************************************}
function AudioMenu : boolean;
begin
if FindColor(x, y, 2070753, 187, 35, 302, 67) then
begin
writeln(inttostr(x) + ' ' + inttostr(y));
Result := IsTextAtEx(x - 3, y - 2 , 'Audio', 0, upchars, True, False, 0, 0,
2070753)
end else if FindColorTolerance(x, y, 2070753, 187, 35, 302, 67, 30) then
begin
writeln(inttostr(x) + ' ' + inttostr(y));
Result := IsTextAtEx(x - 3, y - 2 , 'Audio', 30, upchars, True, False, 0, 0,
GetColor(x, y));
end;
end;
{*******************************************************************************
function OpenAudeioMenu : Boolean;
by: Metagen
Description: Opens Audio Options. Returns true if opened.
*******************************************************************************}
function OpenAudioMenu : Boolean;
var
M : integer;
begin
if (not LoggedIn) then Exit;
if AudioMenu then
begin
result := true;
Exit;
end;
GameTab(11);
Wait(100 +Random(50));
Mouse(640, 248, 10, 10, true);
MarkTime(M);
repeat
wait(50);
if AudioMenu then
begin
result := true;
exit;
end;
until (TimeFromMark(M) > 5000)
Writeln('Could not open Audio Menu');
result := false;
end;
{*******************************************************************************
procedure SetAudioBar(Bar: String; Point: Integer; Mono : Boolean);
By: Nielsie95, Modified by: Metagen
Description: Set the value of a bar and mono in the Audio Options Screen.
Valid argumentsfor bar are:
* Volume
* Effect
* Area
Point Range: 1 - 4
*******************************************************************************}
procedure SetAudioBar(Bar: String; Point: Integer; Mono : Boolean);
var
P: TPoint;
x, y: integer;
begin
if (not LoggedIn) then Exit;
if (Point < 0) or (Point > 4) then Exit;
GameTab(11);
Wait(100 +Random(50));
if not OpenAudioMenu then Exit;
if Mono then
begin
if not FindColorTolerance(x, y, 181, 238 -6, 268 -6, 238 +6, 268 +6, 10) then
Mouse(238, 268, 3, 3, True);
end else
if not FindColorTolerance(x, y, 181, 305 -6, 268 -6, 305 +6, 268 +6, 10) then
Mouse(305, 268, 3, 3, True);
case LowerCase(Bar) of
'volume': P := IntToPoint(202 + (Point * 26) , 121);
'effect': P := IntToPoint(202 + (Point * 26) , 177);
'area': P := IntToPoint(202 + (Point * 26) , 236);
else WriteLn('ERROR: Unknown bar!');
end;
if not FindColorTolerance(x, y, 10172937, P.x -6, P.y -6, P.x +6, P.y +6, 10) then
Mouse(P.x, P.y, 3, 3, True);
end;