SRL Archive - OSR Help

Making image finder script!


pupsikans

2008-06-30 11:27:29

Hi. I am quite new to this stuff but I want to request a script. So I want to tell you the idea of it. You see on one site there is a competition, they post a picture which is zoomed in and it's only a small part of the real picture. So we need to find the pictures somewhere on the site.  All images on site is viewable by users. But it's quit difficult because it's zoomed.

The script probably could find the image on site by checking all images and comparing them whit the given one and show matching image/s. Can someone make this? P.S.

skilld u

2008-06-30 11:35:01

just use:

program New;
{.include SRL/SRL.scar}

var
OurBMP, x, y: integer;

begin
SetupSRL;
OurBMP := BitmapFromString(1, 1, ''); //you have to paste the real code here
if FindBitmap(OurBMP, x, y) then //looks for the bmp
MMouse(x, y, 0, 0); //Moves the mouse to the pic
end.

pupsikans

2008-06-30 11:37:22

Oh, oh. Is there some tutorial to do this?

skilld u

2008-06-30 11:43:44

you have to load the bitmap from a file.

read this tut:
http://www.villavu.com/forum/showthread.php?t=1609

pupsikans

2008-06-30 12:10:19

Thank you, is the script right which I sent you?

skilld u

2008-06-30 12:16:44

yeah, that should work. ;)

pupsikans

2008-06-30 12:20:24

Now I need to do what? Only click run script?

When I do it it shows error:

Failed when compiling
Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script D:\Program Files\SCAR 3.12\Scripts\Test\imagetest.scar

sirlaughsalot

2008-06-30 12:33:01

Get Scar3.15 or 3.15b install subversion and redownload SRL #17…

nielsie95

2008-06-30 12:51:59

Remove the {.include SRL/SRL.scar} at the top and remove SetupSRL from the mainloop, replace MMouse(x, y, 0, 0) with MoveMouse(x, y) and it should compile.

pupsikans

2008-06-30 13:00:42

Everything is fixed.

Lee Lok Hin

2008-07-01 03:36:22

It has'nt found the bitmap. You probably need to

repeat
if findbitmap(...) then
begin
movemouse(x,y);
break;
end;
until(isfkeydown(11));
That will repeat finding the bitmap until F11 is pressed. I still don't think the whoel thing will work though, because You say the bitmap will be resized?

pupsikans

2008-07-01 04:16:32

From: Lee Lok Hin
It has'nt found the bitmap. You probably need to

repeat
if findbitmap(...) then
begin
movemouse(x,y);
break;
end;
until(isfkeydown(11));
That will repeat finding the bitmap until F11 is pressed. I still don't think the whoel thing will work though, because You say the bitmap will be resized?


Someone told me this:

alternativly in SCAR you could have every single image that the mystery pic could possibly be saved to an external harddrive or whatnot, and have it scan and compare to those images that might theoretically take less time, but im not sure

dwimage

2013-06-06 22:51:26

i want the tutoria if there is