uo.count

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Ghormoon
Posts: 3
Joined: 2009-08-29 00:10:09

uo.count

Post by Ghormoon »

Hello, I've got problem with uo.count, I can't fond how to search in some particular bag
i tried uo.count(type, bag) and uo.count(type, color, bag), but it still doesn't help :(
and less important thing:
Is it possible to temporarily change color of object? (like client does when you attack, but i need to have more colors on more object at time)

thanks in advance, Ghor
Successful
Posts: 174
Joined: 2008-12-13 00:00:15

Post by Successful »

uo.count() search only in backpack

viewtopic.php?t=14670&highlight=getquantity
Ghormoon
Posts: 3
Joined: 2009-08-29 00:10:09

Post by Ghormoon »

I'm getting "Unknown graphics type" error on uo.count('finditem') (if there's sollution in russian, I'm not capable of reading it)
and that version with getquantity is not the right one for items without quantity, am I right? :)
Edit: my fault, it works :)

BTW and that thing with colors is possible or not?
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

Uo.count counts your items in your backpack and also in all bags you have.
uo.count('0x0000') type or
uo.count('0x0000','0x0000') type and color

If you want to count in particular bag you should use findtype('type','color','bag') and use uo.getquantaty('finditem') if you have many items, then you should use while operator
var count=0
uo.findtype('type','color','bag')
while uo.findcount()
count=count+uo.getquantaty('finditem')
uo.findtype('type','color','bag')
wend

this should work
Ghormoon
Posts: 3
Joined: 2009-08-29 00:10:09

Post by Ghormoon »

yes, i understood this from the link (on second attempt :D) and it works
I've got it bit different, simplified, so it count up to 1, but I only need to know if the item is is maing bag more times (find, move, ingore, count again) but i had problem when it was in sub-bag, this was only solution :)
Post Reply