Не получается скриптик на проверку кол-ва регов в сундуке

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
1a2a3a4a5a6a
Posts: 173
Joined: 2006-02-10 13:26:37

Не получается скриптик на проверку кол-ва регов в сундуке

Post by 1a2a3a4a5a6a »

Пытаюсь сделать небольшой скриптик на проверку кол-ва реагентов в сундуке.

Code: Select all

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
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

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.
Telegram: @tatikom
1a2a3a4a5a6a
Posts: 173
Joined: 2006-02-10 13:26:37

Post by 1a2a3a4a5a6a »

Я так понял что count ищет только в бекпаке, а findcount ищет так же и в сундуках. Изменил скрипт на:

Code: Select all

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
Successful
Posts: 174
Joined: 2008-12-13 00:00:15

Post by Successful »

Code: Select all

  UO.Print(str(uo.getquantity('finditem'))+" bp")
Last edited by Successful on 2009-04-07 20:20:55, edited 1 time in total.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Ну кто так делает..

Code: Select all

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.
Telegram: @tatikom
Successful
Posts: 174
Joined: 2008-12-13 00:00:15

Post by Successful »

уже понял )
1a2a3a4a5a6a
Posts: 173
Joined: 2006-02-10 13:26:37

Post by 1a2a3a4a5a6a »

Destruction
Пасиб за работу, все отлично работает!

Вот на все реагенты, если кому-нибудь пригодится:

Code: Select all

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
Post Reply