SRL Archive - Scripting Help

inv count


Peanuts

2013-05-23 01:05:30

BLAGH!… CANT SEEM TO FIGURE OUT WHAT IM DOING WRONG..

i WANT TO COUNT THE ORE N GEM IN MY INV BEFORE I DEPOSIT INTO BOX.
CURRENTLY HOLDING 2 MITHS AND 4 ADDYS, BUT ALL I GET IS… 6 MITHS, 6 ADDYS, IN THE RETURN.


procedure CountStuff;
var
AdamCnt: Integer; //This is reset to 0 every time this procedure is called
MithCnt: Integer;

begin
//WalkToBank;
AdamCnt := CountItems('dtm', DTM_Adamantite, []);
if (AdamCnt > 0) then
Writeln('We mined '+ToStr(AdamCnt)+' Adamantite ore this load!');

IncEx(Adamantite_count, AdamCnt);

MithCnt := CountItems('dtm', DTM_Mithril, []);
if (MithCnt > 0) then
Writeln('We mined '+ToStr(MithCnt)+' Mithril ore this load!');

IncEx(MithrilCount, MithCnt);
end;

PRESSES PLAY.

we mined 6 Adamantite ore this load!
We mined 6 Mithril ore this load!

Should've being 4 addy and 2 miths.. I have different dtms etc..
hmm..

Sjoe

2013-05-23 01:18:09

I believe your addy/MithDTM is also grabbing the other ore.

Try to show your matching DTM's found on the DTM editor, see if it debugs the right ores.

Flight

2013-05-23 02:12:34

2 Mithril and 4 Adamant, but the script counts 6 for both… I'd say your DTM for both ores are so similar that they're both detected in each count. You should re-make your DTMs and make more sub-points of the ore color itself (use more blue points for mithril and green points for adamant).

Peanuts

2013-05-23 05:05:39

Thanks guys.

Fixed it up.