finditem something in bank

Ask for help
Post Reply
mixers
Neophyte
Neophyte
Posts: 49
Joined: 03.10.2013 14:11

finditem something in bank

Post by mixers »

Code: Select all

Program New;
 const
   book = $2252;
begin
 //Body of Script   
//findtypeex(book,$0000,banklayer,false);
findtype(book,banklayer);
countex(book,$0000,banklayer);
addtosystemjournal(inttostr(FindQuantity));
end.
findquantity value is 0
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: finditem something in bank

Post by drabadan »

mixers wrote:

Code: Select all

Program New;
 const
   book = $2252;
begin
 //Body of Script   
//findtypeex(book,$0000,banklayer,false);
findtype(book,banklayer);
countex(book,$0000,banklayer);
addtosystemjournal(inttostr(FindQuantity));
end.
findquantity value is 0

Code: Select all

findtype(book,ObjAtLayer(banklayer));
User avatar
Vizit0r
Developer
Developer
Posts: 3956
Joined: 24.03.2005 17:05
Contact:

Re: finditem something in bank

Post by Vizit0r »

ObjAtLayer(banklayer) not always return real bank container. Sometimes (really, not often) it can differ.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Crome696
Novice
Novice
Posts: 67
Joined: 04.03.2012 18:57
Location: Germany
Contact:

Re: finditem something in bank

Post by Crome696 »

Take Info from Item in Bank and Check Parent may help ( untested ) Then you have ID of BankContainer..
Stealth Development Team & Support
User avatar
Vizit0r
Developer
Developer
Posts: 3956
Joined: 24.03.2005 17:05
Contact:

Re: finditem something in bank

Post by Vizit0r »

Crome696 wrote:Take Info from Item in Bank and Check Parent may help ( untested ) Then you have ID of BankContainer..
yes, that is much better way.

Code: Select all

if GetParent(ItemID) > 0 then
  BankBox := GetParent(ItemID;
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply