Yoko

All sides of Injection
It is currently 2025-12-24 19:42:22

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 2005-04-29 05:21:31 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Вобщем у меня скрипт, я вот думаю, как бы задавать поменьше данных, и вообще, чтобы было все проще. :P

Я интересуюсь, мона пересчитать все предметы, через некоторое время пересчитать еще раз и узнать тип/ID вновь прибывшего придмета?

_________________
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


Last edited by Destruction on 2005-05-04 01:41:07, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2005-04-29 06:47:14 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
Да кстати, у меня тоже проблема с подсчетом. Как посчитать число вещей в кучке которая не в рюкзаке моего персонажа?
UO.FindType() - возвращает число кучек
UO.Count() - возвращает количество в рюкзаке


Top
   
 Post subject:
PostPosted: 2005-04-29 08:39:10 
Offline
Expert!
User avatar

Joined: 2004-07-04 00:14:58
Posts: 1284
Beyonder wrote:
Да кстати, у меня тоже проблема с подсчетом. Как посчитать число вещей в кучке которая не в рюкзаке моего персонажа?
UO.FindType() - возвращает число кучек
UO.Count() - возвращает количество в рюкзаке
FindCount - кол - во кучек
GetQuantity - кол-во айтемов в кучке.

ЗЫ AGRS выкладывал подсчёт предметов в указаном контейнере, ищи по слову amount - вроде как ;)
или жди до вечера - выложу... если не забуду ;)


Top
   
 Post subject:
PostPosted: 2005-04-29 09:16:24 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
Сенкс.


Top
   
 Post subject:
PostPosted: 2005-04-29 09:21:49 
Offline
Expert!
User avatar

Joined: 2004-08-11 23:56:17
Posts: 746
Location: The Citadel
Вы, наверное, об этом:

Code:
# Скрипт для подсчета всех объектов в любом 
# контейнере. Запращивает прицел на
# контейнер. Потом считает объекты в контейнере и выдает на
# экран результат.
# (c) Edred, based on unknown script
#####################################################################
sub CountResource()
   VAR ContSer, last
   UO.Print( 'Click target to container' )
   UO.Info( 'self' )
   last = UO.GetSerial( 'lasttarget' )
   UO.CancelTarget()
   UO.Info()
   while last == UO.GetSerial( 'lasttarget' ) AND UO.Targeting()
      wait(100)
   wend
   ContSer = UO.GetSerial( 'lasttarget' )
   UO.FindType( -1, -1, ContSer )
   UO.Print( 'I find ' + str( UO.FindCount() ) + ' items' )
endsub


Top
   
 Post subject:
PostPosted: 2005-04-29 09:34:48 
Offline
Expert!
User avatar

Joined: 2004-07-04 00:14:58
Posts: 1284
flake wrote:
Вы, наверное, об этом:
я - нет.


Top
   
 Post subject:
PostPosted: 2005-04-29 12:31:38 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
UO.FindType( -1

Вот именно об этом! Пасибо :!:

_________________
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


Last edited by Destruction on 2005-05-04 01:40:52, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2005-04-29 12:42:49 
Offline
Expert!
User avatar

Joined: 2004-07-04 00:14:58
Posts: 1284
я вот это имел ввиду.
ЗЫ слизано у AGRS'a и адаптировано для своих нужд ;)
Code:
var idBag
   uo.addobject('objBag')
   while uo.targeting()
      wait(100)
   wend
   idBag = UO.GetSerial('objBag')
   UO.UseObject(idBag)
   uo.addobject('objItem')
   while uo.targeting()
      wait(100)
   wend
uo.TextOpen()
uo.TextPrint('All: '+STR(get_amount(UO.GetGraphic('objItem'),UO.GetColor('objItem'),idBag)))
end Sub

Sub get_amount(Type, Color, Cont)
Var item_amount = 0
   UO.IgnoreReset()
   Repeat
      UO.FindType(Type, Color, Cont)
      If UO.FindCount()>0 Then
         If UO.GetQuantity('finditem')==0 Then
            item_amount = item_amount + 1
         Else
            item_amount = item_amount + UO.GetQuantity('finditem')
         End If
         UO.Ignore('finditem')
         UO.FindType(Type, Color, Cont)
      EndIf
   Until UO.FindCount()<1
   UO.IgnoreReset()
   Return item_amount
END Sub


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 4 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