Yoko

All sides of Injection
It is currently 2025-11-13 23:13:57

All times are UTC+02:00




Post new topic  Reply to topic  [ 25 posts ]  Go to page Previous 1 2
Author Message
 Post subject:
PostPosted: 2006-07-15 23:22:46 
Offline

Joined: 2004-12-14 14:55:12
Posts: 34
Grin wrote:
ground - с маленкой буквы...
Скрипт похорошему надо переписать... всякие лишни репиты и венды весячие...

Ет видел. пока черновая просто. сё будет


Top
   
 Post subject:
PostPosted: 2006-07-15 23:29:11 
Offline
Expert!
User avatar

Joined: 2004-04-04 11:13:54
Posts: 1205
Location: Балаково, Саратовская обл.
Вот набросок для твоего дворника:
Code:
sub test()
   VAR shmot='0x0000' ; tip smota
   VAR count=0 ; s4et4ik
   VAR sunduk='0x00000000' ; serial sunduka s pustimy meshkami
   VAR sunduk2='0x00000000' ; serial sunduka s polnimi meshkami
   VAR meshok='0x0000' ; tip meshka
   VAR curent ; serial meshka v kototii kidaem
   VAR waittime=500 ; vremya pausy
   VAR max=100 ; kol-vo predmetov
UO.UseObject(sunduk)
UO.UseObject(sunduk2)
   While NOT UO.Dead()
      UO.FindType(meshok,-1,sunduk)
      wait(waittime)
      curent=UO.GetSerial('finditem')
      UO.Moveitem('finditem',1.sunduk2)
      wait(waittime)
      For count=1 to max
         UO.Findtype(shmot,-1,'ground')
         wait(waittime)
         If UO.Findcount() Then
            UO.Moveitem('finditem',1,curent)
            wait(waittime)
         Else
            count=count-1
         Endif
      Next
   Wend
end sub



Last edited by Savage on 2006-07-15 23:32:00, edited 2 times in total.

Top
   
 Post subject:
PostPosted: 2006-07-15 23:30:26 
Offline

Joined: 2004-12-14 14:55:12
Posts: 34
Grin wrote:
ground - с маленкой буквы...
Скрипт похорошему надо переписать... всякие лишни репиты и венды весячие...

Не находит всё равно(


Top
   
 Post subject:
PostPosted: 2006-07-15 23:33:14 
Offline

Joined: 2004-12-14 14:55:12
Posts: 34
Кстать из за чего могут вещи виснуть на курсоре? АОС может быть?



UO.FindType(Map,-1,'ground')
If UO.GetQuantity('finditem')>0 then
UO.MoveItem( 'finditem',1,MeshSer)
wait( 2000 )

Вот что здесь не так? селал как вы писали! и не видит на полу хоть убейся! тип итема верный


Top
   
 Post subject:
PostPosted: 2006-07-28 16:46:23 
Offline
Expert!
User avatar

Joined: 2004-07-04 00:14:58
Posts: 1284
подчёт заданных айтемов в заданном контейнере [код AGRSа]
Code:
Sub get_amount(Type, Color, Cont)
var item_amount = 0
   UO.UseObject(Cont)
   CheckLag()
   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)
      end if
   until UO.FindCount()<1
   UO.IgnoreReset()
   return item_amount
end sub

обёртка к предыдущему скрипту на перекладку.
в месте назначения (destPack) будет лежать заданное кол-во (qGood) айтемов (tGood,cGood). если в исходном(resPack) и в конечном паках нет заданых айтемов - вернёт falseб иначе - true.
Писалось под специфичную задачу, переделать под требуемое - думаю не проблема.
Code:
Sub getGoods(tGood,cGood,qGood,resPack,destPack)
var t,z
   t = get_amount(tGood,cGood,uo.getSerial(destPack))
   while t < qGood
      z = grabContainer(tGood,cGood,qGood-t,resPack)
      if (z + t) == 0 then
         return false
      end if
      if z == 0 then
         return true
      end if
      t = get_amount(tGood,cGood,uo.getSerial(destPack))
   wend
   return true
end sub

NB! если берёшь из реально больших пачек надо обработать ситуёвину когда может возникнуть необходимость взять 1 айтем из пачки.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 25 posts ]  Go to page Previous 1 2

All times are UTC+02:00


Who is online

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