помогите с ламбером

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Alarm
Posts: 9
Joined: 2005-07-06 22:35:32

помогите с ламбером

Post by Alarm »

вообщем вот скрипт, сделайте плиз чтобы он продавал простые логи когда набирает 1.5к логов

Code: Select all

var f=file("C:\trees33.dat") ## - Ïóòü ê ôàéëó â êîòîðîì áóäóò õðàíèòñÿ êîîðäèíàòû äåðåâüåâ.
var Area=3 ## - Ðàçìåð îáðàáàòûâàåìîé òåððèòîðèè, ìîæíî ìåíÿòü îò 1 äî 4
var TryHiding=1 ## 1 - Ïåðåä òåì êàê ðóáèòü äåðåâî, áóäåò ïûòàòüñÿ óéòè â õàéä, 0 - íå áóäåò .
var TryRecall=1 ## 1 - Ïîñëå òîãî êàê ñîáåðåò LogsQty ëîãîâ, áóäåò ïûòàòüñÿ ðåêîëèòüñÿ äîìîé, 
var LogsQty=3000 ## - Êîëè÷åñòâî ëîãîâ, äîáûâ êîòîðîå íàäî ðåêîëèòüñÿ äîìîé. 
var GetFromFile=1 ## 1 - Êîîðäèíàòû äåðåâüåâ áóäóò ñ÷èòûâàòñÿ èç ôàéëà, 0 - ñîáèðàòñÿ èç êëèåíòà 
var Sound=('d:\uo\injection\change.wav') ## - Çâóê êîòîðûi áóäåò ïðèãðàí ïðè àòàêå.(çàìåíèòå íà ñâîé)
var Chest='0x40001AA8' ## - ID ñóíäóêà êóäà áóäóò âûãðóæàòüñÿ ëîãè è ãäå äîëæíû ëåæàòü ðåêîëû.
var Cont='0x40001AA8'
var oldX,oldY,time ## - Äëÿ ðåêîëà.
var food= '0x097B' 
var Cont1 = '0x40007D9C'
###################################################################
sub Lumberjacking() 
var i=0,j=0,k=0,r=0,q=0,ii,jj 
var TopX=324,TopY=65 
dim TreeX[500], TreeY[500],TreeT[500] 
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 'Êëèêàé íà äåðåâüÿ!'") 

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('Ñîáèðàåì êîîðäèíàòû äåðåâüåâ â îêðóãå...') 
for q=1 to Area 
if q==2 then 
GotoXY(uo.getX()+20,uo.getY()-10) 
end if 
if q==3 then 
GotoXY(uo.getX(),uo.getY()+20) 
end if 
if q==4 then 
GotoXY(uo.getX()-20,uo.getY()) 
end if 
for r=0 to 3 
if r==1 then 
GotoXY(uo.getX()+10,uo.getY()) 
end if 
if r==2 then 
GotoXY(uo.getX(),uo.getY()+10) 
end if 
if r==3 then 
GotoXY(uo.getX()-10,uo.getY()) 
end if 
for j=0 to 8 
for i=0 to 8 
clicks=0 
flag=0 
uo.DeleteJournal()
####################### 
### Êëèêàåì íà òàéë ###
#######################
uo.UseObject('Pickaxe')
waitForTarget() 
uo.DeleteJournal() 
WaitForTryRock()
############################### 
### Ïðîâåðÿåì äåðåâî ëè ýòî ###
###############################
flag=0 
for k=0 to 9 
if uo.LastTile(0)==TreeTile[k]+1 then 
flag=2 
end if 
next 
if flag==0 then 
for k=0 to 9 
if uo.LastTile(0)==TreeTile[k] then 
flag=1 
end if 
next 
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('Íàéäåíî äåðåâî: 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('Íàéäåíî äåðåâî: x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2))+' '+str(treeCount)) 
end if 
end if 
next 
next 
next 
next 
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 
uo.Print('Èäó '+str(i)+': x='+str(TreeX[i])+' y='+str(TreeY[i])) 
InfoLogs() 
flag=GotoXY(TreeX[i],TreeY[i]) 
if flag==1 then 
GetTree(str(TreeT[i]),str(TreeX[i]),str(TreeY[i]),str(uo.GetZ())) 
end if 
next 
end if 
wend 
end sub 
###########################################################3
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() 
CheckLag()
uo.WaitTargetTile(Type,X,Y,Z) 
uo.UseObject('Axe') 
if WaitForChange()==1 then 
return 1 
end if 
next 
return 0 
end sub 

#####################################################################################
sub WaitForChange() 
var Text1='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='It appears immune to your blow'
var Text5='It is too far away.'
var Text6='That is too far away.'
var Text7='There is nothing here to chop.'
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 or uo.Journal(0)==Text5 or uo.Journal(0)==Text6 or uo.Journal(0)==Text7 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:\trees33.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 InfoLogs()
if UO.Weight>300 then 
	while uo.weight>100
		Uo.deleteJournal()
   		UO.Automenu("Carpentry","Weapons & Tools") 
   		UO.Automenu("Weapons & Tools","fishing pole") 
		UO.UseType('0x1034') 
		wait(3000)
		repeat
		wait(100)
		until uo.injournal("You put") or uo.injournal("fail")
		Uo.deleteJournal()
		wait(500)
	wend
 # UO.Say(".sell") 
# UO.Waittargettype('0x1BDD',0x0000) 
# wait(1000) 
# UO.LClick(341,315)   
# wait(300)         
 end if
uo.Print('Ó âàñ âñåãî '+str(uo.Count('0x1BDD'))+' ëîãîâ') 
uo.Print(str(uo.Count('0x1BDD','0x0000'))+' ïðîñòûõ è ' +str(uo.Count('0x1BDD')-uo.Count('0x1BDD','0x0000'))+' öâåòíûõ')
end sub

###################################################################
sub MakeTime() 
var d,t,ret,i 
ret=str(uo.Time()) 
t="" 
for i=0 to Len(ret) 
t=ret[Len(ret)-i]+t 
if (i==2) or (i==4) then 
t=":"+t 
end if 
next 
ret=str(uo.Date()) 
d="" 
for i=0 to Len(ret) 
d=ret[Len(ret)-i] + d 
if (i==2) or (i==4) then 
d="."+d 
end if 
next 
ret=t+" @ "+d 
return ret 
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

Alarm
Posts: 9
Joined: 2005-07-06 22:35:32

Post by Alarm »

UР помогите плиз!
Post Reply