
Code: Select all
sub cooking()
VAR Sunduk = '0x40591B82'
VAR Hvorost = '0x0DE1'
VAR Koster = '0x0DE3'
VAR Ugli = '0x0DE9'
VAR Fish = '0x097A'
VAR FishGot = '0x097B'
VAR TX = 1873
VAR TY = 387
VAR i, flag
VAR SpiritTime = UO.Timer()
UO.CancelTarget()
UO.Exec( 'set finddistance 3' )
UO.SetGlobal( 'TimeProcess', str( UO.Timer() ) )
UO.UseObject( Sunduk )
While UO.SkillVal( 'Cooking' ) < 1000
; EatChar( Sunduk, 2, 1, 120 )
# ----------------------------------
# блок запуска прокачки Spirit Speak
If ( UO.Timer() - SpiritTime ) / 600 > 5 Then
; Прошло 5 минут с момента последней прокачки Spirit Speak
SpSpeak()
SpiritTime = UO.Timer()
Endif
# ----------------------------------
wait(1000)
UO.FindType( Hvorost, -1, Sunduk )
If UO.FindCount() == 0 Then
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
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( '1', 'finditem' )
; repeat
; wait(100)
; 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 to a crips'It's ruined!' ; физл
VAR msg2 = 'Mmm,smells good' ; успех
VAR msg22 = 'You put the fish steaks' ; успех
VAR msg3 = 'The previous piece is still not ready' ; ждать
VAR msg4 = "You can't see the target"
repeat
UO.DeleteJournal (msg1 )
UO.DeleteJournal (msg2 )
UO.DeleteJournal (msg22 )
UO.DeleteJournal (msg3 )
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(msg4) then
return 1
endif
if UO.InJournal(msg3) then
wait(500)
endif
until UO.InJournal(msg2) OR UO.InJournal(msg22)
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