SRL Archive - SRL Archives

FixGraphics (InGame)


Naum

2010-03-06 15:08:24

The current one was not working due to the interface update, so I decided to merge some of Rasta's code with my one:

Const
BrightnessColor = 10132122;
ScrollColor = 2106924;
ArrowOptions = 16645886;
BlueText = 14790912;

{*******************************************************************************
Procedure FixGraphics;
By: Naum and Rasta Magician
Rev: 412
Date: 06 March 10
Description: Fixes the Graphic Options if LoggedIn
*******************************************************************************}

Procedure FixGraphics;
Var I, X, Y : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
TP : TPoint;
TB : TBox;

Begin
if (not LoggedIn) then exit;
CloseWindow;

if (not FindColor(x, y, ClBlack, 7, 460, 69, 474)) then //if you're in chat
if (not ClickContinue(True, True)) then
MFF(MMCX, MMCY, 2, 2);

i := 0; //failsafe opening clause
while (not FindTextTPA(ClWhite, 0, MSX1, MSY1, MSX2, MSY2, 'aphics', UpChars, Nothing)) and (LoggedIn) do
begin
GameTab(tab_Options);
MouseBox(605, 258, 623, 277, 1);
Wait(1000 + Random(500));
Inc(i);
if (i > 3) then
begin
srl_Warn('SetGraphics', 'Could not open Graphics Options screen', warn_Warning);
CloseWindow;
Exit;
end;
end;

If GetColor(238, 235) = BrightnessColor Then
Mouse(238, 235, 2, 2, True); //Sets brightness
Wait(1000 + Random(400)); //waits for it

If GetColor(501, 305) = ScrollColor Then
Mouse(501, 305, 8, 8, True); //scrolls to the bottom menu

FindColors(TPA, ArrowOptions, MSX1, MSY1, MSX2, MSY2); //finds drop down arrows
ATPA := SplitTPA(TPA, 5); //gets individual arrows
SortATPAFromFirstPoint(ATPA, Point(197, 89)); //sorts them

For I := 0 To High(ATPA) Do
Begin
If GetColor(501, 305) = ScrollColor Then
Mouse(501, 305, 8, 8, True); //scrolls the menu down (annoying)

TP := MiddleTPA(ATPA[I]);
TB := IntToBox(TP.X - 60, TP.Y - 5, TP.X + 2, TP.Y + 5);
If (CountColor(BlueText, TB.X1, TB.Y1, TB.X2, TB.Y2) > 5) Then //if its not optimum
Begin
Mouse(TP.X, TP.Y, 3, 3, True);
If (CountColor(ClWhite, TB.X1, TB.Y1 + 20, TB.X2, TB.Y2 + 15) > 5) Then //clicks the correct one
Begin
MouseBox(TB.X1, TB.Y1 + 20, TB.X2 - 15, TB.Y2 + 15, 1);
Wait(900 + Random(100));
End;
End;
End;
CloseWindow;
End;

I have tested and it seems to work fine for me.
Please test and Enjoy!

JPHamlett

2010-03-07 14:01:08

works good just add x, y varibles and it works great


also it always clicks the scroll bar afer every change

Naum

2010-03-07 14:04:37

From: J_Pizzle
works good just add x, y varibles and it works great


also it always clicks the scroll bar afer every change


Add the variables, lol. Thanks.

It has to click the scroll bars because when you change a setting it moves it back up to the top. This is indeed very annoying, but I'll leave runescape users to complain and sort it out.