Code: Select all
################ Рудокоп #################
Sub Mine()
VAR Shovel1 = '0x0F3A'
VAR Shovel2 = '0x0F39'
VAR Pickaxe1 = '0x0F39'
VAR Pickaxe2 = '0x0F39'
VAR MaxRange = 2
VAR X, Y, Z, Tiles
VAR mX, mY, mZ
VAR MaxVes = 610
; UO.Set('quiet','0')
UO.Msg(".resync")
mX = UO.GetX('self')
mY = UO.GetY('self')
mZ = UO.GetZ('self')
for Y = MaxRange - ( MaxRange * 2 ) to MaxRange
for X = MaxRange - ( MaxRange * 2 ) to MaxRange
Tiles = MiningTiles(mX+X, mY+Y)
if Tiles then
UO.DeleteJournal()
repeat
UO.Set('quiet','1')
UO.DeleteJournal()
UO.Warmode(0)
UO.WaitTargetTile(Tiles, mX+X, mY+Y, mZ)
UO.FindType(Shovel1,-1,'my')
if UO.FindCount() then
UO.UseType(Shovel1)
else
UO.FindType(Shovel2,-1,'my')
if UO.FindCount() then
UO.UseType(Shovel2)
else
UO.FindType(Pickaxe1,-1,'my')
if UO.FindCount() then
UO.UseType(Pickaxe1)
else
UO.FindType(Pickaxe2,-1,'my')
if UO.FindCount() then
UO.UseType(Pickaxe2)
else
UO.Set('quiet','0')
UO.Print("ERROR: Нечем копать!!!")
return
endif
endif
endif
endif
LastTimer=UO.Timer()
repeat
wait(100)
until UO.InJournal("%|destroyed|useable|выкопали|0xAD00|0xA867|0xA2DE|0xAD03|0x5DE0|0x5DE1|0x5DE2|0x5DE3|0x5DE4|0x5DE5|0x5DE6|0x5DE7|Вы положили|put the|is nothing here to mine|Wthere do you|Вам не удалось|У вас нет|have no line|ничего|Тут ничего|Попробуйте|Try mining elsewhere") || UO.Timer()>LastTimer+100 || UO.Weight > MaxVes || UO.Dead()
until UO.InJournal("%|destroyed|0xAD00|0xA867|0xA2DE|Тут ничего|is nothing here to mine|нет руды|У вас нет|have no line|Попробуйте|Try mining elsewhere") || UO.Timer()>LastTimer+500 || UO.Weight > MaxVes || UO.Dead()
############################
#ПЕРЕГРУЗ!!!#
############################
If UO.Weight > MaxVes Then
UO.Print('Перегруз!')
wait(500)
return
endif
############################
endif
next
next
UO.Set('quiet','0')
UO.Print("Все")
UO.Sound(100)
return 0
end sub
Sub MiningTiles(X,Y)
var i
if UO.PrivateGetTile(X, Y, -1, 616, 618) then
for i=616 to 618
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 1339, 1363) then
for i=1339 to 1363
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 2272, 2282) then
for i=2272 to 2282
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 4963, 4973) then
for i=4963 to 4973
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 6001, 6012) then
for i=6001 to 6012
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 13121, 13369) then
for i=13121 to 13369
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 13446, 13455) then
for i=13446 to 13455
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 13484, 13492) then
for i=13484 to 13492
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
if UO.PrivateGetTile(X, Y, -1, 13625, 13628) then
for i=13625 to 13628
if UO.PrivateGetTile(X, Y, -1, i, i) then
return i
end if
next
end if
return 0; No Mining Tiles
end sub
Как я понял,он копает скалы.Но у меня есть проблема,начинает копать,когда выкапывает все из кочки я подхожу к другой,но чето-то не копает...Или он не так работает,а как-то подругому,т.е. принцип скрипта не тот?(=