SRL Archive - SRL Archives

My FixGraphics();


Naum

2009-09-06 13:51:57

Hey,

The function that Rasta made, only works when the person is logged in. However, using some TPA stuff and co-ord manipulation I made one which works for both: loggedin and loggedout.

As before, its not versatile, but gets the needed job done :)

To test it, Open up the 'Graphics properties' either loggedin or loggedout, mess with the options and click run. It should set everything to 'Autoing Defaults' :p.

I've been fiddling with this function for a few days, which explains my absence from the SVN.


Procedure FixGraphicss;
Var X, Y, F : Integer; //Variables!
TPA : TPointArray;
ATPA : T2DPointArray;
TB : TBox;
Label Animations;

Begin
If FindTextTPAEx(2070783, 1, 0, 0, 758, 498, x, y, 'tanda', StatChars, Nothing) Then
Begin // ^ Checks for Orange text of 'Standard Detail'
MouseBox(x, y - 35, x + 50, y, 1); // If it finds it then it clicks on it, to activate it
Wait(1300 + Random(800)); // Waits while it sets itself.
End;

If FindTextTPAEx(2070783, 1, 0, 0, 758, 498, x, y, 'ixe', StatChars, Nothing) Then
Begin // Checks for the 'Fixed Size' text, in Orange
MouseBox(x - 14, y - 40, x + 30, y, 1);// If it finds it then it clicks on it, to activate it
Wait(500 + Random(800)); // Waits while it sets itself.
End;

If GetColor(232 + (127 * Integer(Not LoggedIn)), 215 + (103 * Integer(Not LoggedIn))) = 14474979 Then
Begin //This sets the Brightness
Mouse(232 + (127 * Integer(Not LoggedIn)), 215 + (103 * Integer(Not LoggedIn)), 5, 5, True);
Wait(900 + Random(700));
End;

If FindTextTPAEx(2070783, 1, 0, 0, 758, 498, x, y, 'x', StatChars, Nothing) Then //Finds the orange 'x'
If Not FindText(x, y, '0x6', StatChars, x - 50, y - 50, x + 50, y + 50) Then //Finds the text around it
Begin
Mouse(x, y, 30, 10, True); //Sets it at 800x600
Wait(200 + Random(200)); //Waits.
Mouse(x, y + 15, 1, 4, True);
End;

If FindText(x, y, 'Ad', UpChars, 0, 0, 758, 498) Then //Finds the Advanced Settings text
TB := IntToBox(x, y - 50, x + 520, y + 150); //Makes boundaries for FindColors, hence its global

FindColorsTolerance(TPA, 3753553, TB.x1, TB.y1, TB.x2, TB.y2, 0); //Finds Occurances of the Background 'Box color'
ATPA := TPAToATPAEx(TPA, 13, 13); //Splits then into squares of 13x13
SortATPAFromFirstPoint(ATPA, Point(197, 89)); //Sorts them
For F := 0 To High(ATPA) Do //This loop will now set it.
Begin
TB := GetTPABounds(ATPA[F]); //Gets the boundaries of the box
If FindText(x, y, 'any', StatChars, TB.x1 - 65, TB.y1 - 4, TB.x2 + 2, TB.y2 + 3) Then
GoTo Animations; //^ since animations have 3 options, if the given TPA is the option then it will skip the check.

If CountColor(2070783, TB.x1, TB.y1, TB.x2, TB.y2) >= 5 Then //To filter the text from arrows.
If CountColor(2070783, TB.x1 - 45, TB.y1, TB.x1 + 3, TB.y1 + 3) = 0 Then //To check the option isn't already set
Begin
Animations :
MouseBox(TB.x1 - 45, TB.y1, TB.x2, TB.y2, 1); //Clicks on one of the options
Wait(800 + Random(200)); //Waits.
If FindColor(x, y, 2070783, TB.x1 - 55, TB.y1 + 11, TB.x1 - 6, TB.y2 + 7) Then //Finds the orange color in the pop-up
Mouse(x, y, 20, 8, True); //Randomly clicks it
Begin
Wait(50 + Random(80)); //Waits
MMouse(x, y - 10, 6, 4); //Moves mouse off the box, so it doesn't muck up the ATPA
Wait(900 + Random(180)); //Waits while it is being set.
End;
End;
End;
End;

EDIT: Please note: this does not open the interface, nor does it close it (although that should be easy to add).

Sir R. M8gic1an

2009-09-06 14:06:28

/me points to LogIn_FixGraphics ;)

~RM