Mining у дома
Posted: 2004-11-18 10:23:16
Гоняю я на ДРВ. 2 дома стоят у горы, гора слева под наклоном вправо.
Я нашёл у себя какой-то скрипт, вродебы хороший но не могу его наладить, помогите плЫззз!
Вот он:
var fWav = 'D:\Games\uo\DingDong.wav' ;wav-файл который будет проигрываться при откапавании Элема
var f=file('C:\Ultima\progs\Injection\mining.txt') ;файл где координаты лежат
var tShovel='0x0E85' ; кирка/лопата
var HidingWalk = 1 ; 0/1 - 1 будет прятаться при хотьбе, 0 - не будет.
sub main()
var i
var mCount
dim x[12]
dim y[12]
f.open()
mCount=safe call f.ReadNumber()
for i=1 to mCount
X[i]=safe call f.ReadNumber()
Y[i]=safe call f.ReadNumber()
next
f.close()
while not UO.Dead()
for i=1 to mCount
GotoXY(x[i],y[i])
if i < mCount then
uo.print(str(i) + ' ' + str(mcount))
Dig()
else
Unload()
end if
if UO.Dead() then
GoExit()
end if
next
wend
end sub
sub Dig()
var mx = UO.GetX("self"), my = UO.GetY("self"), mz = UO.GetZ("self"),TileNum='1339', t=0
var i,j
for i = mx-1 to mx+1
for j = my-3 to my+3
tohide()
UO.Print("Now Mining In: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock")
tohide()
CheckLag()
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype(tShovel)
while not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait(500)
wend
if UO.InJournal("but fail") then
wait(1000)
end if
wend
UO.DeleteJournal()
next
next
if t == 1 then
UO.PlayWav(fWav)
GoExit()
end if
return 1
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
HidingPress(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
HidingPress(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
HidingPress(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
HidingPress(39)
next
end if
halt=15
end if
if Numb(x-myX)==0 and Numb(y-myY)==0 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
HidingPress(38)
next
else
for z=0 to 3
HidingPress(37)
next
end if
else
if y<=myY then
for z=0 to 3
HidingPress(39)
next
else
for z=0 to 3
HidingPress(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 HidingPress(KeyCode)
if HidingWalk == 1 then
ToHide()
end if
CheckAtack()
UO.Press(KeyCode)
end sub
sub ToHide()
while not UO.Hidden()
CheckAtack()
CheckLag()
UO.WarMode(0)
UO.UseSkill('Hiding')
repeat
wait(200)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preocopured') or UO.InJournal("attacking you") or UO.Dead()
CheckAtack()
wend
end sub
sub UnLoad()
var i
DIM Item[13]
Item[1]=0x19B9 ; >3 ore
Item[2]=0x19B7 ; 1 ore
Item[3]=0x19BA ; 2 ore
Item[4]=0x19B8 ; 3 ore
Item[5]=0x0F11 ; saphires
Item[6]=0x0F16 ; amethysts
Item[7]=0x0F18 ; tourmalines
Item[8]=0x0F15 ; citrines
Item[9]=0x0F10 ; emeralds
Item[10]=0x0F0F ; star sapphires
Item[11]=0x0F26 ; diamonds
Item[12]=0x0EED ; gold
for i = 1 to 12
UO.FindType(Item[i], '-1', 'backpack')
while UO.GetQuantity('finditem') > 0
UO.MoveItem('finditem','-1','0x40299B0D')
Wait(1000)
CheckLag()
UO.FindType(Item[i], '-1', 'backpack')
wend
next
end sub
sub CheckAtack()
if UO.InJournal("attacking you") then
wait(20000)
end if
if UO.Dead() then
return 0
end if
end sub
sub CheckLag()
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
end sub
sub GoExit()
UO.CloseUO()
end sub
Я нашёл у себя какой-то скрипт, вродебы хороший но не могу его наладить, помогите плЫззз!
Вот он:
var fWav = 'D:\Games\uo\DingDong.wav' ;wav-файл который будет проигрываться при откапавании Элема
var f=file('C:\Ultima\progs\Injection\mining.txt') ;файл где координаты лежат
var tShovel='0x0E85' ; кирка/лопата
var HidingWalk = 1 ; 0/1 - 1 будет прятаться при хотьбе, 0 - не будет.
sub main()
var i
var mCount
dim x[12]
dim y[12]
f.open()
mCount=safe call f.ReadNumber()
for i=1 to mCount
X[i]=safe call f.ReadNumber()
Y[i]=safe call f.ReadNumber()
next
f.close()
while not UO.Dead()
for i=1 to mCount
GotoXY(x[i],y[i])
if i < mCount then
uo.print(str(i) + ' ' + str(mcount))
Dig()
else
Unload()
end if
if UO.Dead() then
GoExit()
end if
next
wend
end sub
sub Dig()
var mx = UO.GetX("self"), my = UO.GetY("self"), mz = UO.GetZ("self"),TileNum='1339', t=0
var i,j
for i = mx-1 to mx+1
for j = my-3 to my+3
tohide()
UO.Print("Now Mining In: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock")
tohide()
CheckLag()
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype(tShovel)
while not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait(500)
wend
if UO.InJournal("but fail") then
wait(1000)
end if
wend
UO.DeleteJournal()
next
next
if t == 1 then
UO.PlayWav(fWav)
GoExit()
end if
return 1
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
HidingPress(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
HidingPress(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
HidingPress(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
HidingPress(39)
next
end if
halt=15
end if
if Numb(x-myX)==0 and Numb(y-myY)==0 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
HidingPress(38)
next
else
for z=0 to 3
HidingPress(37)
next
end if
else
if y<=myY then
for z=0 to 3
HidingPress(39)
next
else
for z=0 to 3
HidingPress(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 HidingPress(KeyCode)
if HidingWalk == 1 then
ToHide()
end if
CheckAtack()
UO.Press(KeyCode)
end sub
sub ToHide()
while not UO.Hidden()
CheckAtack()
CheckLag()
UO.WarMode(0)
UO.UseSkill('Hiding')
repeat
wait(200)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preocopured') or UO.InJournal("attacking you") or UO.Dead()
CheckAtack()
wend
end sub
sub UnLoad()
var i
DIM Item[13]
Item[1]=0x19B9 ; >3 ore
Item[2]=0x19B7 ; 1 ore
Item[3]=0x19BA ; 2 ore
Item[4]=0x19B8 ; 3 ore
Item[5]=0x0F11 ; saphires
Item[6]=0x0F16 ; amethysts
Item[7]=0x0F18 ; tourmalines
Item[8]=0x0F15 ; citrines
Item[9]=0x0F10 ; emeralds
Item[10]=0x0F0F ; star sapphires
Item[11]=0x0F26 ; diamonds
Item[12]=0x0EED ; gold
for i = 1 to 12
UO.FindType(Item[i], '-1', 'backpack')
while UO.GetQuantity('finditem') > 0
UO.MoveItem('finditem','-1','0x40299B0D')
Wait(1000)
CheckLag()
UO.FindType(Item[i], '-1', 'backpack')
wend
next
end sub
sub CheckAtack()
if UO.InJournal("attacking you") then
wait(20000)
end if
if UO.Dead() then
return 0
end if
end sub
sub CheckLag()
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
end sub
sub GoExit()
UO.CloseUO()
end sub