Траблы
Posted: 2006-04-09 12:28:34
Взял скрипт у Асканели, выбросил все что мне ненадо, но возникла другая проблема.. Что и куда надо вставить, для того чтоб при достижении определенного веса - чар скидывал химию в сундук, где лежат реги, ботлы и т.д.
Code: Select all
VAR Sunduk=''
VAR LastTimer
sub Alchemy()
var i=0
uo.useobject('backpack')
uo.cancelmenu()
uo.automenu('What sort of potion do you want to','(last)')
uo.useobject(Sunduk)
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('0x0F0E','0x0000','backpack')
While UO.GetQuantity('finditem')<20
UO.FindType('0x0F0E','0x0000',Sunduk)
wait(200)
UO.Grab('100','finditem')
wait(200)
Wend
UO.FindType('0x0F85','0x0000','backpack')
While UO.GetQuantity('finditem')<20
UO.FindType('0x0F85','0x0000',Sunduk)
wait(200)
UO.Grab('100','finditem')
wait(200)
Wend
uo.deletejournal()
LastTimer=UO.Timer()
uo.usetype('0x0F85','0x0000')
repeat
Wait(10)
until UO.InJournal("You put the") OR UO.InJournal("You toss the failed") OR (UO.Timer()>LastTimer+200)
if uo.weight > 200 then
UO.SetReceivingContainer(Sunduk)
wait(200)
UO.Grab('all','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