SRL Archive - SRL Archives

Mime.scar - The First Color Mime Solver!


Naum

2009-02-01 14:54:55

SEE NAIRI



Mime Solver!

by NaumanAkhlaQ and manfromczech

Note : BETA Release

Hello everyone, after long hours of hard work on this project which me and manfromczech put in, we have finished it!! And believe it or not - that little .rar file contains the first ever Mime solver.


What it includes

The main finding procedures in this script are from manfromczech's Mime Plugin. They are included along with Mime.scar, and there are instructions on how to run it.
The Main Procedures:
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- » Mime Routines --//
//-----------------------------------------------------------------//
// * function InMimeRandom : Boolean // * by NaumanAkhlaQ
// * function InSpotLight : Boolean; // * by NaumanAkhlaQ and manfromczech
// * function WaitToSlot : Boolean // * by manfromczech
// * procedure MakeCamera // * by NaumanAkhlaQ and Manfromczech
// * function SolveAnimation : Boolean; // * by manfromczech and NaumanAkhlaQ
// * procedure SolveMime; // * by NaumanAkhlaQ + manfromczech
{--------------------------Plugin Routines-----------------------------}
// * Mime_AnalyzeAnimation(ClientHDC: HDC): String; // * by manfromczech


Credits
I'd like to say a big thanks to Tarajunky as without his accounts we couldn't have started developing it.

Current Version 0.7 BETA.

Bad Processor

2009-02-01 14:56:30

Nauman, I'm going to test now, I got an account in the mime random!
Hope for the best!
EDIT: Sorry, can't test it, it got banned 2 weeks ago, I just remembered. :(

– BP

Iroki

2009-02-01 15:10:10

Yeah!!, Yeah :), now Mr.mordaut solver :P

hamgooof

2009-02-01 15:29:17

im going to bot tons soon, i gues hopefully ill get a mime… although i hopefully dont get flagged, id like to be thre to watch the mime
is this reflection?

Kyle Undefined

2009-02-01 15:47:59

From: hamgooof
is this reflection?


Mime.scar - The First Color Mime Solver!


;) Very nice Nauman and Czech. Will defiantly try to get a Mime just for this.

~Camo

Sir R. M8gic1an

2009-02-01 15:55:38

emote done — emote supposed to do
glass wall = glass box
think = ok
pull rope = glass wall
lean on air = ok
glass wall = ok
glass box = glass wall

then i stoped it cus i praise his char too much :p

scar part was fine, detecting was off.

also nauman, please, don't include srl in mime.scar >.> cus then I used Solvemime and just simply got a duplicate identifier >.>

~RM

Naum

2009-02-01 16:36:56

Cool thanks for the feedback, Will get to it in the morning :)

Iroki

2009-02-01 17:00:47

Test now :)

btw, it's not easy to make solver cuz mime is so smalllll… :), but it should works now better :P.

Naum

2009-02-02 03:05:16

Umm, Took n board all the suggestions that Rasta told me and also added the newest Plugin, So

REDOWNLOAD!!

Naike

2009-02-02 10:28:07

You should share the source since your partner got a past of scamming..

*I know i will regret posting this*

Naum

2009-02-02 10:49:10

Umm, sure, you have a right to be suspicious.

Here it is:
library MimePlugin;


uses
FastShareMem,
SysUtils,
Classes,
Windows,
Math,
Graphics;

{$R *.res}


type
TSCARPlugFunc = record
Name: string;
Ptr: Pointer;
end;


TSCARWindowHandle = function(): Integer;

type
TRGB32 = packed record
B, G, R, A: Byte;
end;
TRGB32Array = packed array[0..MaxInt div SizeOf(TRGB32) - 1] of TRGB32;
PRGB32Array = ^TRGB32Array;


var
GetClientWindowHandle: TSCARWindowHandle;
c: array of array of Integer;
b: array of array of Boolean;
w, h: Integer;






{

Mime solver
By: ManFromCzech + NaumanAkhlaQ

}


function Mime_AnalyzeAnimation(ClientHDC: HDC): string; stdcall;

var
BMP: TBitmap;
Line: PRGB32Array;
Sx1, Sy1, Sx2, Sy2, ObjectArea, x, y, CoMax, CoMin,
BlackArea, BMaxArea, BMinArea, sx, sy, a1, a2, b1, b2, BArea: integer;
Start, Stop, Freq: int64;
Time: double;
Obj: string;
Lum: extended;

begin
a1 := 0; b1 := 0; a2 := 0; b2 := 0;
CoMax := 0; CoMin := 20000; BMinArea := 0; BMaxArea := 20000;
Sx1 := 300; Sx2 := 410; Sy1 := 100; Sy2 := 200;


QueryPerformanceFrequency(Freq);
QueryPerformanceCounter(Start);
repeat


w := 430; h := 210;
Bmp := TBitmap.Create;
Bmp.Width := w;
Bmp.Height:= h;
Bmp.PixelFormat := pf32bit;
SetLength(c, w + 1, h + 1);
SetLength(b, w + 1, h + 1);
BitBlt(Bmp.Canvas.Handle, 0, 0, w, h, ClientHDC, 0, 0, SRCCOPY);


BlackArea := 0;


for y := Sy1 to Sy2 do
begin
Line := bmp.ScanLine[y];
for x := Sx1 to Sx2 do
begin
c[x][y] := RGB(Line[x].R, Line[x].G, Line[x].B);
if (Line[x].R <> 0) then
begin
if (Line[x].R < 190) and (Line[x].G < 180) and (Line[x].B < 170) then
begin
c[x][y] := 0;
b[x][y] := True;
inc(BlackArea);
end;
end else
begin
c[x][y] := 0;
b[x][y] := True;
inc(BlackArea);
end;
end;
end;


ObjectArea := (11211 - BlackArea);

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

for sx := Sx2 - 1 downto Sx1 + 1 do
for sy := Sy1 + 1 to Sy2 - 1 do
begin
if (c[sx][sy] <> 0) then
begin
a2 := sx;
break;
end;
end;

for sx := Sx1 + 1 to Sx2 - 1 do
for sy := Sy1 + 1 to Sy2 - 1 do
begin
if (c[sx][sy] <> 0) then
begin
a1 := sx;
break;
end;
end;


for sy := Sy2 - 1 downto Sy1 + 1 do
for sx := Sx1 + 1 to Sx2 - 1 do
begin
if (c[sx][sy] <> 0) then
begin
b2 := sy;
break;
end;
end;

for sy := Sy1 + 1 to Sy2 - 1 do
for sx := Sx1 + 1 to Sx2 - 1 do
begin
if (c[sx][sy] <> 0) then
begin
b1 := sy;
break;
end;
end;


BArea := (a2 - a1)*(b2 - b1);

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////



if (ObjectArea > CoMax) then
begin
CoMax := ObjectArea;
BMaxArea := BArea;
end;

if (ObjectArea < CoMin) then
begin
CoMin := ObjectArea;
BMinArea := BArea;
end;

Bmp.Free;

QueryPerformanceCounter(Stop);
Time := (1E3 * (Stop - Start) / Freq);
Until (Time >= 2500);

Lum := 0;
if (CoMax <> 0) then Lum := (BMaxArea/CoMax);
Obj := 'unknow';


if (Obj = 'unknow') then
if InRange(Lum, 1.8, 2.6) and InRange(BMaxArea, 220, 350) and InRange(BMinArea, 50, 250) and InRange(CoMax, 50, 170) and InRange(CoMin , 0, 60) then Obj := 'Laugh';


if (Obj = 'unknow') then
if InRange(Lum, 1.9, 3.2) and InRange(BMaxArea, 190, 350) and InRange(BMinArea, 150, 550) and InRange(CoMax, 70, 150) and InRange(CoMin , 30, 100) then Obj := 'Think';


if (Obj = 'unknow') then
if InRange(Lum, 2.5, 4.9) and InRange(BMaxArea, 250, 350) and InRange(BMinArea, 20, 100) and InRange(CoMax, 50, 110) and InRange(CoMin , 0, 40) then Obj := 'Cry';


if (Obj = 'unknow') then
if InRange(Lum, 3.0, 6.7) and InRange(BMaxArea, 250, 550) and InRange(BMinArea, 300, 510) and InRange(CoMax, 60, 110) and InRange(CoMin , 40, 90) then Obj := 'Lean on air';


if (Obj = 'unknow') then
if InRange(Lum, 5.2, 7.9) and InRange(BMaxArea, 500, 870) and (InRange(BMinArea, 90, 330) or InRange(BMinArea, 400, 750)) and InRange(CoMax, 100, 150) and InRange(CoMin , 20, 100) then Obj := 'Glass Box';


if ((Obj = 'unknow') or (Obj = 'Glass Box')) then
if InRange(Lum, 3.2, 5.7) and InRange(BMaxArea, 550, 800) and InRange(BMinArea, 40, 350) and InRange(CoMax, 50, 250) and InRange(CoMin , 0, 100) then Obj := 'Dance';


if (Obj = 'unknow') then
if InRange(Lum, 2.5, 4.5) and InRange(BMaxArea, 250, 350) and InRange(BMinArea, 80, 250) and InRange(CoMax, 60, 130) and InRange(CoMin , 30, 70) then Obj := 'Climb Rope';


if (Obj = 'unknow') then Obj := 'Glass Wall';


Result := Obj;

// {if (Result = 'unknow') then } Result := (Obj + ' Lum ' + FloatToStr(Lum) + ' BMax: '+ IntToStr(BMaxArea) + ' BMin: ' + IntToStr(BMinArea) + ' ColoredMax: '+ IntToStr(CoMax) + ' ColoredMin: '+ IntToStr(CoMin));

end;







function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;






function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @Mime_AnalyzeAnimation;
StrPCopy(ProcDef, 'function Mime_AnalyzeAnimation(ClientHDC: HDC): string;');
end;
else
x := -1;
end;
Result := x;
end;






procedure SetFunctions(Funcs: array of TSCARPlugFunc); stdcall;
var
i: Integer;
begin
for i := 0 to Length(Funcs) - 1 do
begin
if Funcs[i].Name = 'GetClientWindowHandle' then
GetClientWindowHandle := Funcs[i].Ptr;
end;
end;


exports GetFunctionCount;
exports GetFunctionInfo;
exports SetFunctions;

end.


Iroki

2009-02-02 11:01:54

From: N1ke!
You should share the source since your partner got a past of scamming..

*I know i will regret posting this*


Sad past :(

Baked0420

2009-02-02 13:45:16

wow this is finally done? I can't wait to test this for you guys, once I get an account in mime random I'll definitely use this and tell you guys how it went. :D

Iroki

2009-02-02 14:44:56

Yes, finally done :)

Kyle Undefined

2009-02-02 23:49:35

I'm trying to get it to work, but I can't. I added a couple of writeln's to see where it was and it knows it is in the spotlight but it doesn't do anything. I could have done it wrong or something. I'll let you know if I can get it working.

~Camo

NiCbaZ

2009-02-03 01:40:24

From: Camo¤Kyle
I'm trying to get it to work, but I can't. I added a couple of writeln's to see where it was and it knows it is in the spotlight but it doesn't do anything. I could have done it wrong or something. I'll let you know if I can get it working.

~Camo


+1 just sits there.

Kyle Undefined

2009-02-03 01:45:39

Oh, also I forgot to mention this. In your SolveAnimation function, you're missing an ";" here:
Until InSpotLight
I went ahead and put it in mine. Just thought I would let you know.

~Camo

Iroki

2009-02-03 02:23:45

put ActivateClient; before SolveMime;

t means right recognized and f means bad recognized:
Clicked Emote : Glass Wall         f
Clicked Emote : Climb Rope t
Clicked Emote : Glass Box t
Clicked Emote : Dance t
Clicked Emote : Glass Wall t
Clicked Emote : Cry t
Clicked Emote : Glass Box t
Clicked Emote : Glass Wall f
Clicked Emote : Glass Wall f
Clicked Emote : Lean on air t
Clicked Emote : Glass Box t
Clicked Emote : Lean on air t
Clicked Emote : Glass Wall f
Clicked Emote : Think t
Clicked Emote : Cry t
Clicked Emote : Glass Box t
Clicked Emote : Dance t
Clicked Emote : Climb Rope f
Clicked Emote : Laugh t

It'll solve mime :)

Heavenzeyez1

2009-02-04 13:02:47

1 question, how to add your mime and scunerape to the script?
I know how to include them.. but in script part, like before I do FindNormalRandoms; I call SolveMime; or… ?
Thanks in advance,
~Eerik~

lordsaturn

2009-02-04 13:56:37

From: heavenzeyez1
1 question, how to add your mime and scunerape to the script?
I know how to include them.. but in script part, like before I do FindNormalRandoms; I call SolveMime; or… ?
Thanks in advance,
~Eerik~


manfromczech's solvers have not been included in SRL yet. So if you call FindNormalRandoms it will not check for mime or prison pete. I suggest you wait until these solvers are inducted into SRL until including them in your script.

Naum

2009-02-04 14:22:49

Yeah, we're waiting to solve mordaut then were putting all thosse solvers into one big Plugin :)

Heavenzeyez1

2009-02-04 14:28:32

Okay, thanks guys. :)
So, basicly, I'm not able to run em yet?
I tryed the mime solver one day… but it froze.
~Eerik~

Iroki

2009-02-04 15:47:07

From: heavenzeyez1
Okay, thanks guys. :)
So, basicly, I'm not able to run em yet?
I tryed the mime solver one day… but it froze.
~Eerik~


You are able to run em. They should work. :)

Drakan

2009-02-25 17:02:33

From: NaumanAkhlaQ
SEE NAIRI



Mime Solver!

by NaumanAkhlaQ and manfromczech

Note : BETA Release

Hello everyone, after long hours of hard work on this project which me and manfromczech put in, we have finished it!! And believe it or not - that little .rar file contains the first ever Mime solver.


Current Version 0.7 BETA.


Eh, not the first ever, but maybe first COLOR solver ever :P (This is color right? haha)