Если в бекпаке находит пустые бутылки, то достаёт из сундука кег и наливает из него все найденые в бекпаке пустые бутылки, после чего кидает кег назад в сундук.....

Moderators: Murderator+, Murderator
Code: Select all
sub Keg()
VAR Sunduk = '' ; внести айди сундука с кегом
VAR Keg = '0x1940'
VAR Bottle = '0x0F0E'
VAR BottleSerial, k
UO.FindType( Bottle, -1, -1 )
If UO.FindCount() > 0 Then
UO.FindType( Keg, -1, Sunduk )
If UO.FindCount() = 0 Then
UO.Print('Potion Keg not found, script terminated!')
UO.Exec('terminate Keg')
EndIf
UO.Grab( '1', 'finditem' )
CheckLag()
While UO.Count( Bottle ) > 0
UO.DeleteJournal()
BottleSerial = UO.GetSerial( Bottle )
UO.WaitTargetObject( BottleSerial )
UO.UseType( Keg )
k = 0
while NOT UO.InJournal('You put') AND NOT UO.InJournal('fail') AND NOT UO.InJournal('can't use this yet!') AND ( k < 30 )
k = k + 1
wait(500)
wend
Wend
UO.FindType( Keg, -1, -1 )
UO.Move('finditem', 0, Sunduk)
end sub
так пробуйflake wrote:Ну вот, набросал. Тести:Code: Select all
sub Keg()
VAR Sunduk = '' ; внести айди сундука с кегом
VAR Keg = '0x1940'
VAR Bottle = '0x0F0E'
VAR BottleSerial, k
UO.FindType( Bottle, -1, -1 )
If UO.FindCount() > 0 Then
UO.FindType( Keg, -1, Sunduk )
If UO.FindCount() = 0 Then
UO.Print('Potion Keg not found, script terminated!')
UO.Exec('terminate Keg')
EndIf
UO.Grab( '1', 'finditem' )
CheckLag()
While UO.Count( Bottle ) > 0
UO.DeleteJournal()
BottleSerial = UO.GetSerial( Bottle )
UO.WaitTargetObject( BottleSerial )
UO.UseType( Keg )
k = 0
while NOT UO.InJournal('You put') AND NOT UO.InJournal('fail') AND NOT UO.InJournal("can't use this yet!") AND ( k < 30 )
k = k + 1
wait(500)
wend
Wend
UO.FindType( Keg, -1, -1 )
UO.Move('finditem', 0, Sunduk)
end if
end sub
Code: Select all
If UO.FindCount() = 0 Then
Code: Select all
sub Keg()
VAR Sunduk = '' ; внести айди сундука с кегом
VAR Keg = '0x1940'
VAR Bottle = '0x0F0E'
VAR BottleSerial, k
UO.FindType( Bottle, -1, -1 )
If UO.FindCount() > 0 Then
UO.FindType( Keg, -1, Sunduk )
If UO.FindCount() == 0 Then
UO.Print('Potion Keg not found, script terminated!')
UO.Exec('terminate Keg')
EndIf
UO.Grab( '1', 'finditem' )
CheckLag()
While UO.Count( Bottle ) > 0
UO.DeleteJournal()
BottleSerial = UO.GetSerial( Bottle )
UO.WaitTargetObject( BottleSerial )
UO.UseType( Keg )
k = 0
while NOT UO.InJournal('You put') AND NOT UO.InJournal('fail') AND NOT UO.InJournal("can't use this yet!") AND ( k < 30 )
k = k + 1
wait(500)
wend
Wend
UO.FindType( Keg, -1, -1 )
UO.Move('finditem', 0, Sunduk)
end if
end sub