##################### MultiLore V 1.0 by Adil ###################################
sub Lores()

################################################## ###############################
############################## Используемый скилл: ##############################
## 1 - Анатомия, 2 - АнималЛор, 3 - АрмсЛор, ##
var UseSkill = 5 ## 4 - Ентицемент, 5 - ЕвалИнтел, 6 - Форенсик, ##
## 7 - АйтемАйди, 8 - Провокация, 9 - ТэйстАйди. ##
################################################## ###############################
############################## Таргет ###########################################
var MyTarget = 1 ## 1 - добавим тестируемый таргет, ##
## иначе указать его сериал тут. ##
################################################## ###############################
############################## Реконектор: ######################################
var UseReconnector = 1 ## 1 - используем реконектор, 0 - нет. ##
################################################## ###############################
############################## Подкормка ########################################
var UseEating = 0 ## 1 - кушаем, 0 - нет. ##
################################################## ###############################
############################## Гуард Зоун Протект ###############################
var UseGuardsProtect = 0 ## 1 - кричим "Guards", 0 - нет. ##
################################################## ###############################
############################## Использование Спирит Спиака ######################
var UseSpSpeak = 1 ## 1 - Качаем паралельно спирит спиак, 0 - нет. ##
################################################## ###############################
############################## Выбор Шарда ######################################
var Shard = 0 ## 0 - RUO, 9 - DRW, 18 - Citadel. ##
################################################## ###############################

################################################## ###############################
############################## Потерянные пакеты ################################
var Lagstime = 200 ## Ждём не больше 20 секунд. ##
################################################## ###############################
############################## Задержка #########################################
var Waiting = 2000 ## Везде 100, на ДРВ 3500-4000. ##
################################################## ###############################
############################## Спирит спиак задержка ############################
var SpSpeakTime = 3000 ## Качаем спирит спиак раз в 300.0 секунд. ##
################################################## ###############################
############################## Спирит спиак атемпс ##############################
var MaxSpSpeakTrying = 10 ## Макс. кол-во попыток войти в транс. ##
################################################## ###############################
############################## Подкормка Задержка ###############################
################################################## ###############################
var EatingTime = 18000 ## Кушаем раз в 30 минут (1800.0 секунд ). ##
################################################## ###############################
############################## Всякое барохло =) ################################
var EatingTimer, SpSpeakTimer, LagsTimer, SpSpeakTry, w, s ##
################################################## ###############################

DIM UsedSkill[9]
UsedSkill[1] = "Anatomy"
UsedSkill[2] = "Animal Lore"
UsedSkill[3] = "Arms Lore"
UsedSkill[4] = "Enticement"
UsedSkill[5] = "Evaluating Intelligence"
UsedSkill[6] = "Forensic Evaluation"
UsedSkill[7] = "Item Identification"
UsedSkill[8] = "Provocation"
UsedSkill[9] = "Taste Identification"

DIM Ms1[27]
Ms1[1] = "looks"
Ms1[2] = "it looks"
Ms1[3] = "This item"
Ms1[4] = ""
Ms1[5] = "They look"
Ms1[6] = ""
Ms1[7] = "You estimate"
Ms1[8] = ""
Ms1[9] = "It tastes"
Ms1[10] = "looks"
Ms1[11] = "it looks"
Ms1[12] = "This item"
Ms1[13] = ""
Ms1[14] = "They look"
Ms1[15] = ""
Ms1[16] = "You estimate"
Ms1[17] = ""
Ms1[18] = "It tastes"
Ms1[19] = "looks"
Ms1[20] = "it looks"
Ms1[21] = "This item"
Ms1[22] = ""
Ms1[23] = "They look"
Ms1[24] = ""
Ms1[25] = "You estimate"
Ms1[26] = ""
Ms1[27] = "It tastes"

DIM Ms2[27]
Ms2[1] = "You can't think"
Ms2[2] = "You can't think"
Ms2[3] = "You are uncertain about this item"
Ms2[4] = "Your music fails to attract anyone."
Ms2[5] = ""
Ms2[6] = ""
Ms2[7] = "You can't think"
Ms2[8] = ""
Ms2[9] = ""
Ms2[10] = "You can't think"
Ms2[11] = "You can't think"
Ms2[12] = "You are uncertain about this item"
Ms2[13] = "Your music fails to attract anyone."
Ms2[14] = ""
Ms2[15] = ""
Ms2[16] = "You can't think"
Ms2[17] = ""
Ms2[18] = ""
Ms2[19] = "You can't think"
Ms2[20] = "You can't think"
Ms2[21] = "You are uncertain about this item"
Ms2[22] = "Your music fails to attract anyone."
Ms2[23] = ""
Ms2[24] = ""
Ms2[25] = "You can't think"
Ms2[26] = ""
Ms2[27] = ""

DIM MsSp1[3]
MsSp1[0] = "You establish"
MsSp1[1] = "You establish a connection to the netherworld."
MsSp1[2] = "You establish"

DIM MsSp2[3]
MsSp2[0] = "You stop"
MsSp2[1] = "You stop"
MsSp2[2] = "You stop"

DIM MsSp3[3]
MsSp3[0] = "You fail"
MsSp3[1] = "You fail your attempt at contacting the netherworld."
MsSp3[2] = "You fail"

DIM MsE1[3]
MsE1[0] = "stuffed"
MsE1[1] = "stuffed"
MsE1[2] = "stuffed"

DIM MsE2[3]
MsE2[0] = "full"
MsE2[1] = "full"
MsE2[2] = "full"

DIM MsE3[3]
MsE3[0] = "see the target"
MsE3[1] = "see the target"
MsE3[2] = "see the target"

w = UseSkill + Shard
s = Shard/9

If MyTarget == 1 Then
UO.AddObject('TestObject')
While UO.Targeting() == 2
wait(100)
wend
MyTarget = 'TestObject'
Endif

If UseEating == 1 Then
UO.AddObject('Food')
While UO.Targeting() == 2
wait(100)
wend
Endif

If UseReconnector == 1 Then
UO.Exec('exec Reconnect')
wait(100)
Endif

If UseGuardsProtect == 1 Then
UO.Exec('exec GuardsProtect')
wait(100)
Endif

EatingTimer = UO.Timer()
LagsTimer = UO.Timer()
SpSpeakTimer = UO.Timer()

While Not UO.Dead()

If UseEating == 1 And EatingTimer <= UO.Timer() Then
Repeat
LagsTimer = UO.Timer() + LagsTime
UO.UseObject('Food')
wait(500)
Until UO.Dead() or UO.InJournal(MsE1[s]) or UO.InJournal(MsE2[s]) \
or UO.InJournal(MsE3[s]) or LagsTimer <= UO.Timer()
EatingTimer = UO.Timer() + EatingTime
Endif

If UseSpSpeak == 1 And SpSpeakTimer <= UO.Timer() Then
SpSpeakTry = 0
Repeat
LagsTimer = UO.Timer() + LagsTime
UO.DeleteJournal()
UO.WarMode(0)
UO.UseSkill("Spirit Speak")
SpSpeakTry = SpSpeakTry + 1
wait(100)
Repeat
wait(100)
Until UO.Dead() or UO.InJournal(MsSp1[s]) or UO.InJournal(MsSp2[s]) \
or UO.InJournal(MsSp3[s]) or LagsTimer <= UO.Timer()
Until UO.Dead() or UO.InJournal(MsSp1[s]) or UO.InJournal(MsSp2[s]) \
or LagsTimer <= UO.Timer() or SpSpeakTry >= MaxSpSpeakTrying
SpSpeakTimer = UO.Timer() + SpSpeakTime
Endif

LagsTimer = UO.Timer() + LagsTime
UO.DeleteJournal()
UO.WarMode(0)
UO.WaitTargetObject(MyTarget)
UO.UseSkill(UsedSkill[UseSkill])
wait(100)
Repeat
wait(100)
Until UO.Dead() or UO.InJournal(Ms1[w]) or UO.InJournal(Ms2[w]) \
or LagsTimer <= UO.Timer()
wait(Waiting)

wend

end sub

sub GuardsProtect()
While Not UO.Dead()
UO.Say("Guards")
wait(1500)
wend
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(70000)
UO.Say('')
wait(20000)
UO.Say('')
wait(20000)
UO.Say('')
wait(20000)
UO.Ldblclick(357,164)
wait(3000)
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'
Endif
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
Endif
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
Endif
next
uTime=nTime+' @ '+Date
return uTime
end sub

Sub CheckLag()
DeleteJournal('ackpack')
UO.Click('backpack')
Repeat
wait(100)
Until UO.InJournal('ackpack')
end sub

Sub DeleteJournal( string1 )
var nom = UO.InJournal( string1 )
If nom > 0 Then
UO.SetJournalLine( Nom - 1, ' ' )
DeleteJournal( string1 )
Endif
endsub