Yoko

All sides of Injection
It is currently 2026-01-20 12:17:32

All times are UTC+02:00




Post new topic  Reply to topic  [ 27 posts ]  Go to page Previous 1 2
Author Message
 Post subject:
PostPosted: 2008-01-26 21:05:55 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
Destruction wrote:
Kynep wrote:
Grin wrote:
;) ему надо найти ближайшего;)
а что бы это сделать надо перебрать все объекты, циклов может быть куда больше;)


Помоему где то видел сриптег, который считает расстояние до обьекта, вроде в топике Полезности. Можно ешо заюзать.

uo.getDistance() ?)

А ваще - циклически пробежаццо по всем найденным и выбрать ближайшего, имхо :)


Ну дык ты видел что ему надо? искать в одной клетке потом в двух и т.д. Бред(имхо)


Top
   
 Post subject:
PostPosted: 2008-01-26 22:34:51 
Offline

Joined: 2007-12-30 14:23:05
Posts: 48
Я не говорю что мне нужно именно такое решение, мне просто нужно найти ближайшего, каким способом это будет реализовано мне все равно. Скрипт оч надо


Top
   
 Post subject:
PostPosted: 2008-01-26 22:53:02 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Я хз о чём речь, вкратце выглядит так:
Code:
var max_distance = 12
var item = "0x0000"
var c_item
uo.set( 'finddistance', str( max_distance ) )
uo.findtype( item, "-1", "ground" )
while uo.findcount()
   if uo.getDistance( 'finditem' ) <= max_distance then
      max_distance = uo.getDistance( 'finditem' )
      c_item = uo.getSerial( 'finditem' )
   endif
   uo.ignore( 'finditem' )
   uo.findtype( item, "-1", "ground" )
wend


Ну общий смысл таков :)

_________________
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: 2008-01-26 23:22:08 
Offline

Joined: 2007-12-30 14:23:05
Posts: 48
поставил на поиск синих чаров, но он ниче не находит
Code:
sub a()
var max_distance = 20
var item = '0x0190'
var c_item
uo.set( 'finddistance', str( max_distance ) )
uo.findtype( item, "-1", "ground" )
while uo.findcount()
   if uo.getDistance( 'finditem' ) <= max_distance then
      max_distance = uo.getDistance( 'finditem' )
      c_item = uo.getSerial( 'finditem' )
   endif
   uo.ignore( 'finditem' )
   uo.findtype( item, "-1", "ground" )
 wend
endsub


мне сюда еще надо добавить атаку найденого чара, если он ближний ко мне


Top
   
 Post subject:
PostPosted: 2008-01-29 00:15:41 
Offline

Joined: 2007-12-30 14:23:05
Posts: 48
ПОмогите пожалуйста


Top
   
 Post subject:
PostPosted: 2008-01-29 10:17:03 
Offline
Expert!
User avatar

Joined: 2004-04-04 21:40:09
Posts: 1007
Несколько поправок к скрипту выше
1) надо бы перед началом поиска игнор ресет задействовать.
2) разумеется ближайший ко мне человек это я сам, поэтому себя надо бы заигнорить.
3) в игре есть еще девочки. :roll:

Code:
sub a() 
var max_distance = 20
var item1 = '0x0190'
var item2 = '0x0191'
var c_item = 0
uo.ignorereset()
uo.ignore('self')
uo.set( 'finddistance', str( max_distance ) )
uo.findtype( item1, "-1", "ground" )
while uo.findcount()
   if uo.getDistance( 'finditem' ) <= max_distance then
      max_distance = uo.getDistance( 'finditem' )
      c_item = uo.getSerial( 'finditem' )
   endif
   uo.ignore( 'finditem' )
   uo.findtype( item1, "-1", "ground" )
wend
uo.findtype( item2, "-1", "ground" )
while uo.findcount()
   if uo.getDistance( 'finditem' ) <= max_distance then
      max_distance = uo.getDistance( 'finditem' )
      c_item = uo.getSerial( 'finditem' )
   endif
   uo.ignore( 'finditem' )
   uo.findtype( item2, "-1", "ground" )
wend
if c_item then
   if not uo.warmode() then
      uo.warmode( 1 )
   endif
   uo.attack( c_item )
endif
uo.print( 'ATTACK TARGET!' )
uo.print( uo.getname( c_item ) )
endsub


Top
   
 Post subject:
PostPosted: 2008-01-29 23:05:02 
Offline

Joined: 2007-12-30 14:23:05
Posts: 48
ТО что доктор прописал, огромное спасибо


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 27 posts ]  Go to page Previous 1 2

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


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