Page 1 of 1

Випа

Posted: 2007-07-03 19:10:45
by dioXido
Уважаемые скриптеры, пожалуйста добавьте рекконектор. Чтобы после вылета заходило обратно и продолжало действовать начатое дело. Заранее благодарен. Извиняюсь в скриптах не шарю.

#######################################
### Мининг для випки! от Хрюнделя[FraerS]
### и нашего любимого ГМа - Aid[FraerS]
#######################################
var Sunduk='0x4024E961' ## ID главного сундука
var Sunduk2='0x40269493' ## Айди маленького сундучка
var DropX=5965 ## - ? ?????????? ???????
var DropY=1152 ## - ? ?????????? ???????
var MinX=5980 ## - ????? ??????? (?)
var MinY=1152 ## - ????? ??????? (?)
sub GoMining()
GoMine(MinX)
uo.exec('exec controlofdanger')
uo.exec('exec mining')
end sub

sub mining()
var mx, my, mz, i, j, jor, ser, noto,Text1
Text1=uo.GetName()+': You loosen some rocks but fail to find any useable ore.'
########################
#na4alo:
while true
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-4 to mx+4
for j = my -4 to my+4
while not UO.Hidden()
UO.Warmode("0")
uo.print("Прячемся...")
UO.UseSkill("Stealth")
wait(4000)
wend
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") and not UO.InJournal(Text1) and not UO.InJournal("Iron Ore") and not UO.InJournal("Rusty Ore") and not UO.InJournal("Copper Ore") and not UO.InJournal("Silver Ore") and not UO.InJournal("Gold Ore")
UO.DeleteJournal()
if uo.waiting() then
uo.canceltarget()
endif
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype('0x0E85')
WaitForChange()
if uo.weight > 470 then ; выставляем макс. вес
DropOnVip(DropX)
goto gomine
endif
gomine:
GoMine(MinX)
wend
UO.DeleteJournal()
next
next
#goto na4alo
#DropOnVip(DropX,DropY)
#GoMine(MinX,MinY)
#goto na4alo
wend
end sub


##################################
sub DropOre()
########################

ToHide()
var a,Exit
dim Ore[4]
Ore[0]=0x19B9
Ore[1]=0x19B7
Ore[2]=0x19BA
Ore[3]=0x19B8
uo.useobject(Sunduk)
wait(1000)
CheckLag()
uo.useobject(Sunduk2)
wait(1000)
CheckLag()
uo.Print('Скидываем руду')
for a=0 to 3
MovingItems(Ore[a],'-1',-1,0)
next
uo.Print('Руду сбросили. Идем работать дальше')
end sub
##########################
sub DropOnVip(DropX)
Walk(DropX)
DropOre()
end sub
####################
sub GoMine(MinX)
Walk(MinX)
end sub

##################################################

sub Walk(X)
while UO.GetY()<>1152
HideControl()
if UO.GetY()>1152 then
UO.Press(33)
CheckLag()
else
UO.Press(35)
CheckLag()
end if
wend
while UO.GetX()<>X
HideControl()
if UO.GetX()>X then
UO.Press(36)
CheckLag()
else
UO.Press(34)
CheckLag()
end if
wend
end sub

Sub HideControl()
while not UO.Hidden()
UO.DeleteJournal()
UO.UseSkill('Stealth')
repeat
wait(10)
until UO.Hidden() or UO.InJournal('You can')
wend
end sub

#####################################
sub ToHide()
while not uo.Hidden()
uo.Print('Прячемся от врагоффф...')
uo.DeleteJournal()
uo.UseSkill('Stealth')
wait(6000)
wend
wait(100)
end sub
####################################
sub CheckLag()
var t = 0
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(100)
until uo.InJournal('backpack') or t > 20
end sub

Sub MovingItems(tItem,cItem,qItem,FromBackPack)
var idResivCont
var idSendCont
if FromBackPack==1 then
idResivCont=uo.GetSerial('backpack')
idSendCont=Sunduk2
else
idSendCont=uo.GetSerial('backpack')
idResivCont=Sunduk2
end if
CheckLag()
uo.FindType(tItem,cItem,idSendCont)
while uo.GetQuantity('finditem')>0
uo.MoveItem('finditem',qItem,idResivCont)
wait(1000)
CheckLag()
if qItem>0 then
return
end if
uo.FindType(tItem,cItem,idSendCont)
wend
end sub

sub ControlOfDanger()
Var Elemental
while 1
UO.DeleteJournal()
while not UO.InJournal('Elemental')
wait(100)
wend
Elemental=UO.JournalSerial(UO.InJournal("Elemental")-1)
if UO.GetGraphic(Elemental)=='0x0010' then
UO.exec('terminate mining')
wait(1000)
KillElem(Elemental)
end if
wend
end sub

Sub KillElem(elem)
Var Vortex,elemX,elemY
UO.warmode(0)
uo.exec('usetype 0x0f0e 0x0631')
wait(300)
CastSpel('Energy Vortex',elem)
repeat
wait(400)
until UO.InJournal("Energy Vortex")
Vortex=UO.JournalSerial(UO.InJournal("Energy Vortex")-1)
repeat
elemX=UO.GetX(elem) ## Следим за координатами Элема, что бы не убежал
elemY=UO.GetY(elem) ## Следим за координатами Элема, что бы не убежал
wait(500)
until UO.Isnpc(elem)==0 ## Ждём пока Элем умрёт
CastSpel('Dispel',Vortex)
repeat
wait(600)
until UO.Isnpc(Vortex)==0 ## Ждём пока Вортекс умрёт
Walk(elemX) ## Идём к месту смерти Элема
Looting() ## Лутаем
GoMine(MinX) ## Идём копать дальше
UO.exec('exec mining')
end sub

Sub CastSpel(spel,object)
Var LastMana
Cast:
while UO.Mana<50
if UO.Count('0x0F0E','0x09DF') then
UO.UseType ('0x0F0E','0x09DF')
endif
wait(4000)
wend
UO.WaitTargetObject(object)
UO.Cast(spel)
LastMana=UO.Mana
repeat
wait(200)
until UO.Mana < LastMana
if UO.InJournal("fizzles") then
uo.deletejournal()
goto Cast
end if
end sub

Sub Looting()
Var i
dim Item[5]
Item[1] = 0x19B9 ##
Item[2] = 0x19B7 ##
Item[3] = 0x19BA ##
Item[4] = 0x19B8 ##
Item[5] = 0x0EED ##
for i=1 to 5
UO.FindType(Item[i],-1,'ground')
if UO.FindCount() then
UO.MoveItem('finditem','0','backpack')
wait(600)
CheckLag()
end if
next
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 Text9="You put the Iron Ore in your pack."
var Text10="You put the Rusty Ore in your pack."
var Text11="You put the Old Copper Ore in your pack."
var Text12="You put the Dull Copper Ore in your pack."
var Text13="You put the Copper Ore in your pack."
var Text14="You put the Bronze Ore in your pack."
var Text15="You put the Silver Ore in your pack."
var Text16="You put the Gold Ore in your pack."
var Text17="You put the Rose Ore in your pack."
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 or uo.Journal(0)==Text9 or uo.Journal(0)==Text10 or uo.Journal(0)==Text11 or uo.Journal(0)==Text12 or uo.Journal(0)==Text13 or uo.Journal(0)==Text14 or uo.Journal(0)==Text15 or uo.Journal(0)==Text16 or uo.Journal(0)==Text17 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