SRL Archive - Help and Support

Detecting Bitmap


gerauchert

2007-12-01 18:05:11

So im trying to make my ranger script break the waiting loop if it finds a full red bar near it, so to do this I wanted to use FindBitmapIn and have it look in a box around the coords of my player. The problem I am having is that it will detect the bitmap perfectly fine if I use FindBitmap or I use FindBitmapIn using msx1 msy1 ect. but the moment i do something like fx+100,fy+100,fx-100,fy-100 it will not even detect it if I am standing 2 pixels from the bar…

I dont know what I am doing wrong…been testing it with this and imputing the fx and fy value each login:

program New;
{.include SRL/SRL.scar}
var fx,fy,x,y,RedBar : integer;

begin
SetupSRL;
fx := 240;
fy := 164;
RedBar := BitmapFromString(29, 5, 'beNpjYPjPMIqGFAIAdvCQcA=' +
'=');
ActivateClient;
Wait(1000);
repeat
Wait(100);
until FindBitmapIn(RedBar,x,y,fx+150,fy+150,fx-150,fy-150);
end.

R0b0t1

2007-12-01 18:54:09

Now… Whats wrong with using the SCAR coords?

Santa_Clause

2007-12-01 19:51:06

Put Fx as MSCX, Fy as MSCY…how about you try FindBitmapSpiral?

gerauchert

2007-12-02 16:04:20

First off, the position of your char will change just about every logout so I made a function to detect the location of your player in order to get the most accurate HP bar search.

And yes I have tried FindBitmapSpiral and I have used the MSCX and the MSCY too…

I just dont understand why it wont detect it…

EDIT:

Can any try to test it to see why it wont work? Completely baffled atm…