Yoko

All sides of Injection
It is currently 2025-10-18 03:55:59

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2010-07-12 21:55:18 
Offline

Joined: 2009-08-04 14:16:41
Posts: 30
Location: SPB
Здрасте люди добрые! хотел сделать штуку хорошую,ну ходилку всмысле лесовую,но получился пока только автопоиск деревьев,если кто о может помогите пожалуйста!

Code:
sub findtree()
var dist = 10
var count = 0
dim TreeX[1000]
dim TreeY[1000]
var i = 0
var mx = uo.getx('self')
var my = uo.gety('self')
uo.print(mx)
var zx,zy,type
for zx = mx - dist to mx + dist
for zy = my - dist to my + dist
if uo.privategettile( zx, zy, 0, 3289, 3289 )then
count = count + 1
TreeX[count] = zx
TreeY[count] = zy
endif
next
next
for i = 1 to count
SaveToFile(TreeX[i],TreeY[i],i)
uo.print(str(i))
next
endsub


sub SaveToFile(x,y,count)
var f=file('C:\trer.txt')
var s
if count == 1 then
f.create()
uo.print('file created')
endif
f.open()
uo.print('Íàäåíî äåðåâî - '+str(x)+ " " + str(y))
s=safe call f.writeln('3289'+' '+str(x)+' '+str(y))
f.close()
endsub


Top
   
PostPosted: 2010-07-12 21:56:05 
Offline

Joined: 2009-08-04 14:16:41
Posts: 30
Location: SPB
ой..проблема вот в чем,он не записывает деревья в файл!
то есть одно дерево запишет и все,а остальные не хочет!


Top
   
PostPosted: 2010-07-13 00:02:56 
Offline

Joined: 2009-08-04 14:16:41
Posts: 30
Location: SPB
а ,все,сделал)


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 4 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