Page 1 of 1

Плиз дайте скрипт на мининг у скалл.

Posted: 2006-05-27 15:33:24
by Dreygon
Точки чтобы надо было маркать . патом ходил по точкам потом летел домой и ложил в сундук потом опять копать! плиз

Posted: 2006-05-27 15:50:29
by Nmy

Posted: 2006-05-27 16:03:53
by DerMeister =)
Там нету реколла в дом.

Posted: 2006-05-27 16:37:44
by Nmy
DerMeister =) wrote:Там нету реколла в дом.
извините я иго нечитал...

вот скрипт, он старый...

Code: Select all

######################################################### 
###    Mining Mountains / Копание скалл v5.1.7 Full   ### 
#########################################################
###         Шард Dragon World / www.drw.ru            ###
#########################################################
### Внимание: 
### Для  работы скрипта нужна версия YokoInjection 4ZD. 
### Скачать dll этой версии можно                      
### от сюда: http://www.swines.nm.ru/injection.zip     
#########################################################
### Авторы:
### -Автор скрипта:"Аskaneli".
### -Редактировал и дополнял:"BETEPAH".
### -Идеи и редкатирование скрипта:"cOoler". 
### -За помощь в доработке скрипта спасибо:"Legio". 
### Спасибо всем кто каким либо образом помогал в
### разработке этого скрипта.
#########################################################
############################
### Описание и настройка ###
############################
### Обратите внимание на значки "]![" ими выделенны важные сообщения.
###
### Чар бегает от точки к точке (координаты точек берет из файла).
### Выкопает, бежит к следующей, при весе 600 стоунов в паке порталится домой 
### скидывает руду в сундук,
### после реколится обратно бежит к последней точке копания и продолжает копать.
### Пример: В файле 100 точек копания, вы выкопав 74 дошли до придела в весе в 
### 600 стоунов сработала система рекола
### и вы "порталитесь" домой и складываете руду в сундук, после вы реколитесь 
### обратно к месту копаня и бежите к 75 точке.
### Дойдя до 100 точки (тоесть последней в списке) чар перейдет к 1ой точке.
### (Цикличность)
### ]![ Для корректной работы скрипта нужно замарчить не менее 80 точек. ]![
###
####################
### Нововведения ###
####################
### 1)Полностью изменены системы сброса руды и рекола по руне от пк(теперь 
### физлить невозможно). [cOoler]
### 2)Временно удалены функции - речарж рунбуки и хаванья, в следующих версиях 
### опять появяться!. [cOoler]
### 3)Доработана ходилка, теперь проверяет растояние от точки до чара при 
### каждом шаге. [cOoler]
### 4)Теперь сундук для логов задается таргетом вместе с рунбукой и руной ... 
### рекол на место копания происходит автоматом. [cOoler]
### ]![ ПРИ возникновении глюков .. ошибок и другой лабуды пишите в ICQ! ]![
###
###################################
###    Режимы работы скрипта    ###	
###################################
###   Работает в 2х режимах:    ### 
###   1)Маркировка              ###
###   2)Копание                 ###
###################################
### Режим Первый - "Маркировка" ### 
###################################
### Этот режим отвечает за Маркирование(записывание координат) точек копания. 
### Включается переменной var GetFromFile=0 ## 1 - координаты деревьев будут 
### считыватся из файла, 0 - собиратся из клиента. 
### То есть если GetFromFile=0 координаты деревьев собиратся из клиента. 
###
### Маркировка происходит так: 
### Поставте переменную GetFromFile равную 0 (GetFromFile=0).
### Положите к себе в сумку Рунбук(с рунами домой и в лес), Руну(в безопастное 
### место) и Кирку. 
### Идите на место где вы хотите копать.
### Запустите Скрипт GoMining(), инжект попросит вас указать Рунбук
### (появится прицел,прицелом на него). 
### Инжект сообщит вам что ('Собираем координаты руды в округе...').
### Инжект возьмет в руки Кирку.
### Теперь вы должны в любом порядке сами прицелом указать координаты
### (достаточно просто нажать прицелом на скалу или пол в шахте).
### ]![ Для марка точек капания требуется соблюдать расстояние больше чем 4 
### тайла, т.е. чтобы чар не копал. ]![
### Если вы не промахнулись и "нажали" на подходящее для копания место, то 
### инжект сообщит вам об этом(Найдена руда "координаты руды").
### Причем что если даже вы нажмете два раза на одно и тоже место то он 
### не "запомнит" его повторно. 
### Ходите и марчите точки копания.
### Для того чтобы остановить марк нажмите таргетом на себя. 
### Инжект напишет вам сообщение ('Анализ закончен, координаты руды записаны в 
### файл C:\Ore.dat') и создаст файл на диске 
### С:\ куда запишет координаты точек копания.
### После этого чар пойдет по координатам и будет копать. 
###
################################ 
### Режим Второй - "Копание" ###
################################
### Этот режим соответственно отвечает за Копание. 
### Включается переменной var GetFromFile=1 ## 1 - координаты деревьев будут 
### считыватся из файла, 0 - собиратся из клиента 
### То есть если GetFromFile=1 координаты деревьев будут считыватся из файла.
### И вам не надо будет сново марчить точки копания. 
###
### Копание происходит так:
### Поставте переменную GetFromFile равную 1 (GetFromFile=1).
### Положите к себе в сумку Кирку, Руну(в безопастное место) и Рунбук(с рунами 
### домой и в лес). 
### ]![ Внимание в скрипте номера рун в рунбуке настроены под ДРВ шард. ]![ 
###
#########################################
###   Дополнительные функции скрипта  ###
#########################################
###     В скрипте 3 доп. функций:     ### 
###     1)Рекол при Атаке             ###
###     2)Килл Элементала             ###
###     3)Реконнект                   ###
########################################## 
### Функция Первая - "Рекол при Атаке" ###
##########################################
### Этот режим соответственно отвечает за Рекол при атаке ентов и не только. 
### Включается переменной var ControlOfDanger=1 ## 1 - Включить рекол по руне(в 
### паке) при атаке, 0 - отключить рекол. 
### То есть если ControlOfDanger=1 чар будет реколиться при атаке.
###
### Побег происходит так:
### Поставте переменную ControlOfDanger равную 1 (ControlOfDanger=1).
### Замарчите Руну в безопастном месте.
### Положите к себе в сумку
### Руну(которую замарчили в безопастном месте), Реагенты(Black Pearls,Blood 
### Moss,Mandrake Root.)
### и Бутылки расчитывая на то сколько вы хотите рубить.(Invizible Potion,Mana 
### Potion,Heal Potion).
### При атаке вы выпиваете Invizible Potion, автоматически телепортитесь на то 
### место,
### где замаркана руна(в бакпаке).
### В это время записывается имя того кто вас атачил.
### После рекола руна маркается и проверяется ваша мана и здоровье, если чегото 
### меньше,
### чар выпивает Mana Potion или Heal Potion в зависимости от надобности.
###
######################################
### Вариант Первый - "Цыкличность" ###
######################################
### Есди вы хотите чтобы скрипт не прекращал свою работу, то поставьте 
### переменную CycleScript раную 1 (CycleScript=1).
### Теперь после рекола скрипт не будет выключаться, а будет ждать указанное 
### время(DangerTime) и затем 
### реколиться домой, речаржить рунбуку, есть и опять реколиться на место 
### копания и копать.
###
#####################################
### Вариант Второй - "Выключение" ###
#####################################
### Есди вы хотите чтобы скрипт не прекращал свою работу, то поставьте 
### переменную CycleScript раную 0 (CycleScript=0),
### Теперь после рекола скрипт выключится и закроет окно UO. 
###
########################################## 
### Функция Вторая - "Килл Элементала" ###
##########################################
### Этот режим соответственно отвечает за Килл Элементала при выкидывании с 
### сервера. 
### var ElementalKill=1 ## 1 - Вылючить килл элементала, 0 - отключить. 
### То есть если ElementalKill=1 чар будет килять элема.
### Если вы поставите переменную ElementalKill равную 1 (ElementalKill=1), то 
### чар будет килять элементала.
### Если вы поставите переменную ElementalKill равную 0 (ElementalKill=0), то 
### чар будет реколиться от элементала.
###
### Реконнект происходит так:
### Поставте переменную ElementalKill равную 1 (ElementalKill=1).
### Положите к себе в сумку
### Реагенты и Бутылки расчитывая на то сколько вы хотите рубить.(Invizible 
### Potion,Mana Potion,Heal Potion).
### После того как будет выкопан элементал, чар выпьет инвизку, морфнется в 
### демона, возьмет в руки щит и будет пытаться 
### кильнуть элеменала.
### После того как он кильнет элементала, будет произведен лут, после чего чар 
### продолжит копать.
###
#################################### 
### Функция Третья - "Реконнект" ###
####################################
### Этот режим соответственно отвечает за Реконнект при выкидывании с сервера. 
### Включается переменной var Reconnect=1 ## 1 - Включить реконнект на сервер 
### если выкинет, 0 - отключить реконнект. 
### То есть если Reconnect=1 чар будет реколиться при атаке.
###
### Реконнект происходит так:
### Поставте переменную Reconnect равную 1 (Reconnect=1).
### Если вдруг повиснет игровая сфера или вас выкинет по любой другой причине
### реконнектор законнектит ваc на сервер автоматически.
### Пишется время дисконнекта и коннекта на сервер.
###
### ]![ Настройте скрипт под себя при помощи переменных. ]![
###
################## 
### Переменные ### 
################## 
################################################################################
################### 
var FileName=('C:\ore.dat') ## - Путь к файлу в котором будут хранится 
### координаты где копать. 
### 
var TryHiding=1 ## 1 - Перед тем как копать руду, будет пытаться уйти в хайд, 
### 0 - не будет . 
### 
var TryRecall=1 ## 1 - После того как соберет достаточный вес, будет пытаться 
### реколиться домой, 
### складывать руду в сундук и реколиться обратно , 0 - не будет.(DropOnVip 
### должно быть 0)
### 
var RuneToHome=1 ## -  Номер руны Домой,по счёту в рунбуке.(сейчас в 4ом 
### слоте,можно менять от 1-9)
### 
var RuneToMining=8 ## - Номер руны в место где копаем,по счёту в рунбуке.
### (сейчас в 5ом слоте,можно менять от 1-9) 
### 
var GetFromFile=0 ## 1 - Координаты где копать будут считыватся из файла, 0 - 
### собиратся из клиента 
### (сначала соберите а потом считывайте из файла). 
### 
var OreQty=600 ## - Максимальный вес, добыв который надо реколиться домой.
### (сейчас 600 стоунов) 
### 
var ControlOfDanger=0 ## 1 - Включить рекол по руне(в паке) при атаке, 0 - 
### отключить рекол. 
### 
var ElementalKill=0 ## 1 - Вылючить килл элементала, 0 - отключить(рекол).
###
var DangerousTime=50000 ## - Время в секундах которое чар будет ждать(после 
### рекола) пока уйдет ПК или Элемент.(сейчас 50 секунд)
###
var CycleScript=0 ## 1 - Скрипт не отключается после рекола от атакующего, 0 - 
### отключаетсяи закрывает UO.
###
var Reconnect=1 ## 1 - Включить реконнект на сервер если выкинет, 0 - отключить 
### реконнект. 
### 
var DisturbingSound=('C:\warning.wav') ## - Звук которы будет пригран при атаке.
### (замените на свой) 
### 
var DropX=1437 ## - Координата перед сундуком по X.
###
var DropY=1684 ## - Координата перед сундуком по Y.
###
var DropOnVip=0 ## - Если в ВИП пещере пожходить к сундука и сбрасывать руду.
### (TryRecall должно быть 0)
################################################################################
###################  
### 
### После настройки: 
### Идите в место где будем копать. 
### Запустите cкрипт GoMining(), инжект попросит вас указать Кирку(появится 
### прицел, прицелом на неё),
### Рунбук(появится прицел, прицелом на него) ,Руну(прицелом на нее) и Сундук 
### для логов.
### После этого чар пойдет по координатам и будет копать руду. 
########### 
### Код ### 
########### 
sub GoMining()
uo.Print('Выбери Кирку: ') 
uo.Exec('addobject Pickaxe') 
while uo.Targeting() 
wait(100) 
wend

if TryRecall==1 then 
uo.Print('Выбери PунБук: ') 
uo.Exec('addobject Runebook') 
while uo.Targeting() 
wait(100) 
wend 
end if 

if ControlOfDanger==1 then
uo.Print('Выбери Руну: ') 
uo.Exec('addobject Rune') 
while uo.Targeting() 
wait(100) 
wend 
end if

uo.Print('Выбери Сундук: ') 
uo.Exec('addobject Chest') 
while uo.Targeting() 
wait(100) 
wend

if ControlOfDanger==1 then 
uo.Exec('exec ControlOfDanger') 
end if 

if Reconnect==1 then 
uo.Exec('exec Reconnect') 
end if 

if DropOnVip==0 then
RecallToOre()
end if

uo.Exec('exec Mining')
end sub

sub Mining() 
var i=0,j=0,k=0,r=0,q=0,ii,jj,f 
var TopX=324,TopY=65 
dim OreX[5000],OreY[5000],OreT[5000] 
dim OreTile[21] 
var flag=0,OreCount=0,clicks=0,flag2=0 
#################### 
### Графика руды ### 
#################### 
OreTile[0]=1339 
OreTile[1]=1355 
OreTile[2]=1354 
OreTile[3]=1359 
OreTile[4]=1358 
OreTile[5]=1357 
OreTile[6]=1352 
OreTile[7]=1341 
OreTile[8]=1363 
OreTile[9]=1359 
OreTile[10]=1339 
OreTile[11]=1354 
OreTile[12]=1386 
OreTile[13]=1353 
OreTile[14]=2278 
OreTile[15]=2282 
OreTile[16]=2281 
OreTile[17]=2277 
OreTile[18]=2278 
OreTile[19]=2275 
OreTile[20]=1351 
OreTile[21]=0 

uo.FilterSpeech('on') 
uo.FilterSpeech('add', 'Where do you want to use the pickaxe?')

##################################### 
### Загружаем координаты из файла ### 
##################################### 
if GetFromFile==1 then 
uo.Print('Загружаем координаты из файла...')
f=file(FileName)
f.Open() 
OreCount=safe call f.ReadNumber() 
for i=1 to OreCount 
OreT[i]=safe call f.ReadNumber() 
OreX[i]=safe call f.ReadNumber() 
OreY[i]=safe call f.ReadNumber() 
next 
f.Close() 
else 
###################################### 
### Собираем координаты из клиента ### 
###################################### 
uo.Print('Собираем координаты руды в округе...')
repeat
clicks=0 
flag=0 
uo.DeleteJournal() 
####################### 
### Кликаем на тайл ### 
####################### 
uo.UseObject('Pickaxe') 
wait(500)
uo.DeleteJournal() 
while uo.Targeting() 
wait(100) 
wend
########################### 
### Проверяем то ли это ### 
########################### 
flag=0 
for k=0 to 21 
if uo.LastTile(0)==OreTile[k]+1 then 
flag=2 
end if 
next 
if flag==0 then 
for k=0 to 21 
if uo.LastTile(0)==OreTile[k] then 
flag=1 
end if 
next 
end if
if uo.Lasttile(1)==uo.GetX() and uo.Lasttile(2)==uo.Gety() then 
flag=3 
end if
######################## 
### Кликнули на тайл ### 
######################## 
if flag==1 then 
flag2=0 
if OreCount>0 then 
for ii=1 to OreCount 
if OreX[ii]==uo.LastTile(1) and OreY[ii]==uo.LastTile(2) then 
flag2=1 
end if 
next 
end if 
if flag2==0 then 
OreCount=OreCount+1 
OreX[OreCount]=uo.LastTile(1) 
OreY[OreCount]=uo.LastTile(2) 
OreT[OreCount]=uo.LastTile(0) 
uo.Print('Найдена руда номер '+str(OreCount)+' : x='+str(uo.Lasttile(1))+' 
y='+str(uo.LastTile(2))) 
end if 
end if 
##################### 
### Кликнули выше ### 
##################### 
if flag==2 then 
flag2=0 
if OreCount>0 then 
for ii=1 to OreCount 
if OreX[ii]==uo.LastTile(1) and OreY[ii]==uo.LastTile(2) then 
flag2=1 
end if 
next 
end if 
if flag2==0 then 
OreCount=OreCount+1 
OreX[OreCount]=uo.LastTile(1) 
OreY[OreCount]=uo.LastTile(2) 
OreT[OreCount]=uo.LastTile(0)-1 
uo.print('Найдена руда номер '+str(OreCount)+' : x='+str(uo.Lasttile(1))+' 
y='+str(uo.LastTile(2))) 
end if 
end if
until (Flag==3) or (OreCount==5000)
uo.FilterSpeech('off') 
uo.Print('Анализ закончен, координаты руды записаны в файл ' +FileName) 
SaveToFile(OreCount,OreX,OreY,OreT) 
end if 
uo.Print('Координат найдено: '+str(OreCount)) 
wait(2000) 
###################################### 
### Ходим по собранным координатам ### 
###################################### 
while 1==1 
if OreCount>0 then 
for i=1 to OreCount 

if TryRecall==1 and uo.Weight>OreQty then 
ToRecall()
i=1
end if

if DropOnVip==1 and TryRecall==0 and uo.Weight>OreQty then
DropOnVip()
i=1
end if
 
j=i*2-1
if j>OreCount then
j=2*(OreCount-i+1)
end if
uo.Print('Идём к координате руды номер '+str(j)+': x='+str(OreX[j])+' y='+str
(OreY[j])) 
InfoOre()
flag=GotoXY(OreX[j],OreY[j],2)
if TryHiding==1 then 
ToHide() 
end if 
if flag==1 then 
GetOre(str(OreT[j]),str(OreX[j]),str(OreY[j]),str(uo.GetZ())) 
end if 
next
end if 
wend 
end sub

sub SaveToFile(OreCount,OreX,OreY,OreT)  
var s=0,i=0,f
f=file(FileName)
f.Open() 
f.Create() 
s=safe call f.Writeln(OreCount) 
for i=1 to OreCount 
s=safe call f.Writeln(str(OreT[i])+' '+str(OreX[i])+' '+str(OreY[i])) 
next 
f.Close() 
end sub

sub GetOre(Type,X,Y,Z) 
var i 
uo.Print('Начинаем копать...') 
for i=1 to 20 
if uo.Warmode()==1 then 
return 0 
end if 
wait(200) 
uo.DeleteJournal() 
CheckLag()
wait(100) 
uo.WaitTargetTile(Type,X,Y,Z)
uo.UseObject('Pickaxe')
wait(500)  
if WaitForChange()==1 then 
return 1 
end if 
next 
return 0 
end sub 

sub WaitForChange() 
var Text1=uo.GetName()+': You loosen some rocks but fail to find any useable 
ore.' 
var Text2='There is no ore here to mine.' 
var Text3="You can't reach this." 
var Text4="That is too far away." 
var Text5="You can't do much in your current state." 
var Text6="You have no line of sight to that location" 
var Text7="You can't see the target"  
var Text8="Try mining in rock."
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)==Text6 or uo.Journal(0)==Text7 or uo.Journal(0)==Text8 then 
return 1 
end if 
if uo.Journal(0)==Text1 then
wait(1000) 
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 Open(Container) 
uo.DeleteJournal() 
uo.UseObject(Container) 
repeat 
wait(500) 
until uo.InJournal('Contains') 
end sub 

sub GotoXY(x,y,r) 
var lastX=0,lastY=0,i=0
while Numb(y-uo.GetY())>r
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
if (y-uo.GetY())>r then
LastX=uo.GetX()
LastY=uo.GetY()
for i=0 to 2
uo.Press(35)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
if LastY==uo.GetY() then
for i=0 to 2
uo.Press(37)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastY==uo.GetY() then
for i=0 to 2
uo.Press(40)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() and LastY==uo.GetY() then
for i=0 to 5
uo.Press(38)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
end if
if (uo.GetY()-y)>r then
LastY=uo.GetY()
for i=0 to 2
uo.Press(33)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
if LastY==uo.GetY() then
for i=0 to 2
uo.Press(39)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastY==uo.GetY() then
for i=0 to 2
uo.Press(38)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() and LastY==uo.GetY() then
for i=0 to 5
uo.Press(40)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
end if
wend
while Numb(x-uo.GetX())>r
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
if (x-uo.GetX())>r then
LastX=uo.GetX()
LastY=uo.GetY()
for i=0 to 2
uo.Press(34)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
if LastX==uo.GetX() then
for i=0 to 2
uo.Press(40)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() then
for i=0 to 2
uo.Press(39)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() and LastY==uo.GetY() then
for i=0 to 5
uo.Press(37)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
end if
if (uo.GetX()-x)>r then
LastX=uo.GetX()
for i=0 to 2
uo.Press(36)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
if LastX==uo.GetX() then
for i=0 to 2
uo.Press(38)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() then
for i=0 to 2
uo.Press(37)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
if LastX==uo.GetX() and LastY==uo.GetY() then
for i=0 to 5
uo.Press(39)
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
end if
next
end if
end if
wend
if Numb(x-uo.GetX())<=r and Numb(y-uo.GetY())<=r then 
return 1 
else
return 0  
end if
return 0  
end sub

sub Numb(num) 
if num>=0 then 
return num 
else 
return num*(-1) 
end if 
end sub

sub InfoOre() 
uo.Print('У вас всего '+str(uo.Count('0x19B7')+uo.Count('0x19B8')+uo.Count
('0x19B9')+uo.Count('0x19BA'))+' руды в сумке') 
uo.Print('Из нее '+str(uo.Count('0x19B7','0x0000')+uo.Count('0x19B8','0x0000')
+uo.Count('0x19B9','0x0000')+uo.Count('0x19BA','0x0000'))+' железо и ' +str
(uo.Count('0x19B7')+uo.Count('0x19B8')+uo.Count('0x19B9')+uo.Count('0x19BA')-
(uo.Count('0x19B7','0x0000')+uo.Count('0x19B8','0x0000')+uo.Count
('0x19B9','0x0000')+uo.Count('0x19BA','0x0000')))+' цветмет') 
end sub 

sub ToHide() 
while not uo.Hidden() 
uo.Print('Пытаемся уйти в хайд...') 
uo.DeleteJournal() 
uo.UseSkill('Stealth') 
wait(6000) 
wend 
wait(100) 
end sub 

sub ToRecall() 
RecallToHome() 
DropOre() 
RecallToOre() 
end sub 

sub RecallToHome() 
uo.Print('Прыгаем Домой.') 
RunebookRecall(RuneToHome) 
end sub 

sub RecallToOre() 
uo.Print('Прыгаем в Пещеру.') 
RunebookRecall(RuneToMining) 
end sub 

sub RunebookRecall(n) 
var OldX,OldY,Time 
OldX=uo.GetX() 
OldY=uo.GetY() 
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 DropOre() 
var o,exit 
dim Ore[14] 
Ore[0]=0x19B9 
Ore[1]=0x19B7 
Ore[2]=0x19BA 
Ore[3]=0x19B8  
Ore[4]=0x0F11 
Ore[5]=0x0F16  
Ore[6]=0x0F18  
Ore[7]=0x0F15 
Ore[8]=0x0F10 
Ore[9]=0x0F0F 
Ore[10]=0x0F26 
Ore[11]=0x1F4C  
Ore[12]=0x0EED 
Ore[13]=0x0F20  
ToHide() 
if uo.Waiting() then 
uo.CancelTarget() 
end if 
uo.SetReceivingContainer('Chest') 
wait(500) 
for o=0 to 13 
exit=0 
repeat 
uo.FindType(Ore[o]) 
if uo.GetQuantity('finditem')>0 then 
uo.Grab('0','finditem') 
wait(1500) 
else 
exit=1 
end if 
until exit==1 
next 
uo.UnSetReceivingContainer('Chest') 
end sub

sub DropOnVip()
Walk(DropX,DropY,'')
DropOre()
end sub

sub ControlOfDanger()
var danger
var RecallPhysicalDanger=1
var RecallSeenDanger=0
var RecallBluePlayer=0
while 1 
uo.DeleteJournal() 
while not uo.InJournal(':') 
wait(100) 
wend 
danger=uo.GetNotoriety(uo.JournalSerial(0)) 
if uo.InJournal('OOPS') then 
if ElementalKill==1 then
uo.Exec('exec ElementalKill')
end if
if ElementalKill==0 then
uo.Exec('exec RecallRune')
end if
end if 
if RecallPhysicalDanger==1 then
if uo.InJournal('attacking you') then 
uo.Exec('exec RecallRune') 
end if 
end if
if RecallSeenDanger==1 then
if danger==6 and uo.JournalSerial(0)<>uo.GetSerial() then 
uo.Exec('exec RecallRune') 
end if 
if danger==4 and uo.JournalSerial(0)<>uo.GetSerial() then 
uo.Exec('exec RecallRune') 
end if 
end if
if RecallBluePlayer==1 then
if danger==1 and uo.JournalSerial(0)<>uo.GetSerial() then 
uo.Exec('exec RecallRune') 
end if 
end if
wend 
end sub 

sub RecallRune() 
var MX=uo.GetX('self')
var MY=uo.GetY('self')
Terminate()
uo.PlayWav(DisturbingSound)
uo.UseType('0x0F0E','0x0631')
wait(100)
Recall: 
uo.DeleteJournal() 
if uo.Waiting() then 
uo.CancelTarget() 
end if 
uo.WaittargetObject('Rune')
wait(100)
uo.Cast('Recall')
wait(3000)
if not uo.GetX('self')<>MX and not uo.GetY('self')<>MY then 
goto Recall 
end if 
repeat
uo.DeleteJournal()
uo.WaittargetObject('Rune') 
uo.Cast('Mark')
if uo.InJournal('mana for this spell') then
ManaUp('Bottle')
wait(100)
end if
wait(3000)
until not uo.InJournal('spell fizzles')
if uo.Life<uo.STR then
LifeUp('Bottle')
wait(100)
end if
if CycleScript==1 then
uo.Exec('exec DangerWait')
end if
if CycleScript==0 then
uo.Exec('exec ExitUO')
end if
end sub 

sub DisturbingSound(amount)
var i
for i=1 to amount
uo.PlayWav(DisturbingSound)
wait(1500)
next
end sub

sub DangerWait()
wait(DangerousTime)
ToRecall()
uo.Exec('exec Mining')
end sub

sub ExitUO() 
wait(3000)
uo.CloseUO()
end sub

sub LifeUp(Mode)
if Mode=='Healing' then
while uo.Life<uo.STR
uo.Exec('bandageself')
wait(4000)
wend
end if
if Mode=='Bottle' then
if uo.Life<uo.STR then
uo.UseType('0x0F0E','0x09BB')
wait(100)
end if
end if
end sub

sub ManaUp(Mode)
if Mode=='Meditation' then
while uo.Mana<uo.INT
uo.Exec('useskill Meditation')
wait(4000)
wend
end if
if Mode=='Bottle' then
if uo.Mana<uo.INT then
uo.UseType('0x0F0E','0x09DF')
wait(100)
end if
end if
end sub

sub ElementalKill()
var Count,LastTimer,Elemental
var o,exit
dim Ore[13] 
Ore[1]=0x19B9 
Ore[2]=0x19B7  
Ore[3]=0x19BA  
Ore[4]=0x19B8  
Ore[5]=0x0F11  
Ore[6]=0x0F16  
Ore[7]=0x0F18  
Ore[8]=0x0F15  
Ore[9]=0x0F10  
Ore[10]=0x0F0F  
Ore[11]=0x0F26  
Ore[12]=0x1F4C  
Ore[13]=0x0EED 
Terminate()
uo.UseType('0x0F0E','0x0631') ## -  Инвизка(тип,цвет).
while uo.STR<uo.Life+1 
if uo.Mana>=50 then
uo.WaitMenu('What','Daemon')
uo.Cast('Polymorph')
wait(8000)
else
uo.UseType('0x0F0E','0x09DF') ## -  Тотал Мана(тип,цвет).
wait(3000)
end if
wend
LastTimer=uo.Timer()
repeat
uo.BandageSelf()
wait(4000)
until uo.Life==uo.STR or LastTimer+300<uo.Timer()
uo.UseType('0x1B76') ## - Хеатер Щит(тип).
uo.DeleteJournal()
uo.Exec('warmode 1')
uo.FindType('0x0010',-1,'ground')
Elemental=uo.GetSerial('finditem')
uo.Attack(Elemental)
repeat
wait(1000)
if uo.Life<50 Then
uo.UseType('0x0F0E','0x09BB') ## - Греатер Хеал(тип,цвет).
end if
if uo.GetDistance(Elemental)>1 then
WalkN(0,0,Elemental)
end if
until uo.IsNPC(Elemental)==0
wait(3000)
uo.Exec('warmode 0')
wait(1000)
LastTimer=uo.Timer()
uo.DeleteJournal()
for o=1 to 13 
exit=0 
repeat 
uo.FindType(Ore[o],-1,'ground') 
if uo.GetQuantity('finditem')>0 then 
uo.Grab('0','finditem') 
wait(1500) 
else 
exit=1 
end if 
until exit==1 
next 
### uo.Exec('warmode 1')
uo.Exec('warmode 0')
uo.Exec('exec Mining')
end sub

sub WalkN(x,y,Target) 
var i,StepSucess 
var DX,DY,exit=0 
while exit<>1    
if Target<>"" then 
DX=uo.GetX(Target)-uo.GetX() 
DY=uo.GetY(Target)-uo.GetY() 
if uo.GetDistance(Target)<2 then 
exit=1 
end if 
else 
DX=X-uo.GetX() 
DY=Y-uo.GetY() 
exit=1 
end if 
end if 
if DX<>0 and DY<>0 then 
if DX>0 and DY>0 then 
StepSucess=Go(3,40,300)  
if StepSucess==-1 then 
StepSucess=Go(7,38,300)  
StepSucess=Go(1,39,300)  
if StepSucess==-1 then 
StepSucess=Go(5,37,300)  
end if 
end if 
end if 
if DX>0 and DY<0 then 
StepSucess=Go(1,39,300)  
if StepSucess==-1 then 
StepSucess=Go(5,37,300)  
StepSucess=Go(3,40,300)  
if StepSucess==-1 then 
StepSucess=Go(7,38,300)  
end if 
end if 
end if 
if DX<0 and DY>0 then 
StepSucess=Go(5,37,300)  
if StepSucess==-1 then 
StepSucess=Go(1,39,300)  
StepSucess=Go(7,38,300)  
if StepSucess==-1 then 
StepSucess=Go(3,40,300)  
end if 
end if 
end if 
if DX<0 and DY<0 then 
StepSucess=Go(7,38,300)  
if StepSucess==-1 then 
StepSucess=Go(3,40,300)  
StepSucess=Go(5,37,300)  
if StepSucess==-1 then 
StepSucess=Go(1,39,300)  
end if 
end if 
end if 
end if 
if DX<>0 and DY==0 then 
if DX>0 then 
StepSucess=Go(2,34,300)  
if StepSucess==-1 then 
StepSucess=Go(3,40,300)  
if StepSucess==-1 then 
StepSucess=Go(1,39,300)  
end if 
StepSucess=Go(2,34,300)  
end if 
end if 
if DX<0 then 
StepSucess=Go(6,36,300)  
if StepSucess==-1 then 
StepSucess=Go(7,38,300)  
if StepSucess==-1 then 
StepSucess=Go(5,37,300)  
end if 
StepSucess=Go(6,36,300)  
end if 
end if 
end if 
if DX==0 and DY<>0 then 
if DY>0 then 
StepSucess=Go(4,35,300)  
if StepSucess==-1 then 
StepSucess=Go(3,40,300)  
if StepSucess==-1 then 
StepSucess=Go(5,37,300) 
end if 
StepSucess=Go(4,35,300) 
end if 
end if 
if DY<0 then 
StepSucess=Go(0,33,300) 
if StepSucess==-1 then 
StepSucess=Go(1,39,300) 
if StepSucess==-1 then 
StepSucess=Go(7,38,300) 
endif 
StepSucess=Go(0,33,300) 
end if 
end if 
end if 
wend 
end sub 

sub Go(dir,key,walkwait) 
var X,Y,OldDir 
X=uo.GetX() 
Y=uo.GetY() 
OldDir=uo.GetDir() 
if uo.GetDir()<>dir then 
uo.Press(key) 
wait(walkwait) 
if uo.GetDir()<>dir then 
end if 
end if 
uo.Press(key) 
wait(walkwait) 
if X==uo.GetX() and Y==uo.GetY() then 
end if 
if X==uo.GetX() and Y==uo.GetY() and OldDir<>uo.GetDir() then 
uo.Press(key) 
wait(walkwait) 
end if 
if X==uo.GetX() and Y==uo.GetY() then 
end if 
if X==uo.GetX() and Y==uo.GetY() then 
return -1 
else 
return 1 
end if 
end sub
 
sub Reconnect() 
var ReconnectTime,rflag 
ReconnectTime='0' 
rflag=1 
repeat 
while (uo.ObjAtLayer('Bpack')=='') 
if rflag then 
ReconnectTime=Time() 
rflag=0 
end if 
wait(20000) 
uo.Say('') 
wait(3000) 
uo.Say('') 
wait(3000) 
uo.Say('') 
wait(3000) 
uo.Ldblclick(357,164) 
uo.Lclick(616,459) 
wait(3000) 
wend 
wait(3000) 
if (rflag==0) and (ReconnectTime<>'0') then 
uo.TextOpen() 
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime) 
rflag=1 
ReconnectTime='0' 
end if 
until false 
end sub 

sub Time() 
var Date,nTime,uTime,i 
uTime=str(uo.Time()) 
nTime='' 
for i=0 to Len(uTime) 
nTime=uTime[Len(uTime)-i]+nTime 
if (i==2) or (i==4) then 
nTime=':'+nTime 
end if 
next 
uTime=str(uo.Date()) 
Date='' 
for i=0 to Len(uTime) 
Date=uTime[Len(uTime)-i]+Date 
if (i==2) or (i==4) then 
Date='.'+Date
end if 
next 
uTime=nTime+' @ '+Date 
return uTime 
end sub 

sub Terminate()
uo.Exec('terminate Mining')
end sub

sub TerminateAll()
uo.Exec('terminate Mining')
uo.Exec('terminate ControlOfDanger')
uo.Exec('terminate Reconnect')
uo.Exec('terminate RecallRune')
uo.Exec('terminate DropOre')
uo.Exec('terminate DangerWait')
uo.Exec('terminate DangerWait')
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 

sub GoCorpse()
var Elemental='0x4000466F'
Walk(0,0,Elemental)
end sub

sub Walk(X,Y,Target)
var Targeting=''
var Result
var DX,DY,GLX,GLY 
var DirW=0
var exit=0
while exit<>1
if Target<>'' then 
Targeting=Target
DX=uo.GetX(Target)-uo.GetX()
DY=uo.GetY(Target)-uo.GetY()
if uo.GetDistance(Target)<2 then
exit=1
end if
else
DX=X-uo.GetX()
DY=Y-uo.GetY()
GLX=DX
GLY=DY
if DX==0 and DY==0 then
exit=1
end if
end if
if exit==0 then
if DX>0 and DY>0 then
DirW=9
end if
if DX>0 and DY<0 then
DirW=7
end if
if DX<0 and DY>0 then
DirW=3
end if
if DX<0 and DY<0 then
DirW=5
end if
if DX<>0 and DY==0 then
if DX>0 then
DirW=8
else 
DirW=4
end if
end if
if DX==0 and DY<>0 then
if DY>0 then
DirW=2
else
DirW=6
end if
end if
Result=Go(DirW)
if Result==0 then
Result=Go(DirW-2)
if Result==0 then
Result=Go(DirW+2)
end if
end if
end if
wend
end sub

sub Go(dir)
var WalkWait=100
var Targeting='' 
var X,Y,GLX,GLY
var check=1
var StartingDir=uo.GetDir()
X=uo.GetX()
Y=uo.GetY()
dim MoveKey[12]
MoveKey[0]=34
MoveKey[1]=40
MoveKey[2]=35
MoveKey[3]=37
MoveKey[4]=36
MoveKey[5]=38
MoveKey[6]=33
MoveKey[7]=39
MoveKey[8]=34
MoveKey[9]=40
MoveKey[10]=35
MoveKey[11]=37
dim StartDir[12]
StartDir[0]=2
StartDir[1]=3
StartDir[2]=4
StartDir[3]=5
StartDir[4]=6
StartDir[5]=7
StartDir[6]=0
StartDir[7]=1
StartDir[8]=2
StartDir[9]=3
StartDir[10]=4
StartDir[11]=5
while uo.GetDir()<>StartDir[dir]
uo.Press(MoveKey[dir])
wait(WalkWait)
if uo.GetDir()==StartingDir then
CheckLag()
end if
if (Targeting<>'' and uo.GetDistance(Targeting)<2) or (GLX==0 and GLY==0) then
return 1
end if
wend
uo.Press(MoveKey[dir])
wait(WalkWait)
if X==uo.GetX() and Y==uo.GetY() then
CheckLag()
uo.Press(MoveKey[dir])
wait(WalkWait)
end if
if X==uo.GetX() and Y==uo.GetY() then
return 0
else
return 1
end if
end sub