Лумбер плз хелп

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
andrik27
Posts: 10
Joined: 2007-03-05 10:30:41

Лумбер плз хелп

Post by andrik27 »

Нашел сдесь скрипт на Ламбер он у меня начинает ходить потходит к дереву начинает рубить когда логи кончаются он продалжает и некуда неходит =((

Code: Select all

############################################ 
### Lumberjacking / Рубка деревьев       ### 
############################################ 
### Шард Dragon World / www.drw.ru       ### 
############################################ 
### Реавтор этого скрипта: BETEPAH       ### 
############################################ 
################## 
### Переменные ### 
################## 
################################################################################################### 
var f=file("C:\trees3.dat") ## - Путь к файлу в котором будут хранится координаты деревьев. 
### 
var TryHiding=1 ## 1 - Перед тем как рубить дерево, будет пытаться уйти в хайд, 0 - не будет . 
### 
var LogsQty=500 ## - Количество логов, добыв которое надо реколиться домой. 
### 
var GetFromFile=0 ## 1 - Координаты деревьев будут считыватся из файла, 0 - собиратся из клиента 
### (сначала соберите а потом считывайте из файла). 
### 
var EatingFood=0 ## 1 - Будем есть, 0 - нет.  
### 
var SSpeak=1 ## 1 - Будем качать и спирит спик, 0 - не будем. 
### 
var TypeFood='0x097B' ## - Тип еды которую будем кушать.(сейчас фиштейки) 
### 
var Chest='0x401fdda2' ## - ID сундука куда будут выгружаться логи. 
### 
var Trytodrop=0 ## Будем пытатся подходить к сундуку или нет. 
### 
var ContX=1234 ##Координаты X у сундука 
### 
var ContY=1234 ##Координаты Y у сундука 
### 
var oldX,oldY,time ## - Для рекола. 
### 
########### 
### Код ### 
########### 
sub Lumberjacking() 
var i=0,j=0,k=0,r=0,q=0,ii,jj 
var TopX=324,TopY=65 
dim TreeX[5000], TreeY[5000],TreeT[5000] 
dim TreeTile[29] 
var flag=0,treeCount=0,clicks=0,flag2=0 
######################## 
### Графика деревьев ### 
######################## 
TreeTile[0]=3277 
TreeTile[1]=3280 
TreeTile[2]=3283 
TreeTile[3]=3286 
TreeTile[4]=3289 
TreeTile[5]=3291 
TreeTile[6]=3294 
TreeTile[7]=3296 
TreeTile[8]=3299 
TreeTile[9]=3302 
TreeTile[10]=3393 
TreeTile[11]=3394 
TreeTile[12]=3395 
TreeTile[13]=3396 
TreeTile[14]=3415 
TreeTile[15]=3416 
TreeTile[16]=3417 
TreeTile[17]=3418 
TreeTile[18]=3419 
TreeTile[19]=3438 
TreeTile[20]=3439 
TreeTile[21]=3440 
TreeTile[22]=3441 
TreeTile[23]=3442 
TreeTile[24]=3460 
TreeTile[25]=3461 
TreeTile[26]=3462 
TreeTile[27]=3290 
TreeTile[28]=3288 

uo.Exec("filterspeech on") 
uo.Exec("filterspeech add 'Where do you want to use the pickaxe?'") 

uo.Print('Выбери Топор: ') 
uo.Exec('addobject Axe') 
while uo.Targeting() 
wait(100) 
wend 

##################################### 
### Загружаем координаты из файла ### 
##################################### 
if GetFromFile==1 then 
uo.Print('Загружаем координаты из файла...') 
f.open() 
treeCount=safe call f.ReadNumber() 
for i=1 to treeCount 
TreeT[i]=safe call f.ReadNumber() 
TreeX[i]=safe call f.ReadNumber() 
TreeY[i]=safe call f.ReadNumber() 
next 
f.close() 
else 
###################################### 
### Собираем координаты из клиента ### 
###################################### 
uo.Print('Выбери Кирку: ') 
uo.Exec('addobject Pickaxe') 
while uo.Targeting() 
wait(100) 
wend 
uo.Print('Собираем координаты деревьев в округе...') 
repeat 
clicks=0 
flag=0 
uo.DeleteJournal() 
####################### 
### Кликаем на тайл ### 
####################### 
uo.UseObject('Pickaxe') 
waitForTarget() 
uo.DeleteJournal() 
WaitForTryRock() 
############################### 
### Проверяем дерево ли это ### 
############################### 
flag=0 
for k=0 to 28 
if uo.LastTile(0)==TreeTile[k]+1 then 
flag=2 
end if 
next 
if flag==0 then 
for k=0 to 28 
if uo.LastTile(0)==TreeTile[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 treeCount>0 then 
for ii=1 to treeCount 
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then 
flag2=1 
end if 
next 
end if 
if flag2==0 then 
treeCount=treeCount+1 
TreeX[treeCount]=uo.LastTile(1) 
TreeY[treeCount]=uo.LastTile(2) 
TreeT[treeCount]=uo.LastTile(0) 
uo.Print('Найдено дерево '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2))+' '+str(treeCount)) 
end if 
end if 
########################## 
### Кликнули по листве ### 
########################## 
if flag==2 then 
flag2=0 
if treeCount>0 then 
for ii=1 to treeCount 
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then 
flag2=1 
end if 
next 
end if 
if flag2==0 then 
treeCount=treeCount+1 
TreeX[treeCount]=uo.LastTile(1) 
TreeY[treeCount]=uo.LastTile(2) 
TreeT[treeCount]=uo.LastTile(0)-1 
uo.print('Найдено дерево '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2))) 
end if 
end if 
until (Flag==3) or (treeCount==500) 
uo.Exec("filterspeech off") 
uo.Print('Анализ закончен, координаты деревьев записаны в файл C:\trees3.dat') 
SaveToFile(treeCount,TreeX,TreeY,TreeT) 
end if 
uo.Print('Деревьев найдено: '+str(treeCount)) 
wait(2000) 
###################################### 
### Ходим по собранным координатам ### 
###################################### 
while 1==1 
if treeCount>0 then 
for i=1 to treeCount 
end if 
if Trytodrop==1 and uo.Count('ZLK')>=LogsQty then 
GotoXY(uo.getx(Chest),uo.gety(Chest)) 
DropLogs() 
end if 
uo.Print('Идем к дереву '+str(i)+': x='+str(TreeX[i])+' y='+str(TreeY[i])) 
InfoLogs() 
flag=GotoXY(TreeX[i],TreeY[i]) 
if flag==1 then 
if TryHiding==1 then 
ToHide() 
end if 
GetTree(str(TreeT[i]),str(TreeX[i]),str(TreeY[i]),str(uo.GetZ())) 
end if 
next 
end if 
wend 
end sub 

Sub GetTree(Type,X,Y,Z) 
var i 
uo.Print('Начинаем рубку дерева...') 
for i=0 to 15 
if uo.Warmode()==1 then 
return 0 
end if 
wait(200) 
uo.DeleteJournal() 
uo.WaitTargetTile(Type,X,Y,Z) 
uo.UseObject('Axe') 
if WaitForChange()==1 then 
return 1 
end if 
next 
return 0 
end sub 

Sub ToHide() 
if SSpeak==1 then 
UO.Useskill('Spirit Speak')    
wait(3000) 
endif 
while not uo.Hidden() 
uo.Print('Пытаемся уйти в хайд...') 
uo.DeleteJournal() 
uo.UseSkill('Stealth') 
wait(3000) 
wend 
wait(100) 
end sub 


Sub WaitForHide() 
var Text1=uo.GetName()+": You have hidden yourself well" 
var Text2=uo.GetName()+": You can't seem to hide here." 
var mess 
for var i=0 to 200 
mess=uo.Journal(0) 
if uo.Journal(0)==Text1 then 
return 1 
end if 
if uo.Journal(0)==Text2 then 
return 0 
end if 
wait(50) 
next 
return 0 
end sub 

Sub WaitForChange() 
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.' 
var Text2='There are no logs here to chop.' 
var Text3="You can't reach this." 
var Text4="That is too far away." 
var Text5="You can't do much in your current state." 
var mess 
for var i=0 to 200 
mess=uo.Journal(0) 
if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then 
return 1 
end if 
if uo.Journal(0)==Text1 then 
return 0 
end if 
if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then 
return 0 
end if 
wait(50) 
next 
return 0 
end sub 

Sub WaitForTryRock() 
var Text1="That is too far away." 
var Text2="Try mining in rock." 
var Text3="There is no ore here to mine." 
var Text4="You have no line of sight to that location" 
var Text5="You can't see the target" 
for var i=0 to 50 
if uo.Journal(0)==Text1 or uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 or uo.Journal(0)==Text5 then 
return 1 
end if 
wait(200) 
next 
return 0 
end sub 

Sub WaitForTarget() 
for var i=0 to 50 
if uo.Targeting()==1 then 
return 1 
end if 
wait(200) 
next 
return 0 
end sub 

Sub WaitForChangeXY(myX,myY,lastX,lastY) 
for var i=1 to 50 
if lastX<>myX or lastY<>myY then 
return 1 
end if 
wait(200) 
next 
return 0 
end sub 

Sub GotoXY(x,y) 
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0 
for i=1 to 60 
myX=uo.getX(); 
myY=uo.getY(); 
if LastX==myX and LastY==myY then 
halt=halt+1 
else 
halt=0 
end if 
if halt>=10 then 
if uo.GetDir()==1 then 
for z=0 to 8 
uo.Press(40) 
next 
end if 
if uo.GetDir()==3 then 
for z=0 to 8 
uo.Press(37) 
next 
end if 
if uo.GetDir()==5 then 
for z=0 to 8 
uo.Press(38) 
next 
end if 
if uo.GetDir()==7 then 
for z=0 to 8 
uo.Press(39) 
next 
end if 
halt=15 
end if 
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then 
return 1 
end if 
if x<=myX then 
if y<=myY then 
for z=0 to 3 
uo.Press(38) 
next 
else 
for z=0 to 3 
uo.Press(37) 
next 
end if 
else 
if y<=myY then 
for z=0 to 3 
uo.Press(39) 
next 
else 
for z=0 to 3 
uo.Press(40) 
next 
end if 
end if 
lastX=myX 
lastY=myY 
wait(200) 
next 
return 0 
end sub 

Sub Numb(num) 
if num>=0 then 
return num 
else 
return num*(-1) 
end if 
end sub 

Sub SaveToFile(treeCount,TreeX,TreeY,TreeT) 
var f=file("C:\trees3.dat") 
var s=0,i=0 
f.open() 
f.create() 
s=safe call f.writeln(treeCount) 
for i=1 to treeCount 
s=safe call f.writeln(str(TreeT[i])+' '+str(TreeX[i])+' '+str(TreeY[i])) 
next 
f.close() 
end sub 

sub DropLogs() 
uo.say("Выкладываю логи !!! Не беспокоить !!!") 
if uo.Waiting() then 
uo.CancelTarget() 
end if 
var a,Exit 
dim Logs[1] 
Logs[0]=0x1BDD 
uo.Print('Выкладываем Логи.') 
uo.SetReceivingContainer(Chest) 
wait(500) 
for a=0 to 0 
Exit=0 
repeat 
uo.FindType(Logs[a]) 
if uo.GetQuantity('finditem')>0 then 
uo.Grab('0','finditem') 
wait(1500) 
GotoXY(ContX,ContY) 
else 
Exit=1 
end if 
until Exit==1 
next 
if EatingFood==1 then 
EatingFood() 
end if 
uo.UnSetReceivingContainer(Chest) 
uo.Print('Логи Выложены.') 
end sub 


Sub InfoLogs() 
uo.Print('У вас всего '+str(uo.Count('0x1BDD'))+' логов в сумке') 
uo.Print('Из них '+str(uo.Count('0x1BDD','0x0000'))+' простых и ' +str(uo.Count('0x1BDD')-uo.Count('0x1BDD','0x0000'))+' цветных') 
end sub 

Sub Open(Container) 
uo.DeleteJournal() 
uo.UseObject(Container) 
repeat 
wait(500) 
until uo.InJournal('Contains') 
end sub 


Sub EatingFood() 
ToEat() 
DropFood() 
end sub 

Sub ToEat() 
uo.SetReceivingContainer('backpack') 
Open(Chest) 
uo.FindType(TypeFood,'-1',Chest) 
uo.Grab('50','finditem') 
wait(500) 
repeat 
Checklag() 
uo.UseType(TypeFood) 
wait(1000) 
until uo.InJournal('You are simply too full to eat any more!') 
uo.UnsetReceivingContainer() 
end sub 

Sub DropFood() 
if uo.Waiting() then 
uo.CancelTarget() 
end if 
var f,Exit 
dim Food[1] 
Food[0]=TypeFood 
uo.SetReceivingContainer(Chest) 
wait(500) 
for f=0 to 0 
Exit=0 
repeat 
uo.FindType(Food[f]) 
if uo.GetQuantity('finditem')>0 then 
uo.Grab('0','finditem') 
wait(1500) 
else 
Exit=1 
end if 
until Exit==1 
next 
uo.UnSetReceivingContainer(Chest) 
end sub 

Sub CheckLag() 
if uo.Waiting()>0 then 
uo.Exec('canceltarget') 
end if 
uo.DeleteJournal() 
uo.Click('backpack') 
repeat 
wait(50) 
until uo.InJournal('backpack') 
end sub
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

Code: Select all

Sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4="That is too far away."
var Text5="You can't do much in your current state." 
скрипт надо выкладывать в теги [cоde][/cоde]
andrik27
Posts: 10
Joined: 2007-03-05 10:30:41

Post by andrik27 »

NMY wrote:

Code: Select all

Sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4="That is too far away."
var Text5="You can't do much in your current state." 
скрипт надо выкладывать в теги [cоde][/cоde]
спс проста я в этом мало шарю )
andrik27
Posts: 10
Joined: 2007-03-05 10:30:41

Post by andrik27 »

Вот тепер хорошо хотит толька когда дерево пустое он питается дальше рубить это дерево что делать ?(
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Post by Mihail »

поставить нормальное сообщение о том что дерево пустое
andrik27
Posts: 10
Joined: 2007-03-05 10:30:41

Post by andrik27 »

Сделал тепер все ок, а нельзя сделать чтобы в игре сам нахадил логи где ты рубиш а то я должен киркой нажать на 26 деревьев толька тогда загружается trees3 можна как небуть сделать чтобы сам искал ?
to4a
Posts: 265
Joined: 2006-03-10 00:19:11
Location: http://drw.ru/

Post by to4a »

я себе в скрипт от этого автора писал марк, кликать всё равно прийдется самому(имхо так лучше и нихрена оно не напряжно, я 100 деревьев за 2-3 минуты намаркал), но не нужна кирка, и процесс прородит быстрее потому что ему не надо ждать ответа от сервака пока заюзается кирка, чтоб остановить - произнести чаром stopmark:

Code: Select all

sub normmark()
 var f=file("C:\trees3.dat") #ФАЙЛ ДЕРЕВЬЕВ
 UO.DeleteJournal()
 DIM TOFILE[100]
 var i=0,j=0,T,X,Y,S,TMP='',TXT,Marked=0;
 repeat
    Print('Покажите дерево?')
    UO.CancelTarget()
    UO.AddObject('tree')
    while UO.Targeting() and not UO.InJournal('stopmark')
       wait(100)     
    wend
    if UO.InJournal('stopmark') then
      goto end
    endif
    UO.AddObject('tree','lasttarget')
    if UO.LastTile(0)<>3283 and UO.LastTile(0)<>3289 and UO.LastTile(0)<>3277 and UO.LastTile(0)<>3291 and UO.LastTile(0)<>3293 and UO.LastTile(0)<>3294 and UO.LastTile(0)<>3296 and UO.LastTile(0)<>3302 and UO.LastTile(0)<>3299  and UO.LastTile(0)<>3290  and UO.LastTile(0)<>3288  and UO.LastTile(0)<>3286  and UO.LastTile(0)<>3280 then
       Print('ЭТО НЕ ДЕРЕВО...')
    else   
       T=str(UO.LastTile(0))
       X=str(UO.LastTile(1))
       Y=str(UO.LastTile(2))
       for j=0 to i
          if T+' '+X+' '+Y==TOFILE[j] then
             Print('ЭТО ДЕРЕВО УЖЕ МАРКНУТО')
             j=i
             Marked=1;
          endif
       next
       Print('MARKED='+str(marked))
       if not Marked then        
          TOFILE[i]=T+' '+X+' '+Y
          Print('Найдено дерево #'+str(i+1)+', '+TOFILE[i])
          i=i+1
       endif
       Marked=0
    endif 
    end:
 until i==99 or UO.InJournal('stopmark')
 UO.CancelTarget()
 Print('МАРК ОКОНЧЕН. НАЙДЕНО ДЕРЕВЬЕВ - '+str(i+1))
 if i then
    f.open()
    f.create()
    txt=safe call f.writeln(i)
    for j=0 to i-1
       tmp=TOFILE[j]
       txt=safe call f.writeln(tmp)
    next
    f.close()
 endif
 UO.Set('quiet',0)
endsub
D3VnuLL
Posts: 87
Joined: 2006-10-08 08:37:57

Post by D3VnuLL »

andrik27 wrote:
NMY wrote:

Code: Select all

Sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4="That is too far away."
var Text5="You can't do much in your current state." 
скрипт надо выкладывать в теги [cоde][/cоde]
спс проста я в этом мало шарю )
а можешьсразу начирикать а то Я не шарю... :)
andrik27
Posts: 10
Joined: 2007-03-05 10:30:41

Post by andrik27 »

to4a wrote:я себе в скрипт от этого автора писал марк, кликать всё равно прийдется самому(имхо так лучше и нихрена оно не напряжно, я 100 деревьев за 2-3 минуты намаркал), но не нужна кирка, и процесс прородит быстрее потому что ему не надо ждать ответа от сервака пока заюзается кирка, чтоб остановить - произнести чаром stopmark:

Code: Select all

sub normmark()
 var f=file("C:\trees3.dat") #ФАЙЛ ДЕРЕВЬЕВ
 UO.DeleteJournal()
 DIM TOFILE[100]
 var i=0,j=0,T,X,Y,S,TMP='',TXT,Marked=0;
 repeat
    Print('Покажите дерево?')
    UO.CancelTarget()
    UO.AddObject('tree')
    while UO.Targeting() and not UO.InJournal('stopmark')
       wait(100)     
    wend
    if UO.InJournal('stopmark') then
      goto end
    endif
    UO.AddObject('tree','lasttarget')
    if UO.LastTile(0)<>3283 and UO.LastTile(0)<>3289 and UO.LastTile(0)<>3277 and UO.LastTile(0)<>3291 and UO.LastTile(0)<>3293 and UO.LastTile(0)<>3294 and UO.LastTile(0)<>3296 and UO.LastTile(0)<>3302 and UO.LastTile(0)<>3299  and UO.LastTile(0)<>3290  and UO.LastTile(0)<>3288  and UO.LastTile(0)<>3286  and UO.LastTile(0)<>3280 then
       Print('ЭТО НЕ ДЕРЕВО...')
    else   
       T=str(UO.LastTile(0))
       X=str(UO.LastTile(1))
       Y=str(UO.LastTile(2))
       for j=0 to i
          if T+' '+X+' '+Y==TOFILE[j] then
             Print('ЭТО ДЕРЕВО УЖЕ МАРКНУТО')
             j=i
             Marked=1;
          endif
       next
       Print('MARKED='+str(marked))
       if not Marked then        
          TOFILE[i]=T+' '+X+' '+Y
          Print('Найдено дерево #'+str(i+1)+', '+TOFILE[i])
          i=i+1
       endif
       Marked=0
    endif 
    end:
 until i==99 or UO.InJournal('stopmark')
 UO.CancelTarget()
 Print('МАРК ОКОНЧЕН. НАЙДЕНО ДЕРЕВЬЕВ - '+str(i+1))
 if i then
    f.open()
    f.create()
    txt=safe call f.writeln(i)
    for j=0 to i-1
       tmp=TOFILE[j]
       txt=safe call f.writeln(tmp)
    next
    f.close()
 endif
 UO.Set('quiet',0)
endsub
у меня сдесь принт показывает неработает ((
Fuzz noise
Posts: 5
Joined: 2007-05-30 12:38:31

Post by Fuzz noise »

у меня вопрос по скрипту на ламбер, нельзя ли там зделать какнить чтоб вместо прихода к сундуку, он реколился к нему после того как соберет логи, напишите хотябы саму процедуру рекола и куда ее вставить пожалуйста а то я ваще непонимаю как этот скрипт работает...
Fuzz noise
Posts: 5
Joined: 2007-05-30 12:38:31

Post by Fuzz noise »

Fuzz noise wrote:у меня вопрос ...
вопрос исчерпан, Едред респект уроки скрипта в тему спасибо огромное... помог реально чайнику=))
jahunjuh
Posts: 7
Joined: 2007-04-17 13:58:50

Post by jahunjuh »

можете помочь пожалуйсто! вот у меня иногда скрипт вот этот о котором щас говорят не хочет работать! я уже рублю три дня и все работает а вот щас пару минут назад только запустил его - выбрал топор - потом на рунбук а потом ошибка
- Unhendled exception in parser! И вообще никак -( в чем проблема?
DIDron
Posts: 54
Joined: 2007-07-09 18:48:42

Post by DIDron »

нехера твой марк не работает принты ошибку выдают так как я не разбираюсь то из тебя говнянфй обьяснител
BETEPAH2
Posts: 33
Joined: 2007-08-15 20:07:20
Contact:

Post by BETEPAH2 »

На авто поиск есть хороший скрипт на АSMе так что прошу в другую тему.
Post Reply