SRL Archive - SRL Archives

Fletching.scar bitmap and function


Frement

2010-07-05 07:39:34

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Fletching routines --//
//-----------------------------------------------------------------//
// * procedure SetupFletching; // by SRL
// * procedure LoadFletchingBitmaps; // by Frement
// * function KnifeExists(var x, y: Integer): Boolean; // by Frement
// * procedure FreeFletching; // by Frement

{ var Knife: Integer;
Description: Variables containing the fletching bitmaps. }
var
Knife: Integer;

{*******************************************************************************
procedure LoadFletchingBitmaps;
By: Frement
Description: Loads bitmaps into memory.
*******************************************************************************}
procedure LoadFletchingBitmaps;
begin
Knife := BitmapFromString(5, 4, 'meJxjYmBIScmIi0uKiooLDglnYmBI' +
'SEiJiUkIC4vq7ZvCqesKRD09k6qqGoBSEC4EAbkAA6YPWA==');
end;

{*******************************************************************************
function KnifeExists(var x, y: Integer): Boolean;
By: Frement
Description: Checks if there is Knife present in inventory.
Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function KnifeExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(Knife, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;

{*******************************************************************************
procedure FreeFletching;
By: Frement
Description: Frees Global Bitmaps.
*******************************************************************************}
procedure FreeFletching;
begin
FreeBitmap(Knife);
end;

{*******************************************************************************
procedure SetupFletching;
By: SRL
Description: Declares Global Bitmaps.
*******************************************************************************}
procedure SetupFletching;
begin
LoadFletchingBitmaps;
end;

Some stuff that I thought would be useful, as FireMaking.scar will have (?) these additions.

Well, anyway, tested, works.

Nava2

2010-07-05 11:31:49

Uhm, set it up to use the SRL bitmaps and I'm game. :)

NCDS

2010-07-05 11:37:23

From: Frement

Some stuff that I thought would be useful, as FireMaking.scar will have (?) these additions.


Firemaking.scar got no addition. The .bmp was already in there, I just updated it.


From: Nava2
Uhm, set it up to use the SRL bitmaps and I'm game. :)



{*******************************************************************************
function KnifeExists(var x, y: Integer): Boolean;
By: Frement
Description: Checks if there is Knife present in inventory.
Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function KnifeExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(Knife, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;
Is the same exact function I posted using a different .bmp… What makes this one acceptable if I may ask?

{*******************************************************************************
function TinderBoxExists(var x, y: Integer): Boolean;
By: NCDS
Description: Checks if there is TinderBox present in inventory. Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function TinderBoxExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;
Couldn't even change the 'Description'? :duh:

Frement

2010-07-05 11:38:35

From: Nava2
Uhm, set it up to use the SRL bitmaps and I'm game. :)


SRL bitmaps? I made it the same way FireMaking.scar has it?

From: NCDS
Firemaking.scar got no addition. The .bmp was already in there, I just updated it.


Even without the function I think the bitmap should be in there.

From: NCDS


{*******************************************************************************
function KnifeExists(var x, y: Integer): Boolean;
By: Frement
Description: Checks if there is Knife present in inventory.
Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function KnifeExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(Knife, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;
Is the same exact function I posted using a different .bmp… What makes this one acceptable if I may ask?

{*******************************************************************************
function TinderBoxExists(var x, y: Integer): Boolean;
By: NCDS
Description: Checks if there is TinderBox present in inventory. Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function TinderBoxExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;
Couldn't even change the 'Description'? :duh:


How do you expect it to be done then? And I actually just took the description :)

Coh3n

2010-07-07 10:44:13

From: Frement
How do you expect it to be done then? And I actually just took the description :)

He said that because Nava said the Firemaking function shouldn't be added.

From: Nava2
Uhm, set it up to use the SRL bitmaps and I'm game. :)

I like how they're separated and I think it works seeing as the skill files aren't included in SRL.

Coh3n

2010-07-07 17:18:46

http://villavu.com/forum/showthread.php?t=57783

Sir R. M8gic1an

2010-07-09 06:53:06

Bitmaps should be central, rather than separated over the files.

Easier to update. Easier to find. Easier to everything.

~RM

Narcle

2010-07-09 12:38:25

We really need to move away from bitmaps. If anything DTMs.

NCDS

2010-07-09 14:09:20

From: Narcle
We really need to move away from bitmaps. If anything DTMs.


From: Coh3n
http://villavu.com/forum/showthread.php?t=57783


;).

Narcle

2010-07-09 16:35:19

From: NCDS
;).


Yes I know… Just saying.