Yoko

All sides of Injection
It is currently 2025-10-27 19:32:23

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2006-02-24 20:53:12 
Offline

Joined: 2006-02-21 17:34:28
Posts: 19
Location: Etheral Portal
короче кормлю при разведении ламок яблокамии грушами, можно и еще чтонибудь добавить.. короче есть в паке макс 4 вариации итема..и если нет в паке то подбираю с земли..пока что написал такой скрипт, но почемуто при наличии в паке достаточного кол-ва груш (они стоят первыми в проверке) он кормит яблоками :( чтото не так... голова уже трещщит с этими файндтайпами...

Quote:
var havka1 = '0x0994'; Pears
var havka2 = '0x09D0'; Apples

sub vodopoy()
uo.exec('set finddistance 3')
var i=0, error=0

UO.DeleteJournal()
while true
If UO.InJournal("food") then
; загруз еды если мало
If UO.Count(havka1) < 15 Then
UO.Findtype(havka1, '-1','1')
If UO.FindCount() > 14 Then
UO.Grab('15','finditem')
wait(1000)
CheckLag()
error=0
Else
error=1
Endif
Endif
If error==1 AND UO.Count(havka2)<15 Then
UO.Findtype(havka2, '-1','1')
If UO.FindCount() > 14 Then
UO.Grab('15','finditem')
wait(1000)
CheckLag()
error=0
Else
error=1
Endif
Endif
if error == 1 then
uo.print("NO FOODS FOR ANIMALS!")
uo.exec('terminate vodopoy')
endif
i = uo.journalserial(uo.injournal("-15")-1)
if i == 0 then
i = uo.journalserial(uo.injournal("-15")-1)
end if
uo.ignorereset()
;передача еды опоненту
uo.findtype(havka1,-1,'backpack')
If UO.FindCount() > 14 Then
uo.moveitem(uo.getserial('finditem'),15,i)
wait(5000)
else
uo.ignorereset()
uo.findtype(havka2,-1,'backpack')
uo.moveitem(uo.getserial('finditem'),15,i)
wait(5000)
endif
UO.DeleteJournal()
i=0
End if
wait(1000)
wend
end sub


Sub CheckLag()
UO.DeleteJournal( 'backpack' )
UO.Click( 'backpack' )
repeat
wait(100)
until UO.InJournal( 'backpack' )
endsub
[/quote]


Top
   
 Post subject:
PostPosted: 2006-02-25 00:16:43 
Offline

Joined: 2006-02-21 17:34:28
Posts: 19
Location: Etheral Portal
трудно да?...понимаююю


Top
   
 Post subject:
PostPosted: 2006-02-25 00:47:53 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
потому что ты не правельно понимаешь вывод функций uo.count и uo.findcount(). Если первая ввыводит сумму стека всех объектов заданого типа
то вторая выводит только колвой найденых объектов...
допустим утебя 2 кучки грушь в одной 1 груша в другой 15
первая покажет число 16
вторая 2


Top
   
 Post subject:
PostPosted: 2006-02-25 01:51:12 
Offline

Joined: 2006-02-21 17:34:28
Posts: 19
Location: Etheral Portal
всем откликнувшимся спасибо за помошь вышло отлично и ёмко :)

зы: персональное спасибо некому KievMobile ;))


Top
   
 Post subject:
PostPosted: 2006-02-25 14:36:39 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Code:
sub vodopoy() 
var i, f, obj=''
var foodcount=2
dim food[2]
food[0]='0x0994'
food[1]='0x09D0'
   uo.exec('set finddistance 3')
   UO.DeleteJournal()
   while true
      If UO.InJournal("food") then
         ; загруз еды если мало
         f=0
         i=0
         while not f and i < foodcount
            If UO.Count(food[i]) < 15 Then
               UO.Findtype(food[i], '-1','ground')
               If UO.FindCount() > 14 Then
                  UO.Grab('15','finditem')
                  while uo.ContainerOf('finditem') <> uo.GetSerial('backpack')
                     wait(100)
                  wend
                  f=i
               End if
            else
               f=i
            End if
            i=i+1
         wend
         if not f then
            uo.print("NO FOODS FOR ANIMALS!")
            return
         end if
         obj = uo.journalserial(uo.injournal("-15")-1)
         if obj == '' then
            obj = uo.journalserial(uo.injournal("-15")-1)
         end if
         ;передача еды опоненту
         uo.findtype(food[f], -1,'backpack')
         uo.moveitem('finditem',15,obj)
         while uo.ContainerOf('finditem') == uo.GetSerial('backpack')
            wait(100)
         wend
         UO.DeleteJournal()
      End if
      wait(1000)
   wend
end sub


PS не въехал почему скрипт ВОДОПОЙ...
PSS хз что за конструкция, оставил как есть
Code:
obj = uo.journalserial(uo.injournal("-15")-1) 
if obj == '' then
obj = uo.journalserial(uo.injournal("-15")-1)
end if


Top
   
 Post subject:
PostPosted: 2006-02-25 19:54:37 
Offline

Joined: 2006-02-21 17:34:28
Posts: 19
Location: Etheral Portal
все оказалось проще гораздо)
Quote:
sub vodopoy()
dim havka[4]
havka[1] = 0x0994; Pears
havka[2] = 0x09D0; Apples
havka[3] = 0x0000; Тип хавки 3
havka[4] = 0x0000; Тип хавки 4
var horse, i, z = 0
uo.exec('set finddistance 3')
uo.deletejournal()
repeat
if uo.injournal("-15 foods") then
horse = uo.journalserial(uo.injournal("-15 foods")-1)
for i = 1 to 4
uo.findtype(havka[i],-1,'ground')
if uo.getquantity(uo.getserial('finditem')) > 14 then
uo.moveitem(uo.getserial('finditem'),15,horse)
wait(500)
CheckLag()
else
z = z + 1
endif
next
endif
uo.deletejournal()
endif

wait(2000)
until z==4
uo.print("EDA PODOSHLA K KONCU :))")
uo.exec ('terminate vodopoy')
end sub

водопой потомучто был какойто скрипт чтото я забыл про название и убил его и новый накатал :))
а конструкция это просто еще одна проверка, иногда инфо в 0х0000 показывает..повторная проба так сказать)[/quote]


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 12 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited