Знатоки помагите со скриптом

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Знатоки помагите со скриптом

Post by duk »

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

Нашел скрипт автором кот является- flake
Подскажите как исправить скрипт что бы он работал слдующим образом: бетерся пустой кег и сундука№1 потом потом в том же сундуке ищет поушен по типу найдя нужный заливает его в кег пустые бытылки кидает обратно при заполнении кега кидает его в сундук№2 и так по кругу

[Тут я был I'm]
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Code: Select all

VAR Sunduk='0x406C1757' 
VAR Sunduk2='0x40048E2F'



sub Kegi()
var i=0
uo.useobject('backpack')
uo.useobject(Sunduk)
uo.useobject(Sunduk2)
wait(1000)
while 1==1

i=i+1
if i==50 then
uo.usetype('0x097B')
wait(1000)
i=0
if uo.skillval("Spirit Speak",1)<1000 then
cheklag()
uo.print("Spirit Speak...")
LastTimer=UO.Timer()
uo.useskill ("Spirit Speak")
uo.deletejournal()
repeat
wait(10)
until UO.InJournal("You establish a connection to the netherworld.") or UO.InJournal("You fail your attempt at contacting the netherworld.") OR (UO.Timer()>LastTimer+200)
end if
end if


UO.FindType('0x0F0A','0x0000','backpack')
While UO.GetQuantity('finditem')<=0
UO.FindType('0x0F0A','0x0000',Sunduk)
wait(400)
UO.Grab('1','finditem')
wait(400)
Wend

UO.FindType('0x1940','0x0000','backpack')
While UO.GetQuantity('finditem')<=0
UO.FindType('0x1940','0x0000',Sunduk)
wait(400)
UO.Grab('1','finditem')
wait(400)
Wend






until UO.InJournal("There's no space for further potions") OR (UO.Timer()>LastTimer+200)
uo.findtype('0x1940',-1,'backpack')
uo.moveitem('finditem',0,Sunduk2)
wait(2000)


uo.findtype('0x0F0E',-1,'backpack')
uo.moveitem('finditem',0,Sunduk)
wait(2000)
uo.deletejournal()
end if
wend


if uo.weight > 400 then
UO.SetReceivingContainer(Sunduk)
wait(200)
UO.Grab('0','finditem')
wait(200)
UO.UnSetReceivingContainer()
end if
end if
end if

end sub

Попробывал сам написать но не рабатет что то так как это мой первый скрипт . Знатоки помагите ошибки исправить
[И тут я был I'm]
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Code: Select all

VAR Sunduk='0x406C1757' 
VAR Sunduk2='0x40048E2F'
VAR LastTimer

sub Alchemy()
var i=0
uo.useobject('backpack')
uo.useobject(Sunduk)
wait(400)
uo.useobject(Sunduk2)
wait(1000)
while 1==1

i=i+1
if i==50 then
uo.usetype('0x097B')
wait(1000)
i=0
if uo.skillval("Spirit Speak",1)<1000 then
cheklag()
uo.print("Spirit Speak...")
LastTimer=UO.Timer()
uo.useskill ("Spirit Speak")
uo.deletejournal()
repeat
wait(10)
until UO.InJournal("You establish a connection to the netherworld.") or UO.InJournal("You fail your attempt at contacting the netherworld.") OR (UO.Timer()>LastTimer+200)
end if
end if
UO.FindType('0x1940','0x0000','backpack')
While UO.GetQuantity('finditem')<=0
UO.FindType('0x1940','0x0000',Sunduk)
wait(1000)
UO.Grab('1','finditem')
wait(1000)
Wend

UO.FindType('0x0F0A','0x0000','backpack')
While UO.GetQuantity('finditem')<=1
UO.FindType('0x0F0A','0x0000',Sunduk)
wait(1000)
UO.Grab('1','finditem')
wait(1000)
Wend
uo.deletejournal()
LastTimer=UO.Timer()
uo.findtype('0x0F0A','0x0000','backpack')
if uo.findcount() then
uo.waittargetobject('finditem')
uo.usetype('0x1940')
wait(500)
repeat
endif
wend



if uo.weight > 200 then
UO.SetReceivingContainer(Sunduk)
wait(200)
UO.Grab('0','finditem')
wait(200)
UO.UnSetReceivingContainer()
end if
end if
end if

if UO.Weight>300 then    ;òóò óêàçûâàåòå âåñ ïðè êîòîðîì íà÷íåòñÿ ïåðåêëàäûâàíèå
uo.findtype('0x0E20',-1,'backpack')
uo.moveitem('finditem',0,Sunduk)
wait(2000)
end if
wend

wend
end sub

sub cheklag()
uo.deletejournal()
uo.click('backpack')
repeat
wait(10)
until uo.InJournal("backpack")
end sub

sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
UO.Exec('terminate Alchemy')
wait(1000)
UO.Exec('exec Alchemy')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub

sub MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub

предыдущий ваще не работал переделать попробывал
почему то в кег не заливает поушены подправьте где я ошибся

[Да и тут я был I'm]
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Code: Select all

until UO.InJournal("There's no space for further potions") OR (UO.Timer()>LastTimer+200)
uo.findtype('0x1940',-1,'backpack')
uo.moveitem('finditem',0,Sunduk2)
wait(2000)

подскажите где это воткнуть что бы полный кег скидывался в сундук№2

Code: Select all

uo.findtype('0x0F0E',-1,'backpack') 
uo.moveitem('finditem',0,Sunduk)


и куда это вставить что пустые бутылки кидал в сундук №1

[Где я тольео небыл I'm]
I'm
Expert!
Posts: 1396
Joined: 2004-10-15 22:38:04
Location: Moscow City.
Contact:

Post by I'm »

Подсказка дня: ты знаеш что есть теги но есть спецальный для этого случая.
[code]
...text...
[/code]
Askaneli
Sphere expert
Posts: 1143
Joined: 2004-10-01 08:27:38
Location: Уфа

Post by Askaneli »

I'm wrote:Подсказка дня: ты знаеш что есть теги но есть спецальный для этого случая.

Code: Select all

...text...

Фигаро там - фигаро тут. :D
Сделал дело - флуди смело !!!
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Code: Select all

VAR Sunduk='0x406C1757' 
VAR Sunduk2='0x40048E2F'
VAR LastTimer

sub keg()
var i=0
uo.useobject('backpack')

uo.useobject(Sunduk)
wait(1000)
uo.useobject(Sunduk2)
wait(1000)
while 1==1

i=i+1
if i==50 then
uo.usetype('0x097B')
wait(1000)
i=0
if uo.skillval("Spirit Speak",1)<1000 then
cheklag()
uo.print("Spirit Speak...")
LastTimer=UO.Timer()
uo.useskill ("Spirit Speak")
uo.deletejournal()
repeat
wait(10)
until UO.InJournal("You establish a connection to the netherworld.") or UO.InJournal("You fail your attempt at contacting the netherworld.") OR (UO.Timer()>LastTimer+200)
end if
end if

UO.FindType('0x1940','0x0000','backpack')
While UO.GetQuantity('finditem')<=0
UO.FindType('0x1940','0x0000',Sunduk)
wait(700)
UO.Grab('1','finditem')
wait(700)
Wend

UO.FindType('0x0F0A','0x0000','backpack')
While UO.GetQuantity('finditem')<1
UO.FindType('0x0F0A','0x0000',Sunduk)
wait(700)
UO.Grab('1','finditem')
wait(700)
Wend



uo.deletejournal()
LastTimer=UO.Timer()

 
uo.waittargettype('0x0F0A','0x0000')
uo.usetype('0x1940','0x0000')
repeat
wait(10)


if UO.Weight>100 then    ;òóò óêàçûâàåòå âåñ ïðè êîòîðîì íà÷íåòñÿ ïåðåêëàäûâàíèå
uo.findtype('0x0F0E',-1,'backpack')
uo.moveitem('finditem',0,Sunduk)
wait(2000)
end if
wend

wend
end sub


if uo.weight > 300 then
UO.SetReceivingContainer(Sunduk)
wait(200)
UO.Grab('0','finditem')
wait(200)
UO.UnSetReceivingContainer()
end if
end if
end if



wend
end sub

sub cheklag()
uo.deletejournal()
uo.click('backpack')
repeat
wait(10)
until uo.InJournal("backpack")
end sub

sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
UO.Exec('terminate Alchemy')
wait(1000)
UO.Exec('exec Alchemy')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub

sub MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub


парни момагите довести до ума скрипт или подправьте
я в инже пока ни чего не рублю

[duk есть спецальные теги code! I'm]
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

парни помаги чкрипт до ума довети, что смогя сам поправил.
я не могу понять как кег кот уже полный скидывать в сункуд№2 и брать новый кег из сундаку №1
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Держи особо не старался...
Смотри если сложится такая ситуация что бутыл ки закончились а кег не заполнился до конца то он не попадет в сундук №2 сделано из логичности хотя ты это можешь исправить

Code: Select all

sub Keg() 
VAR Sunduk1 = ''
VAR Sunduk2 = '' 
VAR Keg = '0x1940'
VAR Bottle = '0x0F0E'
VAR BottleColor = '0'
Var Count=0
while not uo.dead()
      wait(100)
      Count= uo.count(Keg)
      if Count = 0 then
             UO.FindType( Keg, -1, Sunduk1 )
             If UO.FindCount() == 0 Then
                     UO.Print('Potion Keg not found, script terminated!')
                     UO.Exec('terminate Keg')
             else
                     UO.Grab( 1, 'finditem' )
                     while uo.count(Keg) == Count
                           wait(100)
                     wend
             EndIf
UO.DeleteJournal()
UO.FindType(Bottle, BottleColor, Sunduk1)
While UO.Findcount() and not UO.InJournal('no space')
         UO.DeleteJournal()
         UO.WaitTargetObject('finditem')
         UO.UseType(Keg)
         while not UO.InJournal('You put|fail|use this yet!|no space')
            wait(100)
         wend
         UO.FindType(Bottle, BottleColor, Sunduk1)
Wend
     Count= uo.count(Keg)
      if UO.InJournal('no space') then #вот тут караз если убрать IF то кег всегда будет кидатся в сундук
          UO.MoveItem('^'+Keg, -1, Sunduk2)
          while uo.count(Keg) == Count
               wait(100)
          wend
      endif
            Count= uo.count('0x0F0E')
      If Count>0 then
           UO.MoveItem('^0x0F0E', -1, Sunduk1)
           while uo.count('0x0F0E') == Count
              wait(100)
           wend
      endif
wend
end sub
Last edited by Grin on 2005-06-01 00:25:52, edited 3 times in total.
I'm
Expert!
Posts: 1396
Joined: 2004-10-15 22:38:04
Location: Moscow City.
Contact:

Post by I'm »

duk сделай одолжение есть спец штука называется code она намного лучше чем сраное зеленое выделение!
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Grin блогодарю за содействие дубу пробывать
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

Grin если тебе не сложно поправь в моем скрипте кот чуть выше что бы он скидывал полный кег
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

а предложеный мной не работает?;)
duk
Posts: 31
Joined: 2005-04-03 14:12:12
Contact:

Post by duk »

он ошибки выдает
и надо что бы если поушенов не оказалось в сундуке№1 чар их там продолжал искать и как нашел кидал его в бекпак и в кег заливал так как другой чар будет варить пойшены и кидать в этот сундук.
так же пустые бутылки скидывать в сундук №1
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Сказалбы хоть где и какие ;) куда быстрей было бы...
Post Reply