Yoko

All sides of Injection
It is currently 2025-10-15 09:49:21

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2010-06-10 13:35:15 
Offline

Joined: 2009-06-01 10:02:57
Posts: 64
Есть вот такая простенькая догонялка. Подправьте её пожалуйста кто может так чтоб по нажатии на клавишу догонял lasttarget и брал щит с мечом . При повторном нажатии на эту же клавишу переставала догонят и брала лук . Если цель умирала тоже переставала догонят труп.


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
end sub
Sub Chaser(Target)
VAR dx, dy
While uo.getdistance(target) >1
If Target<>"" and uo.getdistance(target) >1 and not uo.dead() Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
If UO.GetDistance(Target)<2 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


Top
   
PostPosted: 2010-06-12 08:34:54 
Offline

Joined: 2010-05-06 11:23:30
Posts: 7
Еще эта догонялка застревает если препятствие 2 тайла или более. Реально ли поправить. Кто может написать лучше за звонкую монету?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited