that will return how many you've got of the DTM (Yellow Text)
so not like countitemsdtm but an stock.
Thank You!
that will return how many you've got of the DTM (Yellow Text)
so not like countitemsdtm but an stock.
Thank You!
~Hermen
Maybe use GetTextAt by using StatChars (I think it is)
That is an how many of it exist not the yellow number count if im right.
Edit:
what is the fastest way?
Result:= GetAmount(ItemCoordsDtm('Bank',DTM))> 13;
I know why that is not working but maybe you got an idea?
~Hermen
Here
SCAR Code:{*******************************************************************************
function GetAmount(itemx, itemy: Integer): Integer;
By: masquerader || Improved by Freddy1990 ||Updated June 4 2007 by Boreas || Fixed by Mr. Freeweed
Description: Returns the ammount of an item at a certain position.
*******************************************************************************}
function GetAmount(itemx, itemy: Integer): Integer;
//uses font cropped to work with "Opponent's Offer"
//you can get the coords from using IsTextInAreaEx w/ StatChars, but
//you probably shouldnt use this function directly (other functions use it)
//'K' and 'M' work (for approx values)
//non-stackable =1
//blank = 0
var
amountstr: string;
tempx, tempy, color: Integer;
begin
if findcolor(tempx, tempy, 65535, itemx, itemy, itemx + 10, itemy + 10) then
color := 65535;
if color = 0 then
if findcolor(tempx, tempy, 16777215, itemx, itemy, itemx + 10, itemy + 10) then
color := 16777215;
if color = 0 then
if findcolor(tempx, tempy, 8453888, itemx, itemy, itemx + 10, itemy + 10) then
color := 8453888;
amountstr := TrimOthers(GetTextAtEx(itemx, itemy + 4, 0, tradeChars, False, False, 0, 2, color, 10, True, tr_AlphaNumericChars));
if (Length(amountstr) > 0) then
begin
if (Pos('K', amountstr) > 0) then
begin
Delete(amountstr, Length(amountstr), Length(amountstr));
Result := StrToInt(amountstr) * 1000;
end else
if (Pos('M', amountstr) > 0) then
begin
Delete(amountstr, Length(amountstr), Length(amountstr));
Result := StrToInt(amountstr) * 1000000;
end else
Result := StrToInt(amountstr);
end else
if (FindColor(tempx, tempy, 65536, itemx, itemy, itemx + 30, itemy + 30)) then
Result := 1;
end;
Naum your posts are getter wurser and wurser read the first post and i already fixed it.
~Hermen
How they are getting more worse Heres a nice link for you
You could have edited your First post to say you had fixed it......
Thanks.
This is how i managed it once in one of my scripts.... I dont know whether the standards and such are correct... But it works !
SCAR Code:if FindDTM(DTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
i:=15
repeat
Amount:=GetTextAtEx(x-i, y-i, 20, statchars, false, false, 0, 1, 65535, 5, false, tr_AlphaNumericChars);
Amount:=trim(TrimOthers(Amount));
i:=i+1;
until not(Amount='') or (i=21);
if not (Amount='') then
begin
Writeln(Amount+' Instances');
end;
end;
EDIT: Remember to Declare vars: x,y,i,Amount:integer;
Project: Welcome To Rainbow
sure buddy![]()
please credit
Project: Welcome To Rainbow
There are currently 1 users browsing this thread. (0 members and 1 guests)