SCAR Code:
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Mime Routines --//
//-----------------------------------------------------------------//
// * function Mime_InSlot: Boolean; // * by Nava2 Edited by The Man
// * procedure Mime_ClickOption(Action: String); // * by Nava2
// * function SolveMime; // * by Nava2
{--------------------------Plugin Routines-----------------------------}
// * function Mime_AnalyzeAnimation(ClientHDC: HDC): String; // * by Iroki
{*******************************************************************************
function Mime_InSlot: Boolean;
by: Nava2
Description: Checks if the player is in the Slot to watch the Mime.
*******************************************************************************}
function Mime_InSlot: Boolean;
var
TPA: TPointArray;
begin
ClickContinue;
Wait(1000);
FindColorsTolerance(TPA, 15657968, MMX1, MMY1, MMX2, MMY2 - 20, 20);
SortTPAFrom(TPA, Point(MMCX, MMCY));
//Writeln(IntToStr(Distance(MMCX, MMCY, TPA[0].x, TPA[0].y)));
//DebugTPA(TPA, '');
Result := (Distance(MMCX, MMCY, TPA[0].x, TPA[0].y) <= 7);
end;
{*******************************************************************************
procedure Mime_ClickOption(Action: String);
by: Nava2
Description: Uses the Action to and clicks on it.
*******************************************************************************}
procedure Mime_ClickOption(Action: String);
var
t: TPointArray;
a: T2DPointArray;
b: TBox;
i, c: Integer;
iis: TIntegerArray;
ss: TStringArray;
begin
Action := LowerCase(Action);
if (Action = '') or (Action = 'unknown') or (not LoggedIn) then Exit;
FindColorsTolerance(t, 11503238, MCX1, MCY1, MCX2, MCY2, 3);
a := SplitTPAEx(t, 15, 2);
iis := [104, 59, 96, 140, 164, 141, 181, 103];
ss := ['laugh', 'cry', 'dance', 'lean on air', 'glass wall', 'glass box', 'climb rope', 'think'];
c := 0;
for i := 0 to 7 do
if Action = ss[i] then
c := iis[i];
for i := 0 to 7 do
if High(a[i]) = c then
begin
b := GetTPABounds(a[i]);
MouseBox(b.x1, b.y1, b.x2, b.y2, 1);
Break;
end;
end;
{*******************************************************************************
function SolveMime: Boolean;
by: Nava2
Description: Solves the Mime Random.
*******************************************************************************}
function SolveMime: Boolean;
var
TheAction: String;
t, x, y, cts, fT: Integer;
begin
Result := False;
if not LoggedIn then Exit;
fT := GetTimeRunning + 300000;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
while ClickContinue(True, True) do
Wait(50 + Random(25));
while not Mime_InSlot do
Wait(300 + Random(200));
SetAngle(True);
MakeCompass(0);
MMouse(RandomRange(MSX1, MSX2), RandomRange(MSCY, MSY2), 0, 0);
while (CountColor(0, MCX1, MCY1, MCX2, MCY2) <> 625) and LoggedIn do
wait(100);
repeat
if not LoggedIn then Break;
TheAction := '';
t := GetSystemTime + 60000;
while (TheAction = '') and LoggedIn and (t > GetSystemTime) do
TheAction := Mime_AnalyzeAnimation(GetClientCanvas.Handle);
if TheAction = 'unknown' then Continue;
//Writeln('[Mime] - Found Action: '#39 + TheAction + #39);
t := GetSystemTime + 25000;
while (not FindColorTolerance(x, y, 11503238, MCX1, MCY1, MCX2, MCY2, 3)) and (LoggedIn) and (t > GetSystemTime) do
Wait(100 + Random(50));
Wait(RandomRange(200, 600));
Mime_ClickOption(TheAction);
while (FindColorTolerance(x, y, 11503238, MCX1, MCY1, MCX2, MCY2, 3)) and (LoggedIn) and (t > GetSystemTime) do
Wait(100 + Random(50));
MMouse(RandomRange(MSX1, MSX2), RandomRange(MSCY, MSY2), 0, 0);
while (CountColor(0, MCX1, MCY1, MCX2, MCY2) <> 625) and LoggedIn do
wait(100);
until TabExists(2) or (GetTimeRunning > fT);
Result := TabExists(2);
ColorToleranceSpeed(cts);
end;
It just ClickContinue in InSlot.