I've been having some trouble with getStoreAmount in the Item file. I am using a bitmap to find the item, and then call getStoreAmount but it rarely returns the correct value.
Here is what I am using now, a custom function.
Simba Code:
function getStoreAmount(x1, y1, x2, y2 : integer) : Integer;
var
click : Integer;
S : String;
begin
S := (GetTextAtEx(x1, y1, x2, y2, 0, 3, 2, 65535, 0, 'StatChars07'));
case Lowercase(S) of
'':
result := 1;
'0':
result := 0;
'~':
begin
writeln('no amount found, terminating script');
TerminateScript;
end;
else
result := StrToInt(S);
end;
end;
If any of you want to use this feel free to.
I would also like to ask if there is a better way to write this function then please PM it to me.
Perhaps I am not using Flight's function getStoreAmount properly either, if it works for others I'd like to hear that as well.