SRL Archive - SRL Archives

Mime.scar


Dynamite

2009-06-23 01:08:52

People were complaining about it mime not clicking continue.
So simple fix
//-----------------------------------------------------------------//
//-- 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.

T~M

Da 0wner

2009-06-23 03:43:03

You don't deserve credits for that ;).

Naike

2009-06-23 15:27:49

From: Da 0wner
You don't deserve credits for that ;).


Ofc he does, He fixed it.

Floor66

2009-06-23 15:31:04

Yeah lol. Why wouldn't he.

Nava2

2009-06-23 15:48:43

If you kook through that code, I'm pretty sure mime_InSlot is used as a looping check. You just made it anciently slow.

Thanks for helping though :)

ShowerThoughts

2009-06-23 18:39:22

From: Nava2
If you kook through that code, I'm pretty sure mime_InSlot is used as a looping check. You just made it anciently slow.

Thanks for helping though :)

Since when are you mixster–>mister I-ALWAYS-HAVE-THE-LAST-AND….. nah this is getting to long(and tiring).:P

Good Job!

Dynamite

2009-06-24 00:02:58

OK. Well I try to do what I can to help :)
What I post is normally wrong or slow, but it needs pointed out, and I would rather try it than say:
0m6 7h15 n33d5 f1x1n6 |)3\/5!!!!!!!11113|3v3n
I don't really mind if I don't get credits, that isn't what its about ;)

T~M