Yoko

All sides of Injection
It is currently 2025-10-14 22:54:27

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Tailoring script
PostPosted: 2004-05-20 11:49:05 
Offline

Joined: 2004-04-16 00:56:28
Posts: 19
Вобщем я затевал скрипт для всех крафтов, но так как мне они уже не нужны я сделал только тэйлор который докачал.

вот скрипт, все настройки с верху:

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-05-20 12:29:06 
Offline
User avatar

Joined: 2004-04-03 18:39:28
Posts: 173
мне надо =) пс у тя злобний аватар ;)


Top
   
 Post subject:
PostPosted: 2004-06-12 19:29:01 
Offline

Joined: 2004-04-23 13:50:10
Posts: 62
вот дописать под оском былобы хорошо и есчо скриптов для оскома выложить :)


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

All times are UTC+02:00


Who is online

Users browsing this forum: Bing [Bot] and 2 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