Page 1 of 1

Помогите найти ошибку?

Posted: 2005-10-06 22:16:51
by Dron D.

Code: Select all

sub fix()
var dx=uo.getx('lasttarget'),dy=uo.gety('lasttarget')

uo.print(STR(uo.getX('self')))
uo.print(STR(uo.getY('self')))

uo.findtype('0x0F36','-1','my') #Type of item 4fix
if uo.FindCount() then

uo.waittargetobject('finditem')

if uo.getx('lasttarget')>uo.getx('self') then
uo.print('Fixed!')
uo.print('Fixed!')
dx=uo.getx('lasttarget')
dx=dx+1
#dy=dy-1
endif

if uo.getx('lasttarget')<uo.getx('self') then
uo.print('Fixed!')
uo.print('Fixed!')
dx=uo.getx('lasttarget')
dx=dx-1
#dy=dy+1
endif

if uo.gety('lasttarget')<uo.gety('self') then
uo.print('Fixed!')
uo.print('Fixed!')
dy=uo.gety('lasttarget')
dy=dy-1
#dx=dx+1
endif


if uo.gety('lasttarget')>uo.gety('self') then
uo.print('Fixed!')
uo.print('Fixed!')
dy=uo.getY('lasttarget')
dy=dy+1
#dx=dx-1
endif

uo.drop('0',STR(dx),STR(dy),STR(uo.getY('lasttarget')))

uo.print(STR(dx)+" "+STR(dy))
wait(100)
uo.canceltarget()
uo.set('lasttarget','laststatus')

endif

end sub


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

Posted: 2005-10-07 00:21:33
by Destruction

Code: Select all

uo.drop('0',STR(dx),STR(dy),STR(uo.getY('lasttarget'))) 

Code: Select all

uo.drop('0',STR(dx),STR(dy),STR(uo.getZ('lasttarget'))) 

Posted: 2005-10-07 19:34:54
by Dron D.
спасибо.
Но еще есть вопросы:
1. Почему цель выдается на айтем, когда у нас есть строка определяющяя, что кидать.
2. Почему после блокировки, пропадает таргет с обьекта и его сново приходится искать в толпе?

Posted: 2005-10-08 13:48:40
by Dron D.
непонятки Щ_Щ
ап

Posted: 2005-10-08 18:59:29
by Beyonder
В самом начале сделай:
var Enemy=UO.GetSerial("laststatus")
И дальше юзай переменную Enemy, она никуда не пропадет. А разные глобальные указатели очень не постоянные.