Yoko

All sides of Injection
It is currently 2026-01-16 10:38:40

All times are UTC+02:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Ходилка
PostPosted: 2005-05-09 13:38:30 
Offline
Expert!
User avatar

Joined: 2005-01-15 19:15:05
Posts: 791
Location: Dragon World
Скажите, как переделаьб ходилку типа X,Y,Target в X,Y?
Code:
Sub WalkN(x,y,Target) 
VAR i,StepSucess
VAR dx,dy,Exit=0
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif
Endif
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
Endif
Endif
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
Endif
Endif
Endif
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
Endif
Endif
Endif
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
StepSucess=Go(5,37,300) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,300) ;E - PgDown
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
Endif
StepSucess=Go(2,34,300) ;E - PgDown
Endif
Endif
If dx<0 Then
StepSucess=Go(6,36,300) ;W - Home
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
StepSucess=Go(6,36,300) ;W - Home
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,300) ;S - End
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
StepSucess=Go(4,35,300) ;S - End
Endif
Endif
If dy<0 Then
StepSucess=Go(0,33,300) ;N - PgUp
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
Endif
StepSucess=Go(0,33,300) ;N - PgUp
Endif
Endif
Endif
Wend
end sub
Sub Go(dir,key,walkwait)
VAR x,y, OldDir
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
 
Endif
Endif
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
 
Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
UO.Press(key)
wait(walkwait)
Endif
If x==UO.GetX() AND y==UO.GetY() Then
 
Endif
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Zasada!")
return -1
Else
return 1
Endif
end sub


Top
   
 Post subject:
PostPosted: 2005-05-09 14:06:54 
Offline
Expert!
User avatar

Joined: 2004-10-15 22:38:04
Posts: 1396
Location: Moscow City.
Мне почемуто кажется что нет смысла её переделовать.
ты можеш написать так WalkN(X,Y,"") и отправишся к точке XY


Top
   
 Post subject:
PostPosted: 2005-05-09 14:18:04 
Offline
Expert!
User avatar

Joined: 2005-01-15 19:15:05
Posts: 791
Location: Dragon World
Это конечно можно, но скрипт говорит, что цель не найдена...


Top
   
 Post subject:
PostPosted: 2005-05-10 21:01:50 
Offline
Expert!
User avatar

Joined: 2004-04-04 11:13:54
Posts: 1205
Location: Балаково, Саратовская обл.
Третий параметр серийник цели. Если он указан то чар чухает к ней. Если там пусто "" то чар чухает по координатам. Если у тебя правленная ходилка, найди исходную.


Top
   
 Post subject:
PostPosted: 2005-05-10 22:17:21 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Ваще скрипт смтреть не хочу, но
Code:
If Target<>"" Then 

говорит само за себя - отращиваем прямые руки и все должно работать :twisted:

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2005-05-13 11:33:33 
Offline
Expert!
User avatar

Joined: 2004-04-04 11:13:54
Posts: 1205
Location: Балаково, Саратовская обл.
Destruction wrote:
Ваще скрипт смтреть не хочу, но
Code:
If Target<>"" Then 

говорит само за себя - отращиваем прямые руки и все должно работать :twisted:

Самый умный? :) Скопируй это в нотепад и подвигай стрелки.


Top
   
 Post subject:
PostPosted: 2005-05-13 11:58:09 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
Savage wrote:
Destruction wrote:
Ваще скрипт смтреть не хочу, но
Code:
If Target<>"" Then 

говорит само за себя - отращиваем прямые руки и все должно работать :twisted:

Самый умный? :) Скопируй это в нотепад и подвигай стрелки.

Не получается отойти от дел ?

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-05-14 20:23:55 
Offline
Expert!
User avatar

Joined: 2004-04-04 11:13:54
Posts: 1205
Location: Балаково, Саратовская обл.
Пока летишь куда нить далеко - заняться нечем, вот форум листаю иногда.
пс, я счас в иву гоняю. Платная но интересная всегда хотел про космос гаму магия в печенках уже...
www.eve-online.com
www.eve-online.ru


Top
   
 Post subject:
PostPosted: 2005-05-15 08:33:50 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
Это к чему?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited