NCDS
2010-07-07 13:15:40
Well, me and Coh3n were talking and this idea came to me. One universal function to find all the tools needed for use in /skill.
The following function could find any tool in the Inventory by simply specifying the correct bitmap to search for.
So, by generalizing the name to something like 'InvItemExists()' (credits to Coh3n for that) and making it take in a bitmap parameter we could eliminate a good amount of repeated code in the include.
Coh3n also said that if this were to be done, it would fit best in Inventory.simba, which I agree with.
Post your thought's.
The following function could find any tool in the Inventory by simply specifying the correct bitmap to search for.
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;
So, by generalizing the name to something like 'InvItemExists()' (credits to Coh3n for that) and making it take in a bitmap parameter we could eliminate a good amount of repeated code in the include.
Coh3n also said that if this were to be done, it would fit best in Inventory.simba, which I agree with.
Post your thought's.