кукинг глючный но рабочий ХЕЛП)

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
ALODAR
Posts: 12
Joined: 2007-05-01 17:27:42

кукинг глючный но рабочий ХЕЛП)

Post by ALODAR »

работает , но часто тупо останавливаеться и тупит ...
Могучие , помогите :)

Code: Select all

sub cooking() 
   VAR Sunduk = '0x400C69D9' 
   VAR Hvorost = '0x0DE1' 
   VAR Koster = '0x0DE3' 
   VAR Ugli = '0x0DE9' 
   VAR Fish = '0x097A' 
   VAR FishGot = '0x097B' 
   VAR TX = 1805
   VAR TY = 358 
   VAR i, flag 
   VAR SpiritTime = UO.Timer() 
   UO.CancelTarget() 
   UO.Print('1')
   UO.Exec( 'set finddistance 3' ) 
   UO.Print('2')
      UO.SetGlobal( 'TimeProcess', str( UO.Timer() ) ) 
      UO.Print('')
   UO.UseObject( Sunduk ) 
   UO.Print('3')
   While UO.SkillVal( 'Lockpiking' ) < 1000 
   UO.Print('4')
      wait(1000) 
      UO.Print('5')
      UO.FindType( Hvorost, -1, Sunduk ) 
      UO.Print('6')
      If UO.FindCount() == 0 Then 
      UO.Print('7')
         UO.Print( 'No kindling found. Script terminated' ) 
         return 
      Endif 
      UO.MoveItem( 'finditem', '1', 'ground', str(TX), str(TY), str(UO.GetZ()) ) 
      wait(1000) 
      #CheckLag() 
      UO.Findtype( Hvorost, -1, 1 ) 
;      wait(1000) 
      If UO.FindCount() > 0 Then 
         repeat
         wait(200)
            UO.UseFromGround( Hvorost ) 
            wait(1000) 
            UO.FindType( Koster, -1, 1 ) 
         until UO.FindCount() > 0 
         ; костер горит 
         flag = 1 
         repeat 
            ; взять из сундука 1 стейк 
            If UO.Count( Fish ) == 0 Then 
               UO.FindType( Fish, -1, Sunduk ) 
               If UO.FindCount() == 0 Then 
                  UO.Print( 'No fish steaks found. Script terminated' ) 
                  return 
               Endif 
               UO.Grab( '100', 'finditem' ) 
;               repeat 
;                  wait(1000) 
;               until UO.Count( Fish ) > 0 
               wait(1000) 
               ##CheckLag() 
            Endif 
            ; теперь проверим не погас ли костер, не исчезли ли угли 
            UO.FindType( Koster, -1, 1 ) 
            If UO.FindCount() <> 0 Then 
               ; еще горит костер - жарим на нем стейк 
               If UseSteake( Fish, UO.GetSerial('finditem') ) Then 
                  flag = 0 
               Endif 
               ; стейк готов 
            Else 
               UO.FindType( Ugli, -1, 1 ) 
               If UO.FindCount() <> 0 Then 
                  ; есть еще угли! 
                  if UseSteake( Fish, UO.GetSerial('finditem') ) then 
                     flag = 0 
                  endif 
               Else 
                  flag = 0 
               Endif 
            Endif 
            If UO.Count( FishGot ) > 0 Then 
               UO.FindType( FishGot ) 
               UO.MoveItem( 'finditem', -1, Sunduk ) 
;               repeat 
;                  wait(100) 
;               until UO.Count( FishGot ) == 0 
               wait(1000) 
               #CheckLag() 
            Endif 
         until flag == 0 
      Endif 
   Wend 
endsub 

Sub UseSteake( fish, koster ) 
  VAR msg1 = 'You burn the food'            ; физл 
   VAR msg2 = 'The previous piece'         ; успех 
   VAR msg22 = 'Mmm, smells good...'      ; успех 
   VAR msg3 = 'You must wait'               ; ждать 
   VAR msg4 = "You can't see the target" 
   repeat 
      uo.DeleteJournal (msg1 ) 
    
      uo.DeleteJournal (msg4 ) 
      UO.WaitTargetObject( 'finditem' ) 
      UO.UseType( Fish ) 
      repeat 
         wait(500) 
      until UO.InJournal(msg1) OR UO.InJournal(msg2) OR UO.InJournal(msg22) OR UO.InJournal(msg3) OR UO.InJournal(msg4) 
      if UO.InJournal(msg1) then 
         return 1 
      endif 
      if UO.InJournal(msg3) then 
      uo.DeleteJournal (msg3 ) 
         wait(500) 
      endif 
   until UO.InJournal(msg2) OR UO.InJournal(msg22) 
   wait(1000)
   return 0 
endsub 

sub NechegoDelat() 
   SpSpeak() 
   VAR SpiritTime = UO.Timer() 
   repeat 
      If ( UO.Timer() - SpiritTime ) / 600 > 5 Then 
         ; Прошло 5 минут с момента последней прокачки Spirit Speak 
         SpSpeak() 
         SpiritTime = UO.Timer() 
      Else 
         wait(500) 
      Endif 
   until UO.Dead() 
endsub 

sub CheckLag() 
  UO.WarMode("0")
uo.click('backpack') 
while not uo.injournal('backpack') 
  wait(100) 
wend 
uo.deletejournal('backpack') 
end sub 
Post Reply