SRL Archive - OSR Help

Web Macros


sylvawarrior

2011-02-20 19:13:13

So, I've been using iMacros for FF for tasks, but it is severely limited in the free version. Then I remembered my ole' pals back at villavu!

Can someone give me code examples for a script that loads a bitmap, compares it against a site, and then Lclick's it? I want it to actually move the mouse, none of that ghostmouse stuff. Is there a section of the wiki to send URL's to a browser?

The functionality I need:
Identify images
Left click them
Navigate to URL's

I know that Simba/Scar can do all of this, but I don't remember how to call the functions. It's been almost 5 years since I wrote a script in simba.

Help?:redface:

TomTuff

2011-02-20 19:21:19


program Example;
{$i SRL\SRL.scar}


procedure ClickBitmap;
var
YourBMP, x, y: Integer;
begin
YourBMP := BitmapFromString(3, 5, 'asdf8s9f789cvhauis74e9');
if not(FindBitmap(YourBMP, x, y) then
Ex := True;
FreeBitmap(YourBMP);
if Ex then
Exit;
Mouse(x, y, 0, 0, True);
end;


begin
ClickBitmap;
end.

sylvawarrior

2011-02-20 19:22:52

Where is the bitmap to string converter located now-a-days?

Flight

2011-02-20 19:30:52

In Simba, it's under "Tools > Bitmap conversion".

By the way, what's an "FF task"?

sylvawarrior

2011-02-20 19:34:39

From: Flight
In Simba, it's under "Tools > Bitmap conversion".

By the way, what's an "FF task"?


FireFox Task.
:P

Also, The example posted doesn't work. You forgot to add 'Ex' as a variable, and it fails at:
[Error] (41:15): Type mismatch at line 40
Compiling failed.
Which is:
 Ex := True;

Current script:
program Example;
{$i SRL\SRL.scar}


procedure ClickBitmap;
var
YourBMP, x, y, Ex: Integer;
begin
YourBMP := BitmapFromString(155, 39, 'meJztm4GxpCAMQC3FUizFUizFU' +
'izFUi4suxiSEEPw6+4cmczcfFchyQMS0FumYWE6gY5Bu3yhRDSTBO' +
'7Njuj4tMVdbBKxajriu+dhWYd1G7a96xcpEAEuQOcUa6I5Tp3jDyg' +
'wAlIlponmvDxvale7Ai+Jaaf5w5qYkukJy/Ljtv03Oi3LNF8X8FdK' +
'TZP0LY52YBmP+nR8fk4D0BD/6ZoG1/2YpI7pCQSPcYCqYvF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aox/lnbnZ4DqFWm2Gi9FG0TRp6cE' +
'VN7wuoEaN+OYgig8IZbiTwx4BGh2IsQ6UnCf73S2KqCmc4OTBte3p' +
'WP8xzw8+GHCEXypEWP9QDy6B6iyqBIzSF8K0JCMzmhmQL0lEPVljj' +
'TfQAfbqhs1fEc0HzjG+PliwSr8xSNtZz1+4rtX8breoAOo3lT2Deo' +
'mX086zxWnjvi73Haa23vsHVN+qJmkXdsVVvjGpIn18+FBBnRwbWa7' +
'+nS7rqlPJUCrrFLO6vrNOss0M6aj651F15uV/P/Q0hFiEliWw1vy7' +
'XnLu2IFIqGYnA9Q6pkwxdrli8X6RrVj/XpRqP0DHKzwZw==');
if not(FindBitmap(YourBMP, x, y) )then
Ex := True;
FreeBitmap(YourBMP);
if Ex then
Exit;
Mouse(x, y, 0, 0, True);
end;


begin
ClickBitmap;
end.

I can't remember what to do here… XD
Sorry guys, it's been a long time :/

Train

2011-02-20 19:53:25

var
YourBMP, x, y, Ex: Integer;
to
var
YourBMP, x, y: Integer;
Ex: Boolean;

Flight

2011-02-20 19:55:50

Change this:
var
YourBMP, x, y, Ex: Integer;
To
var
YourBMP, x, y: Integer;
Ex: boolean;

Hehe nevermind, Train beat me to it.

sylvawarrior

2011-02-20 20:01:05

From: Train
var
YourBMP, x, y, Ex: Integer;
to
var
YourBMP, x, y: Integer;
Ex: Boolean;


I really hate to bug you guys, but do I put the
Clickmouse(
before or after the
if not
.

All that that script does is find it, it doesn't click.
I still need to know how to navigate URL's?

Sex

2011-02-20 20:15:41

Use GetPage(page) to get the data from the page. And it is all logic. If the bitmap is not found, do you want it to click the mouse?