Naum
2009-12-12 07:24:53
When I put out my 'plea' for accounts I did not expect many to pick up. However, I was seriously wrong. The community responded with tremendous results :)! Thanks very much guys :D. In no particular order:
- IceFire908 - Thanks a lot for your support :D
- YoHoJo - Thanks a lot as well :)
- Zeph - being a pro, as usual
- Mormonman - Thanks for the account :)
- Brain - thanks alot for the account :)
- Zyt3x - thanks for the account, as well :D
- Simtoon - Veyr first person to help me with an account, so thanks
- Anyone I've left out thank-you soo much :D
- Wizzup - for some of the code I borrowed. And the old solver (which was 1337)
- Ray, Niels, Sum - For the help
In total I received 8 accounts and that's really fantastic! I can not thank everyone enough!
New:
Const
FullDebug = True; //Debug it all?
M_DefaultHeight = 62; //Molly's Height (Used in M_FindMS)
M_CrossColor = 2438909; //The crosshair color, should be fine..
M_CrossTol = 5; //The tolerance of the cross, should be fine..
Var
MollyColors : TIntegerArray; //Variables
M_TileWidth : Extended;
M_CrossPoint : TPoint;
BlondeMolly : Boolean;
Type
TMollyControl = Record //Molly record.
Direction : (_Up, Down, _Right, _Left);
Times : Byte;
End;
{*******************************************************************************
Function FindMollyDoor(DP : TPoint; SortBy : Integer) : Boolean;
by: Naum
Description: Opens the door in molly.
SortBy is which direction to sort it from (Left or Right)
Used in entering and exiting (included for one-click opening)
*******************************************************************************}
const
srl_Molly_DoorMin = 15;
srl_Molly_DoorMax = 1 shl 20;
srl_Molly_DoorW = 10;
srl_Molly_DoorH = 14;
srl_Molly_HeightF = 2.443;
function FindMollyDoor(Var DP : TPoint; SortBy : Integer) : Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
ii, h : Integer;
begin
If Not LoggedIn Then Exit;
{ To be replaced with global TAutoColorInfo array. }
SetColorspeed2Modifiers(0.21, 0.44);
FindColorsTolerance(TPA, 7838641, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAToATPAEx(TPA, srl_Molly_DoorW, srl_Molly_DoorH);
SortATPASize(ATPA, True);
SortATPAFromFirstPoint(ATPA, Point(MSCX + (SortBy * Round(M_DefaultHeight * srl_Molly_HeightF)), MSCY - 15));
h := High(ATPA);
for ii := 0 to h do
if MiddleTPAEx(ATPA[ii], DP.X, DP.Y) then
begin
if InRange(GetArrayLength(ATPA[II]),
srl_Molly_DoorMin,
srl_Molly_DoorMax) then
Begin
MMouse(DP.X, DP.Y, 4, 4);
Wait(300 + Random(400));
if WaitUpText('oor', srl_MaxWaitTime) then
begin
Result := True;
GetMousePos(DP.X, DP.Y);
Exit;
end;
end;
end;
SetColorspeed2Modifiers(0.2, 0.2);
end;
{*******************************************************************************
Function Molly_CrosshairPos(Var Cross : TPoint; Inn : TBox) : Boolean
by: Naum
Description: Finds the position of the crosshair in the TBox 'Inn'
*******************************************************************************}
Function Molly_CrosshairPos(Var Cross : TPoint; Inn : TBox) : Boolean;
Var TPA : TPointArray;
Begin //Finds cross colors
If Not LoggedIn Then Exit;
FindColorsTolerance(TPA, M_CrossColor, Inn.x1, Inn.y1, Inn.x2, Inn.y2, M_CrossTol)
If FullDebug Then
WriteLn('Length of Cross Count = '+IntToStr(Length(TPA)));
If Length(TPA) > 0 Then
Begin
Cross := MiddleTPA(TPA);
If FullDebug Then
WriteLn('Cross found at '+IntToStr(Cross.X)+', '+IntToStr(Cross.Y));
Result := True;
Exit;
End Else
If FullDebug Then
WriteLn('Cross not found');
End;
{*******************************************************************************
Procedure Molly_FindMS(Var Molly : TPoint);
by: Naum
Description: Finds the position of molly on the main screen
*******************************************************************************}
Procedure Molly_FindMS(Var Molly : TPoint);
Label Begining;
Var //
ATPA : T2DPointArray;
TPA : TPointArray;
I, II : Integer;
P : TPoint;
NotFound : Boolean;
AddOn : Integer;
Begin
If Not LoggedIn Then Exit;
Begining : I := 0;
SetLength(ATPA, Length(MollyColors)); //sets length the same as colors
For I := 0 To High(MollyColors) Do
FindColors(ATPA[I], MollyColors[I], MSX1, MSY1, MSX2, MSY2); //finds colors
TPA := MergeATPA(ATPA); //Merges all the seperate TPA's into one
ATPA := TPAToATPA(TPA, 20); //20 radius circles
For I := 0 To High(ATPA) Do
Begin
If FullDebug Then WriteLn('Found '+IntToStr(Length(ATPA))+' Similars.');
If Not InAbstractBox(400, 8, 503, 0, 514, 96, 500, 130, ATPA[I][0].X, ATPA[I][0].Y) Then //Removes problem points for l-brown
If GetArraylength(ATPA[I]) >= 3 Then //length check
Begin
P := MiddleTPA(ATPA[I]);
Begin
If FullDebug Then
WriteLn('Molly found at index '+IntToStr(I));
// \/ Mollys height
For II := 0 To 3 Do
If PointInBox(P, IntToBox(0, II * 30, 520, ((II + 1) * 30) + (Integer(II = 3)*10) )) Then
AddOn := M_DefaultHeight + ((II - 1) * (10 - II));
If AddOn = 52 Then
DecEx(AddOn, 6);
Molly := Point(P.x, P.y + AddOn);
If FullDebug Then
WriteLn('Molly found at '+IntToStr(Molly.X)+', '+IntToStr(Molly.Y));
If FullDebug Then
WriteLn('Mollys Height is : '+IntToStr(AddOn));
Exit;
End;
NotFound := (I >= 3);
If NotFound Then Break;
End;
End;
If NotFound Then
GoTo Begining;
End;
{*******************************************************************************
Function IsMollyOnDot(CP : TPoint) : Boolean;
by: Naum
Description: Results true if molly is standing on dot.
*******************************************************************************}
Function IsMollyOnDot(CP : TPoint) : Boolean;
Var MollysPosition : TPoint;
Begin
Molly_FindMS(MollysPosition); //If some of the points are inrange of mollys feet
Result := (PointInBox(MollysPosition, IntToBox(Cp.x - 6, Cp.y - 6, Cp.x + 6, Cp.y + 6)))
Or (InRange(iAbs(CP.X - MollysPosition.X), 0, 7) And InRange(iAbs(CP.Y - MollysPosition.Y), 0, 7));
End;
{*******************************************************************************
Function Molly_PtsToCtrl(Point1, Point2 : TPoint; Vertical : Boolean) : TMollyControl;
by: Naum
Description: Turns the two points (crosshair and molly) into directions.
*******************************************************************************}
Function Molly_PtsToCtrl(Point1, Point2 : TPoint; Vertical : Boolean) : TMollyControl;
Begin
Case Vertical Of //determines direction
True : If (Point1.y - Point2.y) < 0 Then
Result.Direction := _Up
Else
Result.Direction := Down;
//determines direction
False : If (Point1.x - Point2.x) > 0 Then
Result.Direction := _Left
Else
Result.Direction := _Right;
End;
M_TileWidth := 33.8; //default for sideways
If Result.Direction = Down Then M_TileWidth := 24.3; //greater width
If Result.Direction = _Up Then M_TileWidth := 17.9;
If FullDebug Then
WriteLn('Tile Width (perspective) is: '+FloatToStr(M_TileWidth));
Result.Times := Round(Distance(Point1.x, Point1.y, Point2.x, Point2.y) / M_TileWidth); //number of times to move
If FullDebug Then
If Vertical Then
WriteLn('This means that the crosshair must be moved '+IntToStr(Result.Times)+' Up/Down ')
Else
WriteLn('This means that the crosshair must be moved '+IntToStr(Result.Times)+' Left/Right ')
End;
{*******************************************************************************
Procedure Molly_Operate(Information : TMollyControl);
by: Naum and Wizzup
Description: Clicks a direction based on the input
*******************************************************************************}
Procedure Molly_Operate(Information : TMollyControl);
Var I : Byte;
Mark : Integer;
Begin
I := 0; //operating proc
Mark := GetSystemTime + 2800; //timeout to avoid spasms
Repeat
If FindBlackChatMessage('win') Or FindBlackChatMessage('Evil') Or ClickContinue(False, False) Then
Exit;
If Information.Times = 0 Then
Exit;
If IsMollyOnDot(M_CrossPoint) Or (M_CrossPoint.X = 0) Then
Exit;
Case Information.Direction Of //co-ords taken from wizzups
_Up : Mouse(RandomRange(630, 650), RandomRange(260, 275), 0, 0, True); // Up
Down : Mouse(RandomRange(627, 655), RandomRange(383, 411), 0, 0, True); // Down
_Right : Mouse(RandomRange(705, 720), RandomRange(315, 340), 0, 0, True); // Right
_Left : Mouse(RandomRange(563, 583), RandomRange(323, 341), 0, 0, True); // Left
End;
Inc(I);
Until(I >= Information.Times) Or (Mark < GetSystemTime);
End;
{*******************************************************************************
Procedure Molly_MoveCrossTo;
by: Naum
Description: Moves the crosshair to molly
*******************************************************************************}
Procedure Molly_MoveCrossTo;
Var MollyP: TPoint;
Point3 : TPoint;
Begin // gets pos of crosshair
If Not LoggedIn Then Exit;
Molly_CrosshairPos(M_CrossPoint, IntToBox(MSX1, MSY1, 515, 200));
If Not IsMollyOnDot(M_CrossPoint) Then
Begin
Molly_FindMS(MollyP); //finds molly
Point3 := Point(MollyP.x, M_CrossPoint.y); //completes the r-a triangle
Molly_Operate(Molly_PtsToCtrl(M_CrossPoint, Point3, False)); //proc
Molly_Operate(Molly_PtsToCtrl(MollyP, Point3, True)); //proc
Wait(250 + Random(30));
End;
End;
Function BMolly : Boolean;
Var TempBMP, Rubbish : Integer;
Begin
TempBMP := BitmapFromString(11, 10, 'beNptjlEOgyAQRA+H7S0K6A27iBh' +
'7CgI1RtOmxot06hpqlOR9zbyFIT1Z8WqKtys+7WXu/iDhPNsCJLgF' +
'XC2PKzgIuB1IpPbsQBiN2LcHB19nheTwjFBrf1dZh2dASHhSwei9A' +
'8GTRPW0JdhMW0GLJAFm9K4EoVar+XuBzUi3aGT4AgMZzoo=');
Result := FindBitmapToleranceIn(TempBMP, Rubbish, Rubbish, 15, 377, 104, 470, 30);
FreeBitmap(TempBMP);
End;
{*******************************************************************************
Function SolveMolly : Boolean;
by: Wizzup and Naum
Description: Solves the Molly Random
*******************************************************************************}
Function SolveMolly : Boolean;
Label IfNot_CivilianCaught;
Var P : TPoint;
T, Tries, MolMark, I, TX, TY : Integer;
MCaught : Boolean;
CTS : Integer;
Begin
SetAngle(True);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
Players[CurrentPlayer].Rand := 'Molly';
MarkTime(MolMark);
If InConvo Then
MollyColors := GetColorsBox(41, 374, 84, 382, True); //GetColorsBox(42, 372, 60, 385, True); light brown
BlondeMolly := BMolly
If BlondeMolly Then
MollyColors := GetColorsBox(33, 414, 47, 428, True);
For I := 0 To Random(7) Do
ClickContinue(True, True);
SetRun(False);
If FindMollyDoor(P, 1) Then
Mouse(P.X, P.Y, 0, 0, True)
Else
Begin
WriteLn('Molly : Could NOT Open Door');
ColorToleranceSpeed(CTS);
Result := False;
Exit;
End;
Begin
I := 0;
Repeat
Wait(740 + Random(100));
Inc(I);
FindNPCChatText('now', ClickLeft);
ClickContinue(True, True);
Until(I >= 5 + Random(2));
End;
Wait(1);
Begin
If FindObjTPAMulti(P.x, P.y, [2379300, 4015557, 3697078, 5140596], 15, -1, 20,
20, 10, ['ontr', 'anel', 'se']) Then
Mouse(P.X, P.Y, 0, 0, True)
Else
Begin
WriteLn('Molly : Could NOT Find Machine');
ColorToleranceSpeed(CTS);
Result := False;
Exit;
End;
End;
I := 0;
While (I < 10) Do
Begin
Wait(1000 + Random(200));
Inc(I);
If GetColor(561, 221) = 6918288 Then
Break;
End;
If GetColor(561, 221) = 6918288 Then
Begin
If FindText(TX, TY, 'Tries', SmallChars, 555, 216, 600, 240) Then
Tries := StrToInt(GetNumbers(GetTextAtEx(TX, TY, 0, SmallChars,
False, False, 0, 1, 6918288, 50, False, tr_AllChars)));
If Tries = 0 Then
Tries := 2;
T := GetSystemTime + 120000; //2 minutes timeout.
IfNot_CivilianCaught :
While Not (MCaught) And (T > GetSystemTime) Do
Begin
If Not LoggedIn Then Exit;
Molly_MoveCrossTo;
Molly_CrosshairPos(P, IntToBox(MSX1, MSY1, 515, 200));
If IsMollyOnDot(P) Then
Begin
Mouse(700, 423, 10, 10, True);
Wait(1000 + Random(1000));
End;
If Tries = 0 Then
Begin
WriteLn('Tries are finished, we were not able to get the twin');
Exit;
End;
If FindBlackChatMessage('win') Or FindBlackChatMessage('Evil') Or ClickContinue(False, False) Then
Begin
WriteLn('We got the Twin.');
MCaught := True;
Break;
End;
If FindBlackChatMessage('cent') Or FindBlackChatMessage('illian') Then
Begin
WriteLn('We Caught a Civilian.');
Dec(Tries);
MCaught := False;
Break;
End;
If FindBlackChatMessage('target!') Or FindBlackChatMessage('upposed') Then
Begin
MCaught := False;
Break;
End;
Result := (GetSystemTime > T);
End;
If Not MCaught Then GoTo IfNot_CivilianCaught;
If GetSystemTime > T Then
Begin
Result := False;
WriteLn('Could NOT find Molly!');
ColorToleranceSpeed(CTS);
Players[CurrentPlayer].Loc := 'NoMolly';
Exit;
End;
If MCaught Then
Begin
WriteLn('Found Molly in ' +IntToStr(TimeFromMark(MolMark))+' msec!');
Wait(20000);
T := GetSystemTime;
While (GetSystemTime - T < 15000) Do
Begin
If Not ClickContinue(True, True) Then
Break;
Wait(1000);
End;
If Not FindMollyDoor(P, -1) Then
Begin
ColorToleranceSpeed(CTS);
Exit;
End;
Mouse(P.X, P.Y, 0, 0, True);
Wait(10000);
If FindObjTPAMulti(P.X, P.Y, MollyColors, 5, -1, 6, 8, 4,
['alk', 'olly']) Then
Mouse(P.X, P.Y, 0, 0, True);
Wait(5000);
T := GetSystemTime;
While (GetSystemTime - T < 15000) Do
Begin
If Not ClickContinue(True, True) Then
Break;
Wait(1000);
End;
Result := True;
If Result Then
Begin
WriteLn('Solved Molly Random Event.');
Wait(10000);
ColorToleranceSpeed(CTS);
End;
End;
End;
End;Old :
Const
FullDebug = True; //Debug it all?
M_DefaultHeight = 62; //Molly's Height (Used in M_FindMS)
M_CrossColor = 2438909; //The crosshair color, should be fine..
M_CrossTol = 5; //The tolerance of the cross, should be fine..
Var
MollyColors : TIntegerArray; //Variables
M_TileWidth : Extended;
M_CrossPoint : TPoint;
Type
TMollyControl = Record //Molly record.
Direction : (_Up, Down, _Right, _Left);
Times : Byte;
End;
{*******************************************************************************
Function FindMollyDoor(DP : TPoint) : Boolean;
by: Naum
Description: Opens the door in molly
*******************************************************************************}
Function FindMollyDoor(Var DP : TPoint) : Boolean;
Var
TPA : TPointArray;
ATPA : T2DPointArray;
II : Integer;
Begin
SetColorspeed2Modifiers(0.21, 0.44);
FindColorsTolerance(TPA, 7838641, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := SplitTPAEx(TPA, 10, 14);
SortATPASize(ATPA, True);
SortATPAFrom(ATPA, Point(MSCX + Round(M_DefaultHeight * 2.443), MSCY));
For II := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[II], DP.X, DP.Y) Then
Begin
If InRange(GetArrayLength(ATPA[II]), 15, 1 Shl 20) Then
Begin
MMouse(DP.X, DP.Y, 4, 4);
Wait(300 + Random(400));
If WaitUpText('oor', 360) Then
Begin
Result := True;
GetMousePos(DP.X, DP.Y);
Exit;
End;
End;
End;
SetColorspeed2Modifiers(0.2, 0.2);
End;
{*******************************************************************************
Function Molly_CrosshairPos(Var Cross : TPoint; Inn : TBox) : Boolean
by: Naum
Description: Finds the position of the crosshair in the TBox 'Inn'
*******************************************************************************}
Function Molly_CrosshairPos(Var Cross : TPoint; Inn : TBox) : Boolean;
Var TPA : TPointArray;
Begin //Finds cross colors
FindColorsTolerance(TPA, M_CrossColor, Inn.x1, Inn.y1, Inn.x2, Inn.y2, M_CrossTol)
If FullDebug Then
WriteLn('Length of Cross Count = '+IntToStr(Length(TPA)));
If Length(TPA) > 0 Then
Begin
Cross := MiddleTPA(TPA);
If FullDebug Then
WriteLn('Cross found at '+IntToStr(Cross.X)+', '+IntToStr(Cross.Y));
Result := True;
Exit;
End Else
If FullDebug Then
WriteLn('Cross not found');
End;
{*******************************************************************************
Procedure Molly_FindMS(Var Molly : TPoint);
by: Naum
Description: Finds the position of molly on the main screen
*******************************************************************************}
Procedure Molly_FindMS(Var Molly : TPoint);
Label Begining;
Var //
ATPA : T2DPointArray;
TPA : TPointArray;
I, II : Integer;
P : TPoint;
NotFound : Boolean;
AddOn : Integer;
Begin
Begining : I := 0;
SetLength(ATPA, Length(MollyColors)); //sets length the same as colors
For I := 0 To High(MollyColors) Do
FindColors(ATPA[I], MollyColors[I], MSX1, MSY1, MSX2, MSY2); //finds colors
TPA := MergeATPA(ATPA); //Merges all the seperate TPA's into one
ATPA := TPAToATPA(TPA, 20); //20 radius circles
For I := 0 To High(ATPA) Do
Begin
If FullDebug Then WriteLn('Found '+IntToStr(Length(ATPA))+' Similars.');
If Not InAbstractBox(400, 8, 503, 0, 514, 96, 500, 130, ATPA[I][0].X, ATPA[I][0].Y) Then //Removes problem points for l-brown
If GetArraylength(ATPA[I]) >= 3 Then //length check
Begin
P := MiddleTPA(ATPA[I]);
Begin
If FullDebug Then
WriteLn('Molly found at index '+IntToStr(I));
// \/ Mollys height
For II := 0 To 3 Do
If PointInBox(P, IntToBox(0, II * 30, 520, ((II + 1) * 30) + (Integer(II = 3)*10) )) Then
AddOn := M_DefaultHeight + ((II - 1) * (10 - II));
If AddOn = 52 Then
DecEx(AddOn, 6);
Molly := Point(P.x, P.y + AddOn);
If FullDebug Then
WriteLn('Molly found at '+IntToStr(Molly.X)+', '+IntToStr(Molly.Y));
If FullDebug Then
WriteLn('Mollys Height is : '+IntToStr(AddOn));
Exit;
End;
NotFound := (I >= 3);
If NotFound Then Break;
End;
End;
If NotFound Then
GoTo Begining;
End;
{*******************************************************************************
Function IsMollyOnDot(CP : TPoint) : Boolean;
by: Naum
Description: Results true if molly is standing on dot.
*******************************************************************************}
Function IsMollyOnDot(CP : TPoint) : Boolean;
Var MollysPosition : TPoint;
Begin
Molly_FindMS(MollysPosition); //If some of the points are inrange of mollys feet
Result := (PointInBox(MollysPosition, IntToBox(Cp.x - 6, Cp.y - 6, Cp.x + 6, Cp.y + 6)))
Or (InRange(iAbs(CP.X - MollysPosition.X), 0, 7) And InRange(iAbs(CP.Y - MollysPosition.Y), 0, 7));
End;
{*******************************************************************************
Function Molly_PtsToCtrl(Point1, Point2 : TPoint; Vertical : Boolean) : TMollyControl;
by: Naum
Description: Turns the two points (crosshair and molly) into directions.
*******************************************************************************}
Function Molly_PtsToCtrl(Point1, Point2 : TPoint; Vertical : Boolean) : TMollyControl;
Begin
Case Vertical Of //determines direction
True : If (Point1.y - Point2.y) < 0 Then
Result.Direction := _Up
Else
Result.Direction := Down;
//determines direction
False : If (Point1.x - Point2.x) > 0 Then
Result.Direction := _Left
Else
Result.Direction := _Right;
End;
M_TileWidth := 33.8; //default for sideways
If Result.Direction = Down Then M_TileWidth := 24.3; //greater width
If Result.Direction = _Up Then M_TileWidth := 17.9;
If FullDebug Then
WriteLn('Tile Width (perspective) is: '+FloatToStr(M_TileWidth));
Result.Times := Round(Distance(Point1.x, Point1.y, Point2.x, Point2.y) / M_TileWidth); //number of times to move
If FullDebug Then
If Vertical Then
WriteLn('This means that the crosshair must be moved '+IntToStr(Result.Times)+' Up/Down ')
Else
WriteLn('This means that the crosshair must be moved '+IntToStr(Result.Times)+' Left/Right ')
End;
{*******************************************************************************
Procedure Molly_Operate(Information : TMollyControl);
by: Naum and Wizzup
Description: Clicks a direction based on the input
*******************************************************************************}
Procedure Molly_Operate(Information : TMollyControl);
Var I : Byte;
Mark : Integer;
Begin
I := 0; //operating proc
Mark := GetSystemTime + 2800; //timeout to avoid spasms
Repeat
If FindBlackChatMessage('win') Or FindBlackChatMessage('Evil') Or ClickContinue(False, False) Then
Exit;
If Information.Times = 0 Then
Exit;
If IsMollyOnDot(M_CrossPoint) Or (M_CrossPoint.X = 0) Then
Exit;
Case Information.Direction Of //co-ords taken from wizzups
_Up : Mouse(RandomRange(630, 650), RandomRange(260, 275), 0, 0, True); // Up
Down : Mouse(RandomRange(627, 655), RandomRange(383, 411), 0, 0, True); // Down
_Right : Mouse(RandomRange(705, 720), RandomRange(315, 340), 0, 0, True); // Right
_Left : Mouse(RandomRange(563, 583), RandomRange(323, 341), 0, 0, True); // Left
End;
Inc(I);
Until(I >= Information.Times) Or (Mark < GetSystemTime);
End;
{*******************************************************************************
Procedure Molly_MoveCrossTo;
by: Naum
Description: Moves the crosshair to molly
*******************************************************************************}
Procedure Molly_MoveCrossTo;
Var MollyP: TPoint;
Point3 : TPoint;
Begin // gets pos of crosshair
Molly_CrosshairPos(M_CrossPoint, IntToBox(MSX1, MSY1, 515, 200));
If Not IsMollyOnDot(M_CrossPoint) Then
Begin
Molly_FindMS(MollyP); //finds molly
Point3 := Point(MollyP.x, M_CrossPoint.y); //completes the r-a triangle
Molly_Operate(Molly_PtsToCtrl(M_CrossPoint, Point3, False)); //proc
Molly_Operate(Molly_PtsToCtrl(MollyP, Point3, True)); //proc
Wait(250 + Random(30));
End;
End;
{*******************************************************************************
Function SolveMolly : Boolean;
by: Wizzup and Naum
Description: Solves the Molly Random
*******************************************************************************}
Function SolveMolly : Boolean;
Label IfNot_CivilianCaught;
Var P : TPoint;
T, Tries, MolMark, I, TX, TY : Integer;
MCaught : Boolean;
CTS : Integer;
Begin
SetAngle(True);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
Players[CurrentPlayer].Rand := 'Molly';
MarkTime(MolMark);
If InConvo Then
MollyColors := GetColorsBox(41, 374, 84, 382, True); //GetColorsBox(42, 372, 60, 385, True); light brown
For I := 0 To Random(7) Do
ClickContinue(True, True);
SetRun(False);
If FindMollyDoor(P) Then
Mouse(P.X, P.Y, 0, 0, True)
Else
Begin
WriteLn('Molly : Could NOT Open Door');
ColorToleranceSpeed(CTS);
Result := False;
Exit;
End;
Begin
I := 0;
Repeat
Wait(740 + Random(100));
Inc(I);
FindNPCChatText('now', ClickLeft);
ClickContinue(True, True);
Until(I >= 8 + Random(2));
End;
Wait(1);
Begin
If FindObjTPAMulti(P.x, P.y, [2379300, 4015557, 3697078, 5140596], 15, -1, 20,
20, 10, ['ontr', 'anel', 'se']) Then
Mouse(P.X, P.Y, 0, 0, True)
Else
Begin
WriteLn('Molly : Could NOT Find Machine');
ColorToleranceSpeed(CTS);
Result := False;
Exit;
End;
End;
I := 0;
While (I < 10) Do
Begin
Wait(1000 + Random(200));
Inc(I);
If GetColor(561, 221) = 6918288 Then
Break;
End;
If GetColor(561, 221) = 6918288 Then
Begin
If FindText(TX, TY, 'Tries', SmallChars, 555, 216, 600, 240) Then
Tries := StrToInt(GetNumbers(GetTextAtEx(TX, TY, 0, SmallChars,
False, False, 0, 1, 6918288, 50, False, tr_AllChars)));
If Tries = 0 Then
Tries := 2;
T := GetSystemTime + 120000; //2 minutes timeout.
IfNot_CivilianCaught :
While Not (MCaught) And (T > GetSystemTime) Do
Begin
Molly_MoveCrossTo;
Molly_CrosshairPos(P, IntToBox(MSX1, MSY1, 515, 200));
If IsMollyOnDot(P) Then
Begin
Mouse(700, 423, 10, 10, True);
Wait(1000 + Random(1000));
End;
If Tries = 0 Then
Begin
WriteLn('Tries are finished, we were not able to get the twin');
Exit;
End;
If FindBlackChatMessage('win') Or FindBlackChatMessage('Evil') Or ClickContinue(False, False) Then
Begin
WriteLn('We got the Twin.');
MCaught := True;
Break;
End;
If FindBlackChatMessage('cent') Or FindBlackChatMessage('illian') Then
Begin
WriteLn('We Caught a Civilian.');
Dec(Tries);
MCaught := False;
Break;
End;
If FindBlackChatMessage('target!') Or FindBlackChatMessage('upposed') Then
Begin
MCaught := False;
Break;
End;
Result := (GetSystemTime > T);
End;
If Not MCaught Then GoTo IfNot_CivilianCaught;
If GetSystemTime > T Then
Begin
Result := False;
WriteLn('Could NOT find Molly!');
ColorToleranceSpeed(CTS);
Players[CurrentPlayer].Loc := 'NoMolly';
Exit;
End;
If MCaught Then
Begin
WriteLn('Found Molly in ' +IntToStr(TimeFromMark(MolMark))+' msec!');
Wait(20000);
T := GetSystemTime;
While (GetSystemTime - T < 15000) Do
Begin
If Not ClickContinue(True, True) Then
Break;
Wait(1000);
End;
If Not FindMollyDoor(P) Then
Begin
ColorToleranceSpeed(CTS);
Exit;
End;
Mouse(P.X, P.Y, 0, 0, True);
Wait(10000);
If FindObjTPAMulti(P.X, P.Y, MollyColors, 5, -1, 6, 8, 4,
['alk', 'olly']) Then
Mouse(P.X, P.Y, 0, 0, True);
Wait(5000);
T := GetSystemTime;
While (GetSystemTime - T < 15000) Do
Begin
If Not ClickContinue(True, True) Then
Break;
Wait(1000);
End;
Result := True;
If Result Then
Begin
WriteLn('Solved Molly Random Event.');
Wait(10000);
ColorToleranceSpeed(CTS);
End;
End;
End;
End;^ That's it, I've tried to use as many constants as possible and tried to make as most efficient as I could.
Current Bugs
- Rarely, it might spaz off and do its own thing. Goes back on track though (this is because of the screen's tilt, however).
- Only been tested ''extensively'' with 3/5 hair colors
- Around about 90% 'ish' success rate
Since I like writing tutorials, I'll write a small one on how it works:
The Solver Theory
- The solver finds molly's hair colour and stores its middle tpa (co-ordinate) as 'MollyPoint'.
- The solver finds the crosshair on the ground and stores its middle tpa (co-ordinate) as 'CrossPoint'.
- The solver then makes a right angle triangle by using that information and making a third point 'Point3'. This is basically MollyPoint's x coordinate and CrossPoint's y coordinate.
- It then divides the distances between them by the tile width, respectively.
- Using the previous information is converts this information into control usage. I 'think' this was how the last solver worked(?)
Graphical representation:

If anyone has any problems, just post.
I would appreciate testing and bug reports :), so I can fix it up.
Thanks everyone!