Yoko

All sides of Injection
It is currently 2025-11-23 17:28:35

All times are UTC+02:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 2004-07-07 15:40:38 
Offline
User avatar

Joined: 2004-06-18 09:03:31
Posts: 83
Code:
################################### 
#        Скрипт для Крафтов       #
# (В данном случае для Tailoring) #
###################################

;|---------------------------|
;| Описание переменных Items |
;|---------------------------|

VAR EQ,RQ1,RQ2,QB
VAR Eat='0x097B' ; Type Еда (Рыба)
VAR Res1='0x175D' ; Type Ресурс 1 (Ткань)
VAR Res2='0x0FA0' ; Type Ресурс 2 (Нитки)
VAR Kit='0x0F9D' ; Type Инструмента крафта (Sewing Kit)
VAR Items='0x1F03' ; Type Выходного материала
EQ=50 ; Количество ресурса 1
RQ1=150 ; Количество ресурса 1
RQ2=20 ; Количество ресурса 1
QB=32 ; Количество сумок в ContainerBag

;|---------------------------------|
;| Описание переменных контейнеров |
;|---------------------------------|

VAR ContainerRes='0x416BFC21' ; Object Контейнер с ресурсами
VAR ContainerBag='0x4158965B' ; Object Контейнер с сумками
VAR BagCount='0x0E76' ; Type сумок в контейнере ContainerBag


sub main()
   UO.Set('quiet','1')
   UO.Exec('exec Craft')
   UO.IgnoreReset()
end sub

sub OpenBag()
   VAR i,BagID
   UO.UseObject(ContainerBag)
   UO.UseObject(ContainerRes)
   UO.IgnoreReset()
   Repeat
      UO.DeleteJournal()
      Wait(1000)
      UO.FindType(BagCount,'-1',ContainerBag)
      If UO.FindCount('finditem') > 1 Then
         i = (UO.FindCount('finditem') +1)
         UO.Click('finditem')
         If UO.InJournal("a bag") Then
            BagID=UO.JournalSerial(UO.InJournal("a bag")-1)
            UO.SetJournalLine(UO.InJournal("a bag")-1,"")
            UO.FindType(Items,'-1',BagID)
            UO.UseObject(BagID)
            Wait(2000)
            UO.Hide(BagID)
            UO.Ignore(BagID,'on')
         EndIF
      EndIf
      i = (i - 1)
   Until i == 0
   UO.Hide(ContainerBag)
   UO.Hide(ContainerRes)
   UO.Resend()
   Wait(3000)
   UO.IgnoreReset()
end sub


sub Craft()
VAR Last=0,LastTimer
   OpenBag()
   While NOT UO.Dead()

;|-----------------------------------|
;| Search of resources and Take them |
;|-----------------------------------|

      UO.FindType(Eat,'-1','me')
      If UO.GetQuantity('finditem') < 1 then
         UO.FindType(Eat,'-1',ContainerRes)
         If UO.GetQuantity('finditem') > 1 then
            ToTake(3)
         Else
            UO.Exec ('Terminate Craft')
         EndIf
      Else
         ToEat()
      EndIf
      UO.FindType(Res1,'-1','me')
      If UO.GetQuantity('finditem') < 16 then
         UO.FindType(Res1,'-1',ContainerRes)
         If UO.GetQuantity('finditem') > 1 then
            ToTake(1)
         Else
            UO.Exec ('Terminate Craft')
         EndIf
      EndIf
      UO.FindType(Res2,'-1','me')
      If UO.GetQuantity('finditem') < 1 then
         UO.FindType(Res2,'-1',ContainerRes)
         If UO.GetQuantity('finditem') > 1 then
            ToTake(2)
         Else
            UO.Exec ('Terminate Craft')
         EndIf
      EndIf

;|-------------|
;| Craft Items |
;|-------------|

      UO.DeleteJournal()
      UO.WaitTargetType(Res1)
      UO.UseType(Kit)
      UO.WaitMenu ('Cloth','Shirts','Shirts','robe') ; Название КрафтМеню1(Cloth),ПодМеню2(Shirts) -> КрафтМеню2(Shirts),ПодМеню2(Robe)
      LastTimer=UO.Timer()
      Repeat
         wait(100)
      Until UO.InJournal("You put") OR UO.InJournal("Tailoring") OR LastTimer+150<UO.Timer()
      UnLoadItem()
   Wend
end sub

sub ToTake(i)
VAR G,F
   If i == 1 Then
      G = RQ1
      F = Res1
   EndIf
   If i == 2 Then
      G = RQ2
      F = Res2
   EndIf
   If i == 3 Then
      G = EQ
      F = Eat
   EndIf
   UO.FindType(F,'-1',ContainerRes)
   if UO.GetQuantity('finditem') > 1 then
         UO.Grab(''+str(G)+'','finditem')
         UO.DeleteJournal()
      Repeat
         UO.FindType(F,'-1','me')
         Wait(1500)
      Until UO.InJournal("That is too") OR UO.GetQuantity('finditem') > 1
   endif
end sub   
         
sub ToEat()
   UO.UseType(Eat)
end sub

sub UnLoadItem()
   VAR BagID
   VAR i=0
   VAR m=0
   Repeat
      UO.DeleteJournal()
      UO.FindType(BagCount,'-1',ContainerBag)
      UO.Click('finditem')
      m = 0
      Repeat
         Wait(1000)
      Until UO.InJournal("a bag")
      If UO.InJournal("a bag") Then
         BagID=UO.JournalSerial(UO.InJournal("a bag")-1)
         UO.SetJournalLine(UO.InJournal("a bag")-1,"")
         UO.FindType('-1','-1',BagID)
         If UO.FindCount('finditem') < 220 then
            m = UO.FindCount('finditem')
            UO.SetReceivingContainer(BagID)
            UO.FindType(Items,'-1','me')
            UO.Grab('0','finditem')
            UO.ConColor('0x0021')
            UO.Set('quiet','0')
            UO.Print(UO.Print('In BagPack#'+Str(i+1)+' items '+Str(m)+''))   
            UO.Set('quiet','1')
            UO.ConColor('0x0035')
            Wait(1000)
            UO.UnSetReceivingContainer()
         Else
            i = i + 1
            UO.Ignore(BagID, 'on')
         EndIf
      EndIf       
      If i == QB Then
         UO.IgnoreReset()
         i = 0
      EndIf
      UO.FindType(Items,'-1','me')
   Until UO.FindCount('finditem') < 1
end sub


он не делает итемы помогите мне где тут ошибка


Top
   
 Post subject:
PostPosted: 2004-07-07 16:42:05 
Offline

Joined: 2004-04-23 13:50:10
Posts: 62
это для о1 ?


Top
   
 Post subject:
PostPosted: 2004-07-07 18:08:36 
Offline
User avatar

Joined: 2004-06-18 09:03:31
Posts: 83
Скрипт wrote:
это для о1 ?


да


Top
   
 Post subject:
PostPosted: 2004-07-07 20:13:23 
Offline

Joined: 2004-04-23 13:50:10
Posts: 62
а дай аську


Top
   
 Post subject:
PostPosted: 2004-07-07 21:28:58 
Offline
User avatar

Joined: 2004-06-18 09:03:31
Posts: 83
Скрипт wrote:
а дай аську



240076444


Top
   
 Post subject:
PostPosted: 2004-07-08 21:29:11 
Offline

Joined: 2004-05-22 16:29:37
Posts: 19
хех опять удалили Юзеровские копирайты, а скрипт этот отлично работает, главное чтобы там были сумки а не Belt Pounch


Top
   
 Post subject:
PostPosted: 2004-07-08 22:51:31 
Offline
User avatar

Joined: 2004-06-18 09:03:31
Posts: 83
Shahe wrote:
хех опять удалили Юзеровские копирайты, а скрипт этот отлично работает, главное чтобы там были сумки а не Belt Pounch


у меня как раз Belt Pounch


Top
   
 Post subject:
PostPosted: 2004-10-26 08:55:10 
Offline
User avatar

Joined: 2004-09-25 04:16:39
Posts: 22
Блин он у меня тоже лагает :(
Все ID нормально прописал, а он тока отрыкает сундуки и пустую сумку и все :(

Помогите плзз!!!!!


Top
   
 Post subject:
PostPosted: 2004-10-26 09:01:49 
Offline
User avatar

Joined: 2004-09-25 04:16:39
Posts: 22
Хех ладно все я разобрался сам :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 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