Помогите с реализацией бега
Posted: 2008-03-14 14:26:41
Эксперты у меня есть скрипт но бег в нем реализован через кнопки на нампаде , как сделать так , чтобы он бегал на клавишах "вверх" и тд(которые слева от нампада) ?
заранее благодарен
заранее благодарен
Code: Select all
sub chase()
If uo.getglobal('chase')=='On' then
uo.setglobal ('chase',0)
uo.print(' !!! -= Chase Terminated =- !!! ')
uo.exec('Terminate chase')
else
uo.setglobal('chase','On')
uo.print(' !!! -= Chasing =- !!! ')
endif
VAR target
target = uo.getserial('lasttarget')
while not uo.dead() and target<>"" and uo.getdistance(target)
if UO.GetDistance(target)>-1 then
uo.say('')
Chaser(target)
endif
wend
uo.setglobal('chase',0)
uo.print(' !!! -= Chasing ended =- !!! ')
end sub
;-----------------------------------------------------------------
sub Chaser(Target)
VAR dx, dy
While 1
If Target<>"" and not uo.dead() Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
If UO.GetDistance(Target)<0 Then
return
Endif
else
Return
Endif
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
UO.Press(40); DownArrow
Endif
If dx>0 AND dy<0 Then
UO.Press(39); RightArrow
Endif
If dx<0 AND dy>0 Then
UO.Press(37); LeftArrow
Endif
If dx<0 AND dy<0 Then
UO.Press(38); UpArrow
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
UO.Press(34); PgDown
Endif
If dx<0 Then
UO.Press(36); Home key
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
UO.Press(35); End
Endif
If dy<0 Then
UO.Press(33); PgUp
Endif
Endif
Wend
end sub