SRL Archive - Help

Bitmap Help


shnk

2011-12-30 15:49:58

It opens up the bank but it doesn't seem to withdraw the bitmap :fiery:

I've looked through like every bitmap tutorial.

program test;

//{$DEFINE SMART}
{$i SRL\SRL.scar}

const
//World = 0; //Leave it 0 for a random world
//Members = false; //F2P = false, P2P = true
BreakEvery = 60; //Break every 'x' minutes. Default is 60.
BreakFor = 5; //Break for 'x' minutes. Default is 5.
Version = '1.0';

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //RuneScape username
Players[0].Pass :=''; //RuneScape password
Players[0].Nick :='';
Players[0].Active:=True;
end;

function Banking: boolean;
begin
if (InvEmpty) then
begin
OpenBank ('fwb', true, true);
Wait (2000);
end;
end;

[COLOR="Blue"]function FindBitmap: boolean;
var Bitmap, x, y : integer;
begin
Bitmap:= BitmapFromString(13, 9, 'meJxN0FcOg0AMRdFFIVIg9A6hD70' +
'OafvfQR6aZIR0P48s25/H9jn0WOahabqKVEUe+b6hqvL1ehKE90ZZ' +
'jG3zPLYtWF0WSRhauq7I0lkUOWPRadxZXYFl8d21TF1VpMvlRSnib' +
'B2HqdtZU5ZlmvqOwwYyxmOsr2swkueh5zmmqSm317ruHVnfgbWEgM' +
'Vh4Dm2qWk/9g+7geFYMBybRFHgurZhPNcFHdnc9/wneRLfA9+zLTw' +
'KMYzoNC3DwI8lWYZp2O0LwDN21A==');
if FindBitmap (Bitmap, x, y) then
begin
Mouse (x, y, 5, 5, false);
ChooseOption ('w-All V');
end;
end;
[/COLOR]

begin
SetUpSRL;
//ActivateClient;
DeclarePlayers;
//SetAngle(False);
//LoginPlayer;
Banking;
FindVials;

YoHoJo

2011-12-30 16:14:04

What is the bitmap of?
You probably want to use some tolerance… findbitmap looks for the EXACT SAME PICTURE but things in runescape are always changing slightly. So loop up some other findbitmap functions that use tolerance, also do this

          if FindBitmap (Bitmap, x, y) then
begin
WriteLn('We Found it');
Mouse (x, y, 5, 5, false);
ChooseOption ('w-All V');
end else
Writeln('We Did Not Find It');

So you know if it's found or not.

shnk

2011-12-30 16:20:12

It's actually a picture of the inside of a vial. I added the writeln and it couldn't find it.

YoHoJo

2011-12-30 16:22:50

Need tolerance BORH
Try using
function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;
Personally, I like using DTMs to find items like that, check out my video tutorial about it here
http://youtu.be/SlS4q9MiFX4

Mat

2011-12-30 16:27:34

Yohojo, why do you prefer to use DTM?
Mat

YoHoJo

2011-12-30 16:29:54

From: Aligndude
Yohojo, why do you prefer to use DTM?
Mat


No reason really, just easy/fun to make and they work well so why not, just personal preference.

shnk

2011-12-30 16:30:52

From: YoHoJo
Need tolerance BORH
Try using
function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;
Personally, I like using DTMs to find items like that, check out my video tutorial about it here
http://youtu.be/SlS4q9MiFX4


Findbitmaptolerancein seemed to do the trick! Thanks. Btw i thought bitmaps were more accurate and fast than dtms. Ill be sure to check out your tutorial, thanks again.

Mat

2011-12-30 16:32:53

As Yohojo Said Its quite fun to make them :P
I find it really annoying on a laptop tho :P
Mat

YoHoJo

2011-12-30 16:33:02

No clue, and even if one is faster than other it will be by a few milliseconds and completely unnoticeable.

I'd GUESS DTMs are faster, bitmap is a X by Y rectangle of pixels, while DTMs are just a set of like 5+ pixels, so I'd guess DTMs are technically faster.

And awesome, glad it worked out!

shnk

2011-12-30 16:38:01

From: Aligndude
As Yohojo Said Its quite fun to make them :P
I find it really annoying on a laptop tho :P
Mat


From: YoHoJo
No clue, and even if one is faster than other it will be by a few milliseconds and completely unnoticeable.

I'd GUESS DTMs are faster, bitmap is a X by Y rectangle of pixels, while DTMs are just a set of like 5+ pixels, so I'd guess DTMs are technically faster.

And awesome, glad it worked out!


Hmmm i might use DTMs then. Hope to release my first script in a few days. Thanks again.