dogon (IMG:
style_emoticons/default/biggrin.gif) vot dogon
sub dogon()
var script='dogon' ; lowercase
if uo.getglobal(script)=='On' then
uo.setglobal(script,0)
uo.print(' !!! -= '+script+' Terminated =- !!! ')
uo.exec('terminate '+script)
else
uo.setglobal(script,'On')
uo.print(' !!! -= '+script+' =- !!! ')
var target
target=uo.getserial('lastattack')
uo.say('')
while uo.life>0 and target<>""
wait(100)
if uo.getdistance(target)>1 then
run(target)
endif
wend
uo.setglobal(script,0)
uo.print(' !!! -= '+script+' Terminated =- !!! ')
endif
endsub
sub run(targ)
var dx, dy
while 1
if targ<>"" and uo.life>0 then
if uo.getdistance(targ)<2 then
return
endif
dx=UO.GetX(targ)-UO.GetX()
dy=UO.GetY(targ)-UO.GetY()
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
endsub
sub chase()
VAR target
If UO.Targeting() Then
UO.CancelTarget()
Endif
UO.Print( 'Please, choice of enemy:' )
UO.AddObject( 'enemy' )
While UO.Targeting()
wait(100)
Wend
target = uo.getserial('enemy')
while not uo.dead() and target<>""
if UO.GetDistance(target)>1 then
Chaser(target)
endif
wait(100)
wend
endsub
sub Chaser(targ)
var dx, dy
while 1
if targ<>"" and uo.life>0 then
if uo.getdistance(targ)<2 then
return
endif
dx=UO.GetX(targ)-UO.GetX()
dy=UO.GetY(targ)-UO.GetY()
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