Log in

View Full Version : Bitmap Help



shnk
12-30-2011, 08:49 PM
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;

function FindBitmap: boolean;
var Bitmap, x, y : integer;
begin
Bitmap:= BitmapFromString(13, 9, 'meJxN0FcOg0AMRdFFIVIg9A6hD70' +
'OafvfQR6aZIR0P48s25/H9jn0WOahabqKVEUe+b6hqvL1ehKE90ZZ' +
'jG3zPLYtWF0WSRhauq7I0lkUOWPRadxZXYFl8d21TF1VpMvlR Snib' +
'B2HqdtZU5ZlmvqOwwYyxmOsr2swkueh5zmmqSm317ruHVnfgb WEgM' +
'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;


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

YoHoJo
12-30-2011, 09:14 PM
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
12-30-2011, 09:20 PM
It's actually a picture of the inside of a vial. I added the writeln and it couldn't find it.

YoHoJo
12-30-2011, 09:22 PM
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
12-30-2011, 09:27 PM
Yohojo, why do you prefer to use DTM?
Mat

YoHoJo
12-30-2011, 09:29 PM
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
12-30-2011, 09:30 PM
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
12-30-2011, 09:32 PM
As Yohojo Said Its quite fun to make them :P
I find it really annoying on a laptop tho :P
Mat

YoHoJo
12-30-2011, 09:33 PM
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
12-30-2011, 09:38 PM
As Yohojo Said Its quite fun to make them :P
I find it really annoying on a laptop tho :P
Mat


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.