SRL Archive - SRL Archives

Herblore.scar


Dynamite

2009-06-30 23:16:38

Well before I add more.

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Herblore routines --//
//-----------------------------------------------------------------//
// * procedure SetupHerblore; // * SRL
// * procedure VialCheck; // * The Man
{*******************************************************************************
procedure SetupHerblore;
By: SRL
Description: Declares Global Bitmaps.
*******************************************************************************}
procedure SetupHerblore;
begin
end;
{*******************************************************************************
procedure VialCheck;
By: The Man
Description: Returns true if there is a vial in the inventory
*******************************************************************************}
procedure VialCheck;
var
VialDTM : Integer;
begin
VialDTM := DTMFromString('78DA6314646060506040038C4824906607125' +
'204D4F002091E22D4B0135003720F33013562408293801A512021' +
'40408D349090C6AF0600B0BB0126');

if CountItems(Vialdtm, dtm, []) then
Result := True
end;

Just want to check if this is right.

T~M

Richard

2009-06-30 23:37:03

CountItems isn't a boolean, you also never free the DTM, and there is no such boolean as "Result", you called it as a procedure:

Function VialCheck: Boolean;
var
VialDTM, x, y : Integer;
begin
VialDTM := DTMFromString('78DA6314646060506040038C4824906607125' +
'204D4F002091E22D4B0135003720F33013562408293801A512021' +
'40408D349090C6AF0600B0BB0126');

Result := FindDTM(VialDTM, x, y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(VialDTM);
end;

Dynamite

2009-06-30 23:39:15

Oh ok, I asked Nava what to use to search the inv and he said use that.
Oh well.
Thank you :)

T~M

Richard

2009-06-30 23:41:38

From: The Man
Oh ok, I asked Nava what to use to search the inv and he said use that.
Oh well.
Thank you :)

T~M


If you want to use CountItems, you'd do it something more like this:

Result :=(CountItems(VialDTM, 'DTM', [0]) > 0) 

Dynamite

2009-06-30 23:43:56

Oh ok.
Thank you,

T~M

Tickyy

2009-07-01 00:46:28

From: Richard
CountItems isn't a boolean, you also never free the DTM, and there is no such boolean as "Result", you called it as a procedure:



Relax dude, he's trying to contribute, developers can make their changes later, he still isn't such a good scripter, but he's doing fine. :D

otherwise, Good job TheMan.

Dynamite

2009-07-01 00:49:54

haha thank you Tickyy.
But I like the hard criticism.
It makes me a better scripter :)

T~M

Richard

2009-07-01 00:53:02

From: Tickyy
Relax dude, he's trying to contribute, developers can make their changes later, he still isn't such a good scripter, but he's doing fine. :D

otherwise, Good job TheMan.


I was just making sure it worked, not once did I complain about his function.

Awkwardsaw

2009-07-01 01:17:10

hmm, i was just thinking about making something like this :P

i guess i'll make a herb finder or something :)

i think it looks decent(the fix'd versions), good job =D

Wizzup?

2009-07-01 01:19:41

From: Tickyy
Relax dude, he's trying to contribute, developers can make their changes later, he still isn't such a good scripter, but he's doing fine. :D.


There was nothing wrong with Richard's post. :)