Code: Select all
# 1. Äîáàâëèë ôóíêöèÿ ðàçìåòêè îò áàíêà ê ìåñòó ðåñà - MarkWay.
# Ýòà ôóíêöèÿ âûïîëíÿåòñÿ îäèí ðàç, ïîñëå ÷åãî íåîáõîäèìî âíåñòè
# èçìåíåíèÿ â ïðîöåäóðå GoToResurrect. (âñå ýòî äåëàåòñÿ â ðåäàêòîðå èíæè)
# Ñîõðàíÿåøü èçìåíåíèÿ è çàáûâàåøü ïðî ýòó ðàçìåòêó íàâñåãäà.
# Âîïðîñ: Ïî÷åìó ðàçìåòêó íàäî äåëàòü íà÷èíàÿ ó áàíêà?
# Îòâåò: Ïîòîìó ÷òî òàêîâà ëîãèêà òâîåãî ñêðèïòà. Æèâîé ÷àð èëè
# ìåðòâûé ïîñëå äîáû÷è ðóäû îí âñå ðàâíî èäåò ê áàíêó.
# 2. Åñëè èíòåðåñíî, òî ïîñìîòðè âíèìàòåëüíî âåñü ñêðèïò, ÿ îñòàâèë
# íåìíîãî êîììåíòàðèåâ.
# 3. Åñëè ñêðèïò ðàáîòàòü íå áóäåò, íå îáåññóäü, äàëüøå ðàçáèðàòü ñ
# äàííûì ñêðèïòîì èíòåðåñà íåò, òàê êàê åìó íåîáõîäèìà ãëîáàëüíàÿ
# ïåðåäåëêà.
VAR BagInBank = '0x4009D5EC' #<<< ID ìåøêà ñ ðåàãåíòàìè, ëåæàùåãî â áàíêå.
sub Vertijok()
UO.Print("!!Viberi kirku!!")
UO.Exec('addobject Shovel')
While UO.targeting()
Wait(3000)
Wend
uo.print('!!Viberi runu damoi!! ')
uo.exec('addobject runeHome')
while uo.targeting()
wait(15000)
wend
#######################################
uo.print('!!Viberi sunduk s regami!! ')
uo.exec('addobject Sunduk')
while uo.targeting()
wait(100)
wend
#######################################
uo.print('!!Viberi runu v saxtu!! ')
uo.exec('addobject runeCave')
while uo.targeting()
wait(100)
wend
#######################################
#GoToMine() #<<< Çàêîìåíòèðîâàë. Áîëüøå íå áóäåò ìåäèòèðîâàòü ïåðåä êîïêîé.
#repeat #<<< íåò until (ïîýòîìó çàêîììåíòèðîâàë)
while not uo.dead()
GoToMine()
gotoxy(2562,491,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2558,497,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2560,493,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2563,488,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2565,483,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2570,480,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2575,477,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2578,480,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2573,483,0)
GetOre()
GoToHome()
GoToMine()
gotoxy(2570,486,0)
GetOre()
GoToHome()
wend
endsub
################################################################
sub GoToHome()
gotoxy(2566,481,0)
gotoxy(2558,505,0)
gotoxy(2552,505,0)
gotoxy(2552,501,0)
gotoxy(2525,501,0)
gotoxy(2525,515,0)
gotoxy(2507,515,0)
gotoxy(2507,542,0)
if UO.Dead() then #<<<
GoToxyResurrect() #<<< ÄÎÁÀÂÈË ÂÎÇÐÎÆÄÅÍÈÅ.
endif #<<<
uo.say('bank')
wait(3000)
uo.waittargetobject('runeHome') ; äîìîé
wait(500)
uo.cast('Recall')
wait(3000)
loot()
wait(3000)
#reccal: #<<< à ýòî ê ÷åìó? è ïî÷åìó ýòà ìåòêà íàõîäèòñÿ çäåñü?
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
endif
endsub
################################################################
Sub GoToMine()
med()
regi()
wait(500)
uo.waittargetobject('runeCave') ; V saxtu
uo.cast('Recall')
#goto reccal #<<< goto ññûëàåòñÿ íà ìåòêó â äðóãîé ïðîöåäóðå???
#endif #<<< à ãäå if ... then ?
wait(5000)
gotoxy(2558,497,0)
endsub
################################################################
sub Start()
If UO.GetGlobal('MiningCheck')=='on' Then
UO.SetGlobal('MiningCheck','on')
UO.Exec('Exec Terminate')
Else
UO.Exec('Exec Select')
UO.SetGlobal('MiningCheck','on')
EndIf
endsub
##############################
### Êîïàåì ðóäó âîçëå ñåáÿ ###
##############################
Sub GetOre()
var mx, my, mz, i, j, CheckTime, CheckLag=0
###
var Wait_1 = "You put"
var Wait_2 = "heavy"
var Wait_3 = "Ýòî ñëèøêîì äàëåêî îòñþäà."
var Wait_4 = "Òóò íå îñòàëîñü ðóäû."
var Wait_5 = "but fail"
var Wait_6 = "Òóäà Âàì íå äîòÿíóòüñÿ"
var Wait_7 = "in rock"
var Wait_8 = "You have found some"
###
var Fizzle_1 = "Òóò íå îñòàëîñü ðóäû."
var Fizzle_2 = "Ýòî ñëèøêîì äàëåêî îòñþäà."
var Fizzle_3 = "Òóäà Âàì íå äîòÿíóòüñÿ"
var Fizzle_4 = "in rock"
###
mx = UO.GetX('self')
my = UO.GetY('self')
mz = UO.GetZ('self')
For i = mx-3 TO mx+3
For j = my-3 TO my+3
Hide()
UO.Print("Get Coordinate: "+str(mx-i)+" "+str(my-j))
REPEAT
CheckLag = CheckLag+1
#EndIf #<<< ãäå if ... then ?
Hide()
If UO.Waiting() Then
UO.Targeting()
EndIf
UO.WaitTargeTtile('1341',str(i),str(j),str(mz))
UO.UseObject('Shovel')
CheckTime = UO.Timer()
UO.DeleteJournal()
REPEAT
Wait(300)
Until UO.InJournal(Wait_1) or UO.InJournal(Wait_2) or UO.InJournal(Wait_3) or UO.InJournal(Wait_4) or UO.InJournal(Wait_5) or UO.InJournal(Wait_6) or UO.InJournal(Wait_7) or UO.InJournal(Wait_8) or (CheckTime+150)<UO.Timer() or UO.Dead()
If UO.InJournal(Wait_8) Then
#ñìûñë ýòîé ïðîâåðêè?
EndIf
If CheckLag==10 Then
CheckLag = 0
Wait(9000)
EndIf
Until UO.InJournal(Fizzle_1) or UO.InJournal(Fizzle_2) or UO.InJournal(Fizzle_3) or UO.InJournal(Fizzle_4) or UO.Dead()
Next
Next
#REPEAT #<<< à ýòî äëÿ ÷åãî?
endsub
######################################################################################
Sub loot()
hide()
uo.UseSkill('Stealth')
wait(3000)
begin:
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
VAR UnloadCont='0x412546E4' ; ID sunduka
DIM Ore[5]
Ore[0]=0x19B9 ; 4 and more ore
Ore[1]=0x19B7 ; 1 ore
Ore[2]=0x19BA ; 2 ore
Ore[3]=0x19B8 ; 3 ore
UO.SetReceivingContainer(UnloadCont)
wait(500)
For a=0 to 3
Exit=0
repeat
UO.FindType(Ore[a])
if UO.GetQuantity('finditem')>0 then
UO.Grab('0','finditem')
wait(1500)
Else
Exit=1
endif
until Exit==1
Next
UO.UnSetReceivingContainer()
uo.print('vigruzili vsiu rudu pora kopati dalise???')
endsub
#######################
### Ïðÿ÷èìñÿ â õàéä ###
#######################
Sub hide()
while not UO.Hidden()
UO.Warmode("0")
uo.print("Nikaimsia")
UO.UseSkill("Hiding")
if UO.Dead() then #<<<
GoToxyResurrect() #<<< ÄÎÁÀÂÈË ÂÎÇÐÎÆÄÅÍÈÅ.
endif
wait(4000)
wend
endsub #<<<äîáàâèë, òàê êàê îòñóòñòâîâàëî.
################################################################
################################################################
Sub med()
VAR LastTimer
UO.DeleteJournal()
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
endsub
################################################################
Sub regi()
VAR r, q, n, amount = 5
Dim reg[4]
reg[1] = '0x0F7A'
reg[2] = '0x0F7B'
reg[3] = '0x0F86'
reg[4] = '0x0E21'
For r = 1 to 4
if uo.count( reg[r] )<>amount then
q = amount - uo.count( reg[r] )
if q <> 0 then
if q > 0 then
uo.useobject("Sunduk")
wait(250)
uo.findtype( reg[r] , -1 ,"Sunduk")
If uo.findcount() == 0 then
uo.msg('Ia vzial regi!')
return
endif
uo.moveitem('finditem', STR(q) )
wait(1000)
else
q = q*-1
uo.findtype( reg[r] )
uo.moveitem('finditem', STR(q) ,"Sunduk")
wait(1000)
endif
endif
endif
next
While uo.Count('0x0F09','0x0060') < 2
uo.findtype('0x0F09','0x0060',"Sunduk")
if uo.FindCount() then
uo.moveitem('finditem')
checklag()
wait(1000)
endif
wend
uo.print('Vziali regi ...')
endsub
################################################################
Sub Kill()
var Count,LastTimer,Golem
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
hide()
while uo.STR<uo.Life+1
if uo.Mana>=50 then
uo.WaitMenu('What','Daemon')
uo.Cast('Polymorph')
wait(8000)
else
med()
wait(3000)
endif
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(Golem)
repeat
wait(1000)
if uo.Life<50 Then
uo.Bandageself()
endif
if uo.GetDistance(Golem)>1 then
gotoxy(0,0,'finditem')
endif
until uo.IsNPC(Golem)==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
endif
until exit==1
next
### uo.Exec('warmode 1')
uo.Exec('warmode 0')
uo.Exec('exec Mining')
endsub
####################################
### Ñìîòðèì ñêîêà íàêîïàëè ðóäû. ###
####################################
Sub InfoOre()
var i, ii, a, LogsTime=PrintTime()
Dim Ore[3]
Ore[0] = '0x19B9' ; 4 and more ore
Ore[1] = '0x19B8' ; 3 ore
Ore[2] = '0x19BA' ; 2 ore
Ore[3] = '0x19B7' ; 1 ore
Dim NameOre[13]
NameOre[0] = 'Iron'
NameOre[1] = 'Cooper'
NameOre[2] = 'Agapite'
NameOre[3] = 'Golden'
NameOre[4] = 'Orion'
NameOre[5] = 'Verite'
NameOre[6] = 'Dwarf'
NameOre[7] = 'Silver'
NameOre[8] = 'Shadow'
NameOre[9] = 'Valorite'
NameOre[10] = 'Crystal'
NameOre[11] = 'Magma'
NameOre[12] = 'Obsidian'
NameOre[13] = 'Mytheril'
Dim ColorOre[13]
ColorOre[0] = '0x0000'
ColorOre[1] = '0x0641'
ColorOre[2] = '0x0400'
ColorOre[3] = '0x084d'
ColorOre[4] = '0x048a'
ColorOre[5] = '0x07d1'
ColorOre[6] = '0x0488'
ColorOre[7] = '0x0482'
ColorOre[8] = '0x0770'
ColorOre[9] = '0x0515'
ColorOre[10] = '0x0487'
ColorOre[11] = '0x0486'
ColorOre[12] = '0x0485'
ColorOre[13] = '0x048d'
UO.TextOpen()
UO.TextPrint("#####################")
UO.TextPrint("## Âðåìÿ: "+LogsTime+" ##")
UO.TextPrint("#####################")
For i = 0 TO 3
For ii = 0 TO 13
If a<>0 Then
UO.TextPrint(NameOre[ii]+" Ore: "+STR(a))
EndIf
Next
Next
UO.TextPrint("#####################")
endsub
Sub GetAmount(Type,Color,Cont)
var item_amount = 0
UO.IgnoreReset()
REPEAT
UO.FindType(Type, Color, Cont)
If UO.FindCount() Then
If UO.GetQuantity('finditem')==0 Then
item_amount = item_amount + 1
Else
item_amount = item_amount + UO.GetQuantity('finditem')
EndIf
UO.Ignore('finditem')
UO.FindType(Type, Color, Cont)
EndIf
Until UO.FindCount()==0 or UO.Dead()
UO.IgnoreReset()
Return item_amount
endsub
##############
### ×àñèêè ###
##############
Sub PrintTime()
var HR = ''
var MIN = ''
var SEC = ''
var CurrentTime = UO.Time()
If CurrentTime>99999 Then
HR = Mid(STR(CurrentTime),0,2)
MIN = Mid(STR(CurrentTime),2,2)
SEC = Mid(STR(CurrentTime),4,2)
Else
If CurrentTime > 9999 Then
HR = '0'+Mid(STR(CurrentTime),0,1)
MIN = Mid(STR(CurrentTime),1,2)
SEC = Mid(STR(CurrentTime),3,2)
Else
If CurrentTime > 999 Then
HR = '00'
MIN = Mid(STR(CurrentTime),0,2)
SEC = Mid(STR(CurrentTime),2,2)
Else
If CurrentTime > 99 Then
HR = '00'
MIN = '0'+Mid(STR(CurrentTime),0,1)
SEC = Mid(STR(CurrentTime),1,2)
Else
If CurrentTime > 9 Then
HR = '00'
MIN = '00'
SEC = STR(CurrentTime)
Else
HR = '00'
MIN = '00'
SEC = '0'+STR(CurrentTime)
EndIf
EndIf
EndIf
EndIf
EndIf
Return (HR+':'+MIN+':'+SEC)
endsub
##################
### ÐÅÊÎÍÅÊÒÎÐ ###
##################
Sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime = '0'
rFlag = 1
REPEAT
While UO.ObjAtLayer('Bpack')==''
If rFlag Then
ReconnectTime = PrintTime()
rFlag = 0
EndIf
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'
EndIf
Until false
endsub
Sub gotoxy(x,y,prec)
var ld=0,ldc=0
var dx,dy
var mx,my
var ox,oy,mk,k
#uo.print(">")
#uo.track("1",str(x),str(y))
start:
mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
endif
if dx<=prec then
return
endif
if not ldc then
uo.print(STR(dx))
endif
if dx<3 then
mk=70
else
mk=15
endif
ox=mx
oy=my
for k=1 to mk
mx=UO.GetX()
my=UO.GetY()
if mx<>ox or my<>oy then
goto sdidapl
endif
wait(10)
next
sdidapl:
mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
endif
if dx<=prec then
return
endif
if ld==dx then
ldc=ldc+1
if ldc>100 then
uo.print("Can not reach location!")
return
endif
else
ld=dx
endif
if mx==x then
if my==y then
return
endif
if my>y then
#UO.Print("UR")
UO.Press(33)
goto start
endif
#UO.Print("DL")
UO.Press(35)
goto start
endif
if mx<x then
if my>y then
#UO.Print("R")
UO.Press(39)
goto start
endif
if my==y then
#UO.Print("DR")
UO.Press(34)
goto start
endif
#UO.Print("D")
UO.Press(40)
goto start
endif
if my<y then
#UO.Print("L")
UO.Press(37)
goto start
endif
if my==y then
#UO.Print("LU")
UO.Press(36)
goto start
endif
#UO.Print("U")
UO.Press(38)
goto start
endsub
#######################################################################
# Ïðîöåäóðà ðàçìåòêè ïóòè îò áàíêà ê ìåñòó ðåñà. #
#  êëþ÷åâûõ òî÷êàõ ùåëêàåì ïðèöåëîì ïî ïåðñîíàæó. #
# Ðàçìåòêà ïóòè çàâåðøàåòñÿ íàæàòèåì êëàâèøè [ESC]. #
# Ïîñëå çàâåðøåíèÿ ðàçìåòêè ïóòè èç òåêñòîâîãî îêíà âñòàâëÿåì #
# ïîëó÷èâøèéñÿ òåêñò â ïðîöåäóðó GoToxyResurrect(). #
#---------------------------------------------------------------------#
sub MarkWay()
DIM XPoint[100], YPoint[100]
VAR idPoint
VAR i, iCount = 1
VAR FlagMark = true
while FlagMark
UO.Print("Îòìåòü òî÷êó ìàðøðóòà.")
UO.AddObject('TRGT')
while UO.Targeting()
wait(200)
wend
idPoint = UO.GetSerial('TRGT')
if idPoint == UO.GetSerial('self') then
XPoint[iCount] = UO.GetX()
YPoint[iCount] = UO.GetY()
iCount = iCount + 1
UO.Print("ÒÎ×ÊÀ ïóòè çàíåñåíà â ìàðøðóò.")
endif
if idPoint <> UO.GetSerial('self') then
XPoint[iCount] = UO.GetX()
YPoint[iCount] = UO.GetY()
FlagMark = false
UO.Print("Ìåñòî âîçðàæäåíèÿ çàíåñåíî â ìàðøðóò.")
endif
wend
UO.TextOpen()
UO.TextClear()
UO.TextPrint("#=== Òåêñò ñêîïèðîâàòü â ôóíêöèþ GoToxyResurrect().")
UO.TextPrint("#================================================")
UO.TextPrint(" VAR LastIndexDIM = " + str(iCount))
UO.TextPrint(" DIM koord_X[" + str(iCount) + "], koord_Y[" + str(iCount) + "]")
for i = 1 to iCount
UO.TextPrint(" koord_X[" +str(i) + "] = " + str(XPoint[i]))
UO.TextPrint(" koord_Y[" +str(i) + "] = " + str(YPoint[i]))
next
endsub
SUB GoToxyResurrect() # Èäåì ê ìåñòó âîçðàæäåíèÿ è îð¸ì òàì, ïîêà íå ðåñíóò.
#======== ÂÑÒÀÂÒÅ ÏÎËÓ×ÈÂØÈÉÑß ÒÅÊÑÒ ========#
#==== îò ýòîãî êîììåíòàðèÿ äî ñëåäóþùåãî ====#
#=== Òåêñò ñêîïèðîâàòü â ôóíêöèþ GoToxyResurrect().
#================================================
VAR LastIndexDIM = 18
DIM koord_X[18], koord_Y[18]
koord_X[1] = 2506
koord_Y[1] = 540
koord_X[2] = 2514
koord_Y[2] = 540
koord_X[3] = 2517
koord_Y[3] = 540
koord_X[4] = 2517
koord_Y[4] = 554
koord_X[5] = 2517
koord_Y[5] = 561
koord_X[6] = 2528
koord_Y[6] = 563
koord_X[7] = 2546
koord_Y[7] = 563
koord_X[8] = 2552
koord_Y[8] = 569
koord_X[9] = 2552
koord_Y[9] = 573
koord_X[10] = 2556
koord_Y[10] = 577
koord_X[11] = 2559
koord_Y[11] = 577
koord_X[12] = 2562
koord_Y[12] = 580
koord_X[13] = 2567
koord_Y[13] = 580
koord_X[14] = 2567
koord_Y[14] = 610
koord_X[15] = 2578
koord_Y[15] = 610
koord_X[16] = 2578
koord_Y[16] = 598
koord_X[17] = 2574
koord_Y[17] = 594
koord_X[18] = 2574
koord_Y[18] = 594
#==== âñòàâòå òåêñò äî ýòîãî êîììåíòàðèÿ ====#
#============================================#
VAR i, k = 0
# Áåæèì ê ìåñòó âîçðîæäåíèÿ.
for i = 1 to LastIndexDIM
gotoxy(koord_X[i], koord_Y[i], 0)
next
# Êðè÷èì: "Ðåñíèòå", - ïîêà íå ðåñíóò.
while UO.Dead()
UO.Say("Ðåñíèòå ìåíÿ ïîæàëóéñòà.")
wait(3000)
wend
# Ïîñëå ðåñà èäåì ê îáðàòíî ê áàíêó.
for i = LastIndexDIM to 1 step -1
gotoxy(koord_X[i], koord_Y[i], 0)
next
GetReagentsFromBank()
endsub
#Ïîëíûé êîïèïàñò òâîåé ôóíêöèè regi ñ íåáîëüøèìè èçìåíåíèÿìè.
SUB GetReagentsFromBank()
#VAR BagInBank = '0x4009D5EC' #<<<Âûíåñ â ãëîáàëüíûå ïåðåìåííûå
VAR r, q, n, amount = 5
Dim reg[4]
reg[1] = '0x0F7A'
reg[2] = '0x0F7B'
reg[3] = '0x0F86'
reg[4] = '0x0E21'
UO.Say('bank')
wait(3000)
UO.UseObject(BagInBank)
wait(3000)
For r = 1 to 4
if uo.count( reg[r] )<>amount then
q = amount - uo.count( reg[r] )
if q <> 0 then
if q > 0 then
uo.useobject("Sunduk")
wait(250)
uo.findtype( reg[r] , -1 ,BagInBank)
If uo.findcount() == 0 then
uo.msg('Ia vzial regi!')
return
endif
uo.moveitem('finditem', STR(q) )
wait(1000)
else
q = q*-1
uo.findtype( reg[r] )
uo.moveitem('finditem', STR(q) ,BagInBank)
wait(1000)
endif
endif
endif
next
While uo.Count('0x0F09','0x0060') < 2
uo.findtype('0x0F09','0x0060',BagInBank)
if uo.FindCount() then
uo.moveitem('finditem')
checklag()
wait(1000)
endif
wend
uo.print('Vziali regi ...')
endsub
#--------------------------------------------------------------#
################################################################