ZID wrote:
я стою перед ним мордой вперёд допустим....
я не очень понял, для чего тебе это и чем ты собрался обкладывать, но вот тебе пара примеров и делай с ними что хочешь. оба выстраивают вокруг тебя квадратный забот из указаного типа предметов размером 5х5:
1) этот пример наименее глючен, но с ним дофига всего инжект пишет, если не отключать injectecho, да и работает довольно медленно
Code:
sub main()
droparound("0x097B") # 0x097B заменить на нужный тип предмета
endsub
sub droparound(itemtype)
var a,b,c,d,e,x,y
for a=-2 to 1
b=str(a)
c=str(0-a)
for e=0 to 3
d=uo.count(itemtype)
if d>0 then
uo.waittargettype(itemtype)
uo.addobject('f')
if e==0 then
x=uo.getx('self')+2
y=uo.gety('self')+a
endif
if e==1 then
x=uo.getx('self')-2
y=uo.gety('self')-a
endif
if e==2 then
x=uo.getx('self')-a
y=uo.gety('self')+2
endif
if e==3 then
x=uo.getx('self')+a
y=uo.gety('self')-2
endif
uo.textprint(str(x)+' '+str(y))
uo.moveitem('f',"1","ground",str(x),str(y),str(255))
repeat
wait(100)
until d<>uo.count(itemtype)
wait(100)
endif
next
next
endsub
2) этот пример, вроде бы, работает пошустрее, но на лагах может "хватать" вещь с земли и класть её в новое место
Code:
sub main()
var what="0x0E21" # 0x0E21 заменить на objtype необходимого предмета
droparound(what)
endsub
sub droparound(itemtype)
var a,b,c,d,e,x,y
for a=-2 to 1
b=str(a)
c=str(0-a)
for e=0 to 3
d=uo.count(itemtype)
if d>0 then
uo.findtype(itemtype,'-1','backpack')
if e==0 then
x=uo.getx('self')+2
y=uo.gety('self')+a
else
if e==1 then
x=uo.getx('self')-2
y=uo.gety('self')-a
else
if e==2 then
x=uo.getx('self')-a
y=uo.gety('self')+2
else
x=uo.getx('self')+a
y=uo.gety('self')-2
endif
endif
endif
uo.moveitem('finditem',"1","ground",str(x),str(y),str(uo.getz()))
repeat
wait(30)
until d<>uo.count(itemtype)
wait(30)
endif
next
next
endsub