Yoko

All sides of Injection
It is currently 2025-10-18 01:42:19

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2009-04-07 16:12:04 
Offline

Joined: 2006-02-10 13:26:37
Posts: 173
Пытаюсь сделать небольшой скриптик на проверку кол-ва реагентов в сундуке.

Code:
sub chekss()
VAR bpearl = '0x0F7A'
VAR sunduks = '0x40221ABF'
UO.FindType(bpearl,'0x0000',sunduks)
UO.Print(STR(UO.count('finditem'))+" bp")
end sub


Запускаю - пишет "Unknow graphic type" и ниже "0 bp"

_________________
Shard: Dragon World


Top
   
 Post subject:
PostPosted: 2009-04-07 16:41:10 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
http://yoko.netroof.net/help/help.php?l ... item=Count

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2009-04-07 17:16:15 
Offline

Joined: 2006-02-10 13:26:37
Posts: 173
Я так понял что count ищет только в бекпаке, а findcount ищет так же и в сундуках. Изменил скрипт на:

Code:
sub chekss() 
  VAR bpearl = '0x0F7A'
  VAR sunduks = '0x40221ABF'
  UO.FindType(bpearl,'0x0000',sunduks)
  UO.Print(STR(UO.findcount('finditem'))+" bp")
end sub


Теперь же он считает кол-во предметов такого типа, но реагенты ведь "сливаются" в один предмет.

_________________
Shard: Dragon World


Top
   
 Post subject:
PostPosted: 2009-04-07 20:06:58 
Offline

Joined: 2008-12-13 00:00:15
Posts: 174
Code:
  UO.Print(str(uo.getquantity('finditem'))+" bp")


Last edited by Successful on 2009-04-07 20:20:55, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2009-04-07 20:17:51 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Ну кто так делает..

Code:
sub chekss()
     uo.print( str( my.count( '0x0F7A', '0x0000', '0x40221ABF' ) ) + " bp" )
endsub

Sub my.count( type, color, container )
    var count = 0
    uo.findtype( type, color, container )
    while uo.findcount()
        count = count + uo.getQuantity( 'finditem' )
        uo.ignore( 'finditem' )
        uo.findtype( type, color, container )
    wend
    uo.ignorereset()
    return count
endsub

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2009-04-07 20:21:48 
Offline

Joined: 2008-12-13 00:00:15
Posts: 174
уже понял )


Top
   
 Post subject:
PostPosted: 2009-04-08 15:34:22 
Offline

Joined: 2006-02-10 13:26:37
Posts: 173
Destruction
Пасиб за работу, все отлично работает!

Вот на все реагенты, если кому-нибудь пригодится:
Code:
sub chekss() 
VAR sunduks = '0x40221ABF'
     uo.print( str( my.count( '0x0F88', '0x0000', sunduks ) ) + " ns" )
     uo.print( str( my.count( '0x0F85', '0x0000', sunduks ) ) + " gi" )
     uo.print( str( my.count( '0x0F86', '0x0000', sunduks ) ) + " mr" )
     uo.print( str( my.count( '0x0F8C', '0x0000', sunduks ) ) + " sa" )
     uo.print( str( my.count( '0x0F7B', '0x0000', sunduks ) ) + " bm" )
     uo.print( str( my.count( '0x0F84', '0x0000', sunduks ) ) + " ga" )
     uo.print( str( my.count( '0x0F8D', '0x0000', sunduks ) ) + " ss" )
     uo.print( str( my.count( '0x0F7A', '0x0000', sunduks ) ) + " bp" )
end sub

Sub my.count( type, color, container )
    var count = 0
    uo.findtype( type, color, container )
    while uo.findcount()
        count = count + uo.getQuantity( 'finditem' )
        uo.ignore( 'finditem' )
        uo.findtype( type, color, container )
    wend
    uo.ignorereset()
    return count
endsub

_________________
Shard: Dragon World


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited