SRL Archive - SRL Archives

[FIXED] FindAxe Updated!


Sir R. M8gic1an

2008-03-30 15:11:59

hey, i've been workin on a woodcutter for sometime now and noticed that some of the DTM's of FindAxe were outdated. So i updated it and used SRL_GetBitmaps instead so that if it needs an update it's just changing it in the bitmaps file. :)

it now also works for black axe.


Function FindAxe:boolean;
var
InvAxe, WieldAxe, Ix, Iy: Integer;
begin
if not LoggedIn then exit;
srl_LoadBitmaps([47, 48, 49, 50, 51, 52, 53]);

GameTab(5);
for WieldAxe := 0 to 6 do
if FindBitmapToleranceIn(srl_GetBitmap(53-WieldAxe),Ix, Iy, 566, 285, 606, 327, 10) then
break;

GameTab(4)
for InvAxe := 0 to 6 do
if FindBitmapToleranceIn(srl_GetBitmap(53-InvAxe), Ix, Iy, MIX1, MIY1, MIX2, MIY2, 10) then
break;

if(InvAxe = 7)and(WieldAxe = 7)then
begin
Result := False;
Writeln('No axe was found.');
srl_FreeBitmaps;
Exit;
end;

if((InvAxe - WieldAxe) < 0)then
EquipAxe := False
else
EquipAxe := True;

case Min(WieldAxe, InvAxe) of
0: WriteLn('Using Rune axe');
1: WriteLn('Using Addy axe');
2: WriteLn('Using Mith axe');
3: WriteLn('Using Black axe');
4: WriteLn('Using Steel axe');
5: WriteLn('Using Iron axe');
6: WriteLn('Using Bronze axe');
end;

Result := True;
srl_FreeBitmaps;
end;

:)

~RM

EvilChicken!

2008-03-30 15:58:35

Nice! They're starting to get loads of things to include for REV#15,, I just hope this gets enough attention to get included. But, as usual, if this will be included the devs will edit this function and put their name(s) on it and remove your. But, still, nice work. I love contributors like you, keep it up!

Edit: Yes, of course I saw that. I'm just saying davs will 'update' this EVEN more (just a slight bit), then put their own name on it.

Sir R. M8gic1an

2008-03-30 16:01:37

oh, don't get the wrong impression. this is not something i made, this is already in srl. i just updated it.

but thanks :)

~RM

Sumilion

2008-03-30 16:26:42

Added to SRL.

Sir R. M8gic1an

2008-03-30 16:30:12

:D