Подозреваю что проблема в этом куске
Code: Select all
uo.DeleteJournal()
uo.WaitTargetType(Res1)
uo.UseType(Kit)
uo.WaitMenu ('Chairs','Stool')
LastTimer=UO.Timer()
repeat
wait(100)
until uo.InJournal("You put") or uo.InJournal("Carpentry") or LastTimer+150<uo.Timer()
UnLoadItem()
wend
end sub
Но не могу понять что именно, прицел поидее создается и поидее должен юзаться на доски, но увы...
Подскажите пожалуйста в чем проблема, гуру.
Code: Select all
var EQ,RQ1,RQ2,QB
var Eat='0x097B' ; Еда
var Res1='0x1BD7' ; Доски
var Res2='0x1EB8' ; В данном случае тоже доски так как для стульев используется 1 ресурс
var Kit='0x1EB8' ; Инструмент (tool kit)
var Items='0x0A2A' ; Тип стула
EQ=50 ; кол-во еды
RQ1=200 ; кол-во ресурса 1
RQ2=0 ; кол-во ресурса 2
var ContainerRes='0x416E6CC7' ; Object с досками
var ContainerBag='0x407965C4' ; Object с сумками
var BagCount='0x0E76' ; Type сумок ContainerBag
sub Main()
uo.Set('quiet','1')
uo.Exec('exec Craft')
uo.IgnoreReset()
end sub
sub OpenBag()
var i,BagID
uo.UseObject(ContainerBag)
uo.UseObject(ContainerRes)
uo.IgnoreReset()
repeat
uo.DeleteJournal()
wait(1000)
uo.FindType(BagCount,'-1',ContainerBag)
if uo.FindCount('finditem') > 1 then
i=(uo.FindCount('finditem') +1)
uo.Click('finditem')
if uo.InJournal("a bag") Then
BagID=uo.JournalSerial(uo.InJournal("a bag")-1)
uo.SetJournalLine(uo.InJournal("a bag")-1,"")
uo.FindType(Items,'-1',BagID)
uo.UseObject(BagID)
wait(2000)
uo.Hide(BagID)
uo.Ignore(BagID,'on')
end if
end if
i=(i-1)
until i==0
uo.Hide(ContainerBag)
uo.Hide(ContainerRes)
uo.Resend()
wait(3000)
uo.IgnoreReset()
end sub
sub Craft()
var Last=0,LastTimer
OpenBag()
While not uo.Dead()
;|-----------------------------------|
;| Search of resources and Take them |
;|-----------------------------------|
uo.FindType(Eat,'-1','me')
if uo.GetQuantity('finditem')<1 then
uo.FindType(Eat,'-1',ContainerRes)
if uo.GetQuantity('finditem')>1 then
ToTake(3)
else
uo.Exec('Terminate Craft')
end if
else
ToEat()
end if
uo.FindType(Res1,'-1','me')
if uo.GetQuantity('finditem')<45 then
uo.FindType(Res1,'-1',ContainerRes)
if uo.GetQuantity('finditem')>1 then
ToTake(1)
else
uo.Exec('Terminate Craft')
end if
end if
uo.FindType(Res2,'-1','me')
if uo.GetQuantity('finditem')<1 then
uo.FindType(Res2,'-1',ContainerRes)
if uo.GetQuantity('finditem')>1 then
ToTake(2)
else
uo.Exec('Terminate Craft')
end if
end if
;|-------------|
;| Craft Items |
;|-------------|
uo.DeleteJournal()
uo.WaitTargetType(Res1)
uo.UseType(Kit)
uo.WaitMenu ('Chairs','Stool')
LastTimer=UO.Timer()
repeat
wait(100)
until uo.InJournal("You put") or uo.InJournal("Carpentry") or LastTimer+150<uo.Timer()
UnLoadItem()
wend
end sub
sub ToTake(i)
var G,F
if i==1 then
G=RQ1
F=Res1
end if
if i==2 then
G=RQ2
F=Res2
end if
if i==3 then
G=EQ
F=Eat
end if
uo.FindType(F,'-1',ContainerRes)
if uo.GetQuantity('finditem')>1 then
uo.Grab(''+str(G)+'','finditem')
uo.DeleteJournal()
repeat
uo.FindType(F,'-1','me')
wait(1500)
until uo.InJournal("That is too") or uo.GetQuantity('finditem') > 1
end if
end sub
sub ToEat()
uo.UseType(Eat)
end sub
sub UnLoadItem()
var BagID
var i=0
var m=0
repeat
uo.DeleteJournal()
uo.FindType(BagCount,'-1',ContainerBag)
uo.Click('finditem')
m=0
repeat
wait(1000)
until uo.InJournal("a bag")
if uo.InJournal("a bag") Then
BagID=uo.JournalSerial(uo.InJournal("a bag")-1)
uo.SetJournalLine(uo.InJournal("a bag")-1,"")
uo.FindType('-1','-1',BagID)
if uo.FindCount('finditem')<51 then
m=uo.FindCount('finditem')
uo.SetReceivingContainer(BagID)
uo.FindType(Items,'-1','me')
uo.Grab('0','finditem')
uo.ConColor('0x0021')
uo.Set('quiet','0')
uo.Print(uo.Print('In BagPack#'+Str(i+1)+' items '+Str(m)+''))
uo.Set('quiet','1')
uo.ConColor('0x0035')
wait(1000)
uo.UnSetReceivingContainer()
else
i=i+1
uo.Ignore(BagID, 'on')
end if
end if
if i==QB then
uo.IgnoreReset()
i=0
end if
uo.FindType(Items,'-1','me')
until uo.FindCount('finditem') < 1
end sub