LastCorpse > 3
Posted: 2006-05-11 15:32:35
kak sdelat' script na proverku skolko v trupe veshej ?
, pomogite kto mozet atu ja dazhe neznaju s 4ego na4at'

Code: Select all
uo.findtype(-1, -1, "lastcorpse")
uo.print(str(uo.findcount()))
Code: Select all
sub cheaker()
while true
uo.findtype("-1","-1","lastcorpse")
uo.Waiting("lastcorpse")
if uo.FindCount() > 3 then
loot()
else
wait(1000)
endif
if uo.FindCount() <= 3 then
sac()
else
wait(1000)
endif
wend
endsub
sub loot()
UO.waittargetobject("lastcorpse");
UO.emptycontainer("550", "lastcorpse");
wait(3000)
sac()
endsub
sub sac()
uo.waittargetobject("lastcorpse")
uo.sayu(".sac")
wait(1000)
cheaker()
endsub
Grin wrote:труп считается открытым когда lastcontainer == lastcorpse
Edred wrote:Grin wrote:труп считается открытым когда lastcontainer == lastcorpse
Ну, наверное, не всегда? Вполне вероятно, что пока ты открываешь труп, рядом появится еще один и тогда ласткотейнер не будет равен ласткорпс.
Code: Select all
corpse=uo.GetSerial("lastcorpse")
if uo.GetDistanse(corpse) < 3 then
uo.useobject(corpse)
while corpse <> uo.GetSerial("lastcontainer")
wait(100)
wend
end if
Code: Select all
sub test()
var WaitTime=800
dim iTake[2]
iTake[0]=0x0EED ; gold
iTake[1]=0x1422 ; tix
var l
var corpse = uo.getserial("lastcorpse")
if UO.GetDistance(corpse) < 3 then
uo.useobject(corpse)
while corpse <> uo.GetSerial("lastcontainer")
wait(100)
wend
end if
wait(550)
For l = 0 To 1
repeat
if UO.FindCount("finditem") >= 1 then
UO.FindType(iTake[l], "-1", "lastcontainer" )
UO.MoveItem( "finditem" )
wait( 1000 )
UO.FindType(iTake[l], "-1", "lastcontainer" )
endif
until UO.FindCount("finditem") <= 1
next
UO.Print(UO.Count(corpse))
endsub
Code: Select all
sub test()
var WaitTime=800
var l
var corpse = uo.getserial("lastcorpse")
dim iTake[2]
iTake[0]=0x0EED ; gold
iTake[1]=0x1422 ; tix
if UO.GetDistance(corpse) < 3 then
uo.useobject(corpse)
while corpse <> uo.GetSerial("lastcontainer")
wait(100)
wend
For l = 0 To 1
repeat
UO.FindType(iTake[l], "-1", corpse)
if uo.FindCount() then
UO.grab("finditem")
wait(1000)
end if
until UO.FindCount() <= 1
next
end if
UO.Print(UO.GetGraphic(corpse))
end sub
Code: Select all
##Cheaker##
sub iLook()
while true
uo.findtype("-1","-1","lastcorpse")
if uo.FindCount() >= 3 then
iLoot()
else
iTake()
wait(1000)
endif
wend
end sub
##Looter##
sub iLoot()
var WaitTime=800
var l
var corpse = uo.getserial("lastcorpse")
dim iTake[2]
iTake[0]=0x0EED ; gold
iTake[1]=0x1422 ; tix
if UO.GetDistance(corpse) < 3 then
uo.useobject(corpse)
while corpse <> uo.GetSerial("lastcontainer")
wait(100)
wend
UO.SetReceivingContainer(0x40004DD6)
For l = 0 To 1
repeat
UO.FindType(iTake[l], "-1", corpse)
if uo.FindCount() then
UO.grab(0, "finditem")
wait(1000)
end if
until UO.FindCount() <= 1
next
end if
UO.UnSetReceivingContainer()
UO.Print(UO.GetGraphic(corpse))
wait(3000)
iSac()
end sub
##Loot all items##
sub iTake()
UO.waittargetobject("lastcorpse");
UO.emptycontainer("550", "lastcorpse");
wait(3000)
iSac()
end sub
##Corpse .sac script##
sub iSac()
uo.waittargetobject("lastcorpse");
uo.sayu(".sac");
wait(2000)
iLook()
end sub
Code: Select all
##Cheaker##
sub iLook()
var corpse
while true
uo.findtype("0x2006","-1","ground")
wait(500)
if uo.FindCount() then
corpse=uo.GetSerial("finditem")
uo.findtype("-1","-1",corpse)
if uo.findcount()>=3 then
iLoot(corpse)
else
iTake(corpse)
wait(1000)
end if
uo.ignore(corpse)
endif
wend
end sub
##Looter##
sub iLoot(corpse)
var WaitTime=800
var l
dim iTake[2]
iTake[0]=0x0EED ; gold
iTake[1]=0x1422 ; tix
if UO.GetDistance(corpse) < 3 then
uo.useobject(corpse)
while corpse <> uo.GetSerial("lastcontainer")
wait(100)
wend
UO.SetReceivingContainer(0x40004DD6)
For l = 0 To 1
repeat
UO.FindType(iTake[l], "-1", corpse)
if uo.FindCount() then
UO.grab(0, "finditem")
wait(1000)
end if
until UO.FindCount() <= 1
next
end if
UO.UnSetReceivingContainer()
UO.Print(UO.GetGraphic(corpse))
wait(3000)
iSac(corpse)
end sub
##Loot all items##
sub iTake(corpse)
UO.waittargetobject(corpse);
UO.emptycontainer("550", corpse);
wait(3000)
iSac(corpse)
end sub
##Corpse .sac script##
sub iSac(corpse)
uo.waittargetobject(corpse);
uo.sayu(".sac");
wait(2000)
end sub