SRL Archive - Help and Support

ItemList - BitmapMasks


Junior

2007-02-14 14:50:51

Im using that include ({.include srl\srl\misc\ItemList.scar}), and I cant get any bitmap mask to work. This is the mini script I made to see if it moves the mouse towards the object… And it does nothing. Does anyone know what im doing wrong?

program New;
{.include SRL/SRL.scar}
{.include srl\srl\misc\ItemList.scar}

procedure Find;
begin
SetupItems;
if (FindBitmapMaskTolerance(AllItems[84].Bitmap, x, y, mix1, miy1, mix2, miy2, 80, 80)) then
begin
MMouse(x, y, 0, 0);
FreeBitmap(AllItems[84].Bitmap);
end;
end;

begin
SetUpSRL;
ActivateClient;
Wait(1000);
Find;
end.

WT-Fakawi

2007-02-14 16:15:18

I think it is wiser to just copy that particular bitmap Junior. AllItems is there for reference only.

Junior

2007-02-14 20:59:36

This is what I have now, and it still doesnt work. Copied the bitmap mask right out of ItemList.
program New;
{.include SRL/SRL.scar}
//{.include srl\srl\misc\ItemList.scar}

procedure Find;
var
Phead: integer;
begin
PHead := BitmapFromString(37, 36,
'z78DAEDD5B10D80300C00C1953205FB8F84444B030926B6755723' +
'C1DB8918030020D671E9DDD5AF515DA7BB56BD5157FE8ABBEA7F8' +
'4B7DF59716B3DBAE64EE0F3E7F7B6AC4C606FE3B76FCF5317B197' +
'3C5BCB366D0000F8DF09B57EFDDC');
//SetupItems;
//if (FindBitmapMaskTolerance(AllItems[84].Bitmap, x, y, mix1, miy1, mix2, miy2, 80, 80)) then
if (FindBitmapMaskTolerance(PHead, x, y, mix1, miy1, mix2, miy2, 80, 80)) then
begin
MMouse(x, y, 0, 0);
//FreeBitmap(AllItems[84].Bitmap);
FreeBitmap(PHead);
end;
end;

begin
SetUpSRL;
ActivateClient;
Wait(1000);
writeln('looking');
Find;
end.
I think bitmap masks dont like me :(

WT-Fakawi

2007-02-15 02:26:53

hmm. Try raising or reducing the MaskTol…

Junior

2007-02-15 15:55:34

Ok, I took a screenie of my inventory and pasted that in paint. After that I made a script to raise the tolerances until it finds it. Yes, the cords for where to look for the bitmap mask are right, but it still doesnt do a thing, and my tolerances were both maxed out at 200.
program New;
{.include SRL/SRL.scar}

var
tol2: integer;

function Find: boolean;
var
PHead, tol: integer;
begin
PHead := BitmapFromString(37, 36,
'z78DAEDD5B10D80300C00C1953205FB8F84444B030926B6755723' +
'C1DB8918030020D671E9DDD5AF515DA7BB56BD5157FE8ABBEA7F8' +
'4B7DF59716B3DBAE64EE0F3E7F7B6AC4C606FE3B76FCF5317B197' +
'3C5BCB366D0000F8DF09B57EFDDC');
while (tol < 200) do
begin
tol := tol + 10;
if (FindBitmapMaskTolerance(PHead, x, y, 0, 0, 190, 270, tol, tol2)) then
begin
MMouse(x, y, 0, 0);
Writeln('EXACT TOLERANCES = tol: ' + inttostr(tol) + ', tol2: ' + inttostr(tol2)+ '')
FreeBitmap(PHead);
result := true;
end else
Writeln('tol: ' + inttostr(tol) + ', tol2: ' + inttostr(tol2)+ '');
result := false;
end;
end;


begin
SetUpSRL;
tol2 := 10;
repeat
if not(Find) then tol2 := tol2 + 10;
until (tol2 > 200)
end.

Freddy1990

2007-02-16 16:47:37

hey Junior… if you'd use that include, use setupitems in ur mainloop, because believe me, u're causing huge memory leans loading all them bitmaps over and over again :)