Yoko

All sides of Injection
It is currently 2025-12-21 15:12:47

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2008-03-28 17:00:00 
Offline

Joined: 2008-03-22 13:41:19
Posts: 57
Можете переделать чтоб он нормально маркал не ходил а бегал и чтоб можно было выбирать кординаты из клиента или из файла

var FileName=("C:\MinS.dat") ## - Ïóòü ê ôàéëó â êîòîðîì áóäóò õðàíèòñÿ êîîðäèíàòû ãäå êîïàòü.
sub Mark()
var i=0,j=0,k=0,r=0,q=0,ii,jj,f
dim OreX[5000],OreY[5000],OreT[5000]
dim OreTile[21]
var flag=0,OreCount=0,clicks=0,flag2=0
####################
### Ãðàôèêà ðóäû ###
####################
OreTile[0]=1339
OreTile[1]=1355
OreTile[2]=1354
OreTile[3]=1359
OreTile[4]=1358
OreTile[5]=1357
OreTile[6]=1352
OreTile[7]=1341
OreTile[8]=1363
OreTile[9]=1359
OreTile[10]=1339
OreTile[11]=1354
OreTile[12]=1386
OreTile[13]=1353
OreTile[14]=2278
OreTile[15]=2282
OreTile[16]=2281
OreTile[17]=2277
OreTile[18]=2278
OreTile[19]=2275
OreTile[20]=1351
OreTile[21]=0

uo.FilterSpeech('on')
uo.FilterSpeech('add', 'Where do you want to use the pickaxe?')

######################################
### Ñîáèðàåì êîîðäèíàòû èç êëèåíòà ###
######################################
uo.Print('Ñîáèðàåì êîîðäèíàòû ðóäû â îêðóãå...')
repeat
clicks=0
flag=0
uo.DeleteJournal()
#######################
### Êëèêàåì íà òàéë ###
#######################
uo.UseObject('Pickaxe')
wait(500)
uo.DeleteJournal()
while uo.Targeting()
wait(100)
wend
###########################
### Ïðîâåðÿåì òî ëè ýòî ###
###########################
flag=0
for k=0 to 21
if uo.LastTile(0)==OreTile[k]+1 then
flag=2
end if
next
if flag==0 then for k=0 to 21
if uo.LastTile(0)==OreTile[k] then
flag=1
end if
next
end if
if uo.Lasttile(1)==uo.GetX() and uo.Lasttile(2)==uo.Gety() then
flag=3
end if
########################
### Êëèêíóëè íà òàéë ###
########################
if flag==1 then
flag2=0
if OreCount>0 then
for ii=1 to OreCount
if OreX[ii]==uo.LastTile(1) and OreY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
OreCount=OreCount+1
OreX[OreCount]=uo.LastTile(1)
OreY[OreCount]=uo.LastTile(2)
OreT[OreCount]=uo.LastTile(0)
uo.Print('Íàéäåíà ðóäà íîìåð '+str(OreCount)+' : x='+str(uo.Lasttile(1))+'
y='+str(uo.LastTile(2)))
end if
end if
#####################
### Êëèêíóëè âûøå ###
#####################
if flag==2 then
flag2=0
if OreCount>0 then
for ii=1 to OreCount
if OreX[ii]==uo.LastTile(1) and OreY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
OreCount=OreCount+1
OreX[OreCount]=uo.LastTile(1)
OreY[OreCount]=uo.LastTile(2)
OreT[OreCount]=uo.LastTile(0)-1
uo.print('Íàéäåíà ðóäà íîìåð '+str(OreCount)+' : x='+str(uo.Lasttile(1))+'
y='+str(uo.LastTile(2)))
end if
end if
until (Flag==3) or (OreCount==5000)
uo.FilterSpeech('off')
uo.Print('Àíàëèç çàêîí÷åí, êîîðäèíàòû ðóäû çàïèñàíû â ôàéë ' +FileName)
SaveToFile(OreCount,OreX,OreY,OreT)
end if
uo.Print('Êîîðäèíàò íàéäåíî: '+str(OreCount))
wait(2000)

sub SaveToFile(OreCount,OreX,OreY,OreT)
var s=0,i=0,f
f=file(FileName)
f.Open()
f.Create()
s=safe call f.Writeln(OreCount)
for i=1 to OreCount
s=safe call f.Writeln(str(OreT[i])+' '+str(OreX[i])+' '+str(OreY[i]))
next
f.Close()
end sub


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

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