|
Вот тебе простой скрипт майнинга: Передвигается по контрольным точкам, которые ты указываешь в массиве, копает пока не достигнет предела веса, потом через рунбук телепортируется домой выкладывает добро в ящик, берет из ящика реколы и хлеб, перезаряжает рунбук, телепортируется назад, идет к месту копки и т.д.
;hiding отключен
;айрон выкапывается полностью
sub mining()
var fistx, fisty, fistz, mx, my, mz, i, j
var nowI = 0
fistx = UO.GetX("self")
fisty = UO.GetY("self")
fistz = UO.GetZ("self")
while 1 < 2
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
; hide(); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
UO.DeleteJournal()
for i = mx-1 to mx+1
for j = my -2 to my+2
if UO.dead() then
return
endif
UO.Print("Ковыряюсь в: "+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")
UO.DeleteJournal()
UO.Waittargettile("1343", str(i), str(j), str(mz)) ;
UO.Usetype("0x0F39") ;НОМЕР ЛОПАТЫ
while not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("no ore here") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait (100)
wend
if UO.InJournal("Ore Elemental") then
wait(1000)
UO.Say("guards")
wait(2000)
UO.Say("guards")
hide()
endif
if UO.dead() then
return
endif
if UO.Weight>(UO.STR*4) then
GoHome()
hide()
endif
wend
UO.DeleteJournal()
next
next
; walk(fistx)
nowI = walk1(nowI)
if nowI == 0 then
UO.print("Все, путь закончился")
GoHome()
endif
UO.usetype (0x103B) ;НОМЕР ХЛЕБА
wait(2000)
wend
end sub
sub GoHome()
var x1,y1,x2,y2
UO.print("Полетел домой, добро выкладывать!")
UO.DeleteJournal()
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
uo.recall(0x400C6DE5,2) ;Уникальный НОМЕР РУНБУКА
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
UO.Print("выкладываем добро")
VAR Cont=0x4004929B
UO.SetReceivingContainer(Cont)
UO.DeleteJournal()
UO.FindType('0x19B9','0xffff','my')
while uo.FindCount() <> 0
UO.DeleteJournal()
UO.FindType('0x19B9','0xffff','my')
# UO.print(str(uo.FindCount()))
UO.Grab('0','finditem')
wait(1500)
wend
UO.DeleteJournal()
UO.FindType('0x19B8','0xffff','my')
while uo.FindCount() <> 0
UO.DeleteJournal()
UO.FindType('0x19B8','0xffff','my')
# UO.print(str(uo.FindCount()))
UO.Grab('0','finditem')
wait(1500)
wend
UO.DeleteJournal()
UO.FindType('0x19B7','0xffff','my')
while uo.FindCount() <> 0
UO.DeleteJournal()
UO.FindType('0x19B7','0xffff','my')
# UO.print(str(uo.FindCount()))
UO.Grab('0','finditem')
wait(1500)
wend
UO.DeleteJournal()
UO.FindType('0x19BA','0xffff','my')
while uo.FindCount() <> 0
UO.DeleteJournal()
UO.FindType('0x19BA','0xffff','my')
# UO.print(str(uo.FindCount()))
UO.Grab('0','finditem')
wait(1500)
wend
UO.UnSetReceivingContainer()
wait(5000)
UO.Print("берем хлеб")
UO.FindType('0x103B','0xffff','my') ;хлеб
UO.Print("у меня хлеба осталось "+str(uo.FindCount()))
if uo.FindCount() == 0 then
;хлеб закончился надо взять еще
UO.FindType('0x103B','0xffff',cont) ;хлеб в сундуке
UO.Print("в сундуке хлеба "+str(uo.FindCount()))
if uo.FindCount() <> 0 then
UO.Grab('10','finditem')
wait(1000)
endif
endif
wait(2000)
UO.FindType('0x1F4C','0xffff','my')
UO.Print("реколов осталось "+str(uo.FindCount()))
if uo.FindCount() == 0 then
UO.FindType('0x1F4C','0xffff',cont) ;реколы в сундуке
UO.Print("в сундуке реколов "+str(uo.FindCount()))
if uo.FindCount() <> 0 then
UO.Print("берем реколы из сундука")
UO.Grab('0','finditem')
wait(1000)
endif
endif
;заряжаем рунбук
UO.Print("заряжаем рунбук")
uo.recall(0x400C6DE5,1) ;Уникальный НОМЕР РУНБУКА
wait(8000)
UO.Print("В шахту")
path1() ;Путь к шахтам номер раз
end sub
sub path1()
var x1,y1,x2,y2,x3,y3
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
UO.print("Поперся по первому пути")
UO.DeleteJournal()
uo.recall(0x400C6DE5,3) ; Уникальный НОМЕР РУНБУКА
while UO.InJournal("some time to recharge")
UO.print("Вот уродский рунбук!!! Жду пока перезарядится")
UO.DeleteJournal()
wait(5000)
uo.recall(0x400C6DE5,3) ; Уникальный НОМЕР РУНБУКА
wend
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
dim x[9],y[9]
var len = 9
;расставляем контрольные точки
x[1] = 5308
y[1] = 123
x[2] = 5302
y[2] = 123
x[3] = 5302
y[3] = 99
x[4] = 5316
y[4] = 99
x[5] = 5316
y[5] = 81
x[6] = 5297
y[6] = 81
x[7] = 5297
y[7] = 66
x[8] = 5299
y[8] = 66
x[9] = 5299
y[9] = 62
var i
; var delay = 500
var LastKey = 0;
i = 1
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
while i <= len
while (x1<>x[i]) or (y1<>y[i])
if y1 > y[i] then
UO.Press(33) ;вправо вверх
if LastKey == 33 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
endif
LastKey = 33
else
if y1 < y[i] then
UO.Press(35) ;влево вниз
if LastKey == 35 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
endif
LastKey = 35
else
if x1 > x[i] then
UO.Press(36) ;влево вверх
if LastKey == 36 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
endif
LastKey = 36
else
if x1 < x[i] then
UO.Press(34) ;вправо вниз
if LastKey == 34 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
endif
LastKey = 34
endif
endif
endif
endif
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
; UO.Print("x1: "+str(x1)+" y1: "+str(y1)+" x2: "+str(x[i])+" y2: "+str(y[i]))
; UO.Print("i: "+str(i))
wend
UO.print("Дошел до контрольной точки "+str(i)+" следующая "+str(i+1))
i = i+1
wend
end sub
sub hide()
while NOT UO.Hidden()
UO.DeleteJournal()
UO.Exec('warmode 0')
UO.UseSkill('Stealth')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied')
wend
end sub
sub walk1(i)
dim x[16],y[16]
var x1,y1,x2,y2
var len = 16
;расставляем контрольные точки
x[1] = 5299
y[1] = 62
x[2] = 5299
y[2] = 66
x[3] = 5288
y[3] = 66
x[4] = 5288
y[4] = 68
x[5] = 5289
y[5] = 68
x[6] = 5289
y[6] = 70
x[7] = 5286
y[7] = 70
x[8] = 5286
y[8] = 72
x[9] = 5285
y[9] = 72
x[10] = 5285
y[10] = 75
x[11] = 5286
y[11] = 75
x[12] = 5286
y[12] = 81
x[13] = 5283
y[13] = 81
x[14] = 5283
y[14] = 86
x[15] = 5284
y[15] = 86
x[16] = 5284
y[16] = 99
var LastKey = 0;
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
;-------------Определяем в какой части пути мы находимся-----------------
var j
;------------Определяем находимся ли мы в контрольной точке-------------
if i == 0 then
for j = 1 to len
if (x1==x[j]) and (y1==y[j]) then
UO.print("Нахожусь в контрольной точке номер "+str(j))
i = j+1
if i>len then
return 0
endif
endif
next
endif
;-----Определяем между какими контрольными точками мы находимся по X-----
if i==0 then
for j = 1 to len-1
if x1 == x[j] then
if x1 == x[j+1] then
if ((y1>y[j]) and (y1<y[j+1])) or ((y1<y[j]) and (y1>y[j+1])) then
UO.print("Нахожусь между контрольными точками "+str(j)+" и "+str(j+1))
i = j+1
endif
endif
endif
next
endif
;-----Определяем между какими контрольными точками мы находимся по Y-----
if i==0 then
for j = 1 to len-1
if y1 == y[j] then
if y1 == y[j+1] then
if ((x1>x[j]) and (x1<x[j+1])) or ((x1<x[j]) and (x1>x[j+1])) then
UO.print("Нахожусь между контрольными точками "+str(j)+" и "+str(j+1))
i = j+1
endif
endif
endif
next
endif
;--------Если расположение не найдено тогда облом------------------------
if i==0 then
UO.print("Хрен его знает где я нахожусь!!!")
wait(5000)
return 0
endif
;------------------------------------------------------------------------
if y1 > y[i] then
key1:
UO.Press(33) ;вправо вверх
if LastKey == 33 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
else
LastKey = 33
goto key1
endif
LastKey = 33
else
if y1 < y[i] then
key2:
UO.Press(35) ;влево вниз
if LastKey == 35 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
else
LastKey = 35
goto key2
endif
LastKey = 35
else
if x1 > x[i] then
key3:
UO.Press(36) ;влево вверх
if LastKey == 36 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
else
LastKey = 36
goto key3
endif
LastKey = 36
else
if x1 < x[i] then
key4:
UO.Press(34) ;вправо вниз
if LastKey == 34 then
while (x1 == x2) and (y1 == y2)
wait(100)
x2 = UO.GetX("self")
y2 = UO.GetY("self")
wend
else
LastKey = 34
goto key4
endif
LastKey = 34
endif
endif
endif
endif
x1 = UO.GetX("self")
y1 = UO.GetY("self")
x2 = UO.GetX("self")
y2 = UO.GetY("self")
UO.Print("x1: "+str(x1)+" y1: "+str(y1)+" x2: "+str(x[i])+" y2: "+str(y[i]))
; UO.Print("i: "+str(i))
if (x1==x[i]) or (y1==y[i]) then
UO.print("Дошел до контрольной точки "+str(i)+" следующая "+str(i+1))
i = i+1
endif
if i > len then
return 0
else
return i
endif
end sub
sub coords()
var x,y
x = UO.GetX("self")
y = UO.GetY("self")
UO.Print("x: "+str(x)+" y: "+str(y))
end sub
|