Помогите со скриптом

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
poiulkjh
Posts: 1
Joined: 2004-12-30 16:34:23

Помогите со скриптом

Post by poiulkjh »

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

VAR RuneToHome=1 ## - Номер руны Домой,по счёту в рунбуке.(сейчас в 4ом слоте,можно менять от 1-9)
##
VAR RuneToRocks=9 ## - Номер руны в Лес,по счёту в рунбуке.(сейчас в 5ом слоте,можно менять от 1-9)
##
var Meshok='0x40150111' ## - ID сундука куда будут выгружаться логи, где должны лежать реколы и еда.
###
sub mining()
VAR i,ore,count,kol
VAR myx=file('c:\myx.txt')
DIM PointX[500],PointY[500],CoordX[500],CoordY[500]

uo.print('RunBook: ')
uo.exec('addobject Runebook')
while uo.targeting()
wait(100)
wend

myx.open()
kol=safe call myx.readNumber()
for i=1 to kol
PointX[i]=safe call myx.ReadNumber()
PointY[i]=safe call myx.ReadNumber()
CoordX[i]=safe call myx.ReadNumber()
CoordY[i]=safe call myx.ReadNumber()
next
myx.close()

repeat
for i=1 to kol
gotoXY(CoordX[i],CoordY[i]) #идём к координате
repeat
checklag()
ore=0
Hide()
UO.DeleteJournal()
uo.waittargettile('0', STR(PointX[i]), STR(PointY[i]), '0')
uo.UseType('0x0E85')
while NOT UO.InJournal("Try mining") AND NOT UO.InJournal("no line of") AND NOT UO.InJournal("You put") AND NOT UO.InJournal("no ore") AND NOT UO.InJournal("far away") AND NOT UO.InJournal("but fail") AND count<100
wait(100)
count=count+1
wend
count=0
if UO.InJournal("You put") OR UO.InJournal("but fail") then
ore=1
end if
if UO.Weight>700 then
Recall()
wait(3000)
gotoXY(CoordX[i],CoordY[i])
endif
Until ore==0
next
Until UO.Dead()
end sub

sub mark()
VAR area=0 #количество точек копания
VAR i,i2,ore,count
DIM markx[500],marky[500],coordx[500],coordy[500]
for i=1 to 500
repeat
count=0
ore=0
UO.DeleteJournal()
UO.UseType('0x0E86')
while uo.Targeting()
wait(100)
wend
while NOT UO.InJournal("Try mining") AND NOT UO.InJournal("You can't") AND NOT UO.InJournal("no line of") AND NOT UO.InJournal("You put") AND NOT UO.InJournal("no ore") AND NOT UO.InJournal("far away") AND NOT UO.InJournal("but fail") AND count<100
wait(100)
count=count+1
wend
if NOT UO.InJournal("You put") AND NOT UO.InJournal("but fail") AND NOT UO.InJournal("no ore") then
ore=1
end if
for i2=1 to 500
if markx[i2]==uo.lastTile(1) AND marky[i2]==uo.lastTile(2) then
ore=1
end if
next
if ore==0 then
markx[i]=UO.LastTile(1)
marky[i]=UO.LastTile(2)
coordx[i]=UO.GetX()
coordy[i]=UO.GetY()
end if
Until ore==0
area=area+1
UO.Print("Saving...")
savetofile(area,markx,marky,coordx,coordy)
next
end sub

sub Hide()
while not UO.Hidden()
uo.print('Hiding...')
uo.deletejournal()
UO.UseSkill('Stealth')
wait(4000)
wend
end sub

sub Recall()
VAR logs=0
RecallToHome()
wait(500)
uo.press(36)
wait(500)
uo.press(36)
wait(500)
repeat
wait(500)
repeat
wait(500)
repeat
wait(500)
repeat
wait(600)

UO.SetReceivingContainer(Meshok)
repeat
Uo.FindType('0x19B9','-1','backpack')
logs=UO.GetQuantity('finditem')
if logs>0 then
uo.findtype('0x19B9')
wait(500)
UO.Grab('all','finditem')
wait(1000)
end if
until logs==0
UO.UnSetReceivingContainer(Meshok)
wait(2000)
UO.SetReceivingContainer(Meshok)
repeat
Uo.FindType('0x19B7','-1','backpack')
logs=UO.GetQuantity('finditem')
if logs>0 then
uo.findtype('0x19B7')
wait(500)
UO.Grab('all','finditem')
wait(1000)
end if
until logs==0
UO.UnSetReceivingContainer(Meshok)
wait(2000)
UO.SetReceivingContainer(Meshok)
repeat
Uo.FindType('0x19BA','-1','backpack')
logs=UO.GetQuantity('finditem')
if logs>0 then
uo.findtype('0x19BA')
wait(500)
UO.Grab('all','finditem')
wait(1000)
end if
until logs==0
UO.UnSetReceivingContainer(Meshok)
RecallToRocks()
end sub

sub RecallToHome()
uo.Print('Prigaem domoy.')
RuneBookRecall(RuneToHome)
wait(9000)
end sub

sub RecallToRocks()
uo.Print('Prigaem v les.')
RuneBookRecall(RuneToRocks)
wait(9000)
end sub

sub RuneBookRecall(n)
var OldX=uo.GetX()
var OldY=uo.GetY()
var Time
repeat
uo.Exec('warmode 0')
uo.UseObject('Runebook')
CheckLag()
uo.Lclick(135, n*15+55)
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs')
end sub

sub mark2()
VAR area #количество точек копания
VAR i,i2,ore,count
DIM markx[500],marky[500],coordx[500],coordy[500]
for i=1 to area
repeat
count=0
ore=0
UO.DeleteJournal()
UO.UseType('0x0E85')
while uo.Targeting()
wait(100)
wend
while NOT UO.InJournal("Try mining") AND NOT UO.InJournal("You can't") AND NOT UO.InJournal("no line of") AND NOT UO.InJournal("You put") AND NOT UO.InJournal("no ore") AND NOT UO.InJournal("far away") AND NOT UO.InJournal("but fail") AND count<100
wait(100)
count=count+1
wend
if NOT UO.InJournal("You put") AND NOT UO.InJournal("but fail") AND NOT UO.InJournal("no ore") then
ore=1
end if
for i2=1 to area
if markx[i2]==uo.lastTile(1) AND marky[i2]==uo.lastTile(2) then
ore=1
end if
next
if ore==0 then
markx[i]=UO.LastTile(1)
marky[i]=UO.LastTile(2)
coordx[i]=UO.GetX()
coordy[i]=UO.GetY()
end if
Until ore==0
next
UO.Print("Saving...")
savetofile(area,markx,marky,coordx,coordy)
end sub

sub Hide()
while not UO.Hidden()
uo.print('Hiding...')
uo.deletejournal()
UO.UseSkill('Stealth')
wait(4000)
wend
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 abs(x-myX)<=1 AND abs(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 abs(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub

sub SaveToFile(points,px,py,cx,cy)
var f=file('C:\myx.txt')
var s=0,i=0
f.open()
f.create()
s=safe call f.writeln(points)
for i=1 to points
s=safe call f.writeln(str(px[i])+' '+str(py[i])+' '+str(cx[i])+' '+str(cy[i]))
next
f.close()
end sub

sub SaveToFile2(points,px,py,cx,cy)
var f=file('C:\myx.txt')
var s=0,i=0
f.open()
f.create()
s=safe call f.writeln(points)
for i=1 to points
s=safe call f.writeln(str(px[i])+' '+str(py[i])+' '+str(cx[i])+' '+str(cy[i]))
next
f.close()
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')

repeat
wait(500)
until UO.InJournal('backpack')
end sub

sub eat()
repeat
UO.UseType('0x097B')
wait(100000)
until UO.Dead()
end sub
Post Reply