Code: Select all
sub dig(i,j)
var MMM
loop:
UO.DeleteJournal()
uo.setcatchbag(0x400bf86d)
DIM ruda[7] ;0-10 - 11 rud
ruda[0]='0x0000' ; iron
ruda[1]='0x0750' ; ñòàâèøü êàêîé òàì öâåò ðàñòè
ruda[2]='0x0590' ; old
ruda[3]='0x060A' ; dull
ruda[4]='0x0088' ; copper
ruda[5]='0x0488' ; bronze
ruda[6]='0x0482' ; silver
while (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal("Iron")) and (not uo.injournal("Rusty")) and (not uo.injournal("Copper")) and (not uo.injournal("Bronze")) and (not uo.injournal ("too far")) and (not uo.injournal("too far away"))
tohide()
UO.Waittargettile("1339", str(i), str(j),"0")
UO.Usetype (0x0E85)
uo.deletejournal()
while (not uo.injournal("fail")) and (not uo.injournal("put")) and (not uo.injournal("elemental")) and (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal("too far away"))
wait(100)
wend
wend
uo.deletejournal()
end sub
sub main()
var my, mx,i,j
while (not uo.dead())
mx = UO.GetX("self")
my = UO.GetY("self")
tohide()
for i = mx-4 to mx+4
for j = my-4 to my+4
dig(i,j)
UO.Print("Now Mining In: "+str(mx-i)+" "+str(my-j))
next
next
wend
end sub
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
end if
if dx<=prec then
return
end if
if not ldc then
uo.print(STR(dx))
end if
if dx<3 then
mk=70
else
mk=15
end if
ox=mx
oy=my
for k=1 to mk
mx=UO.GetX()
my=UO.GetY()
if mx<>ox or my<>oy then
goto sdidapl
end if
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
end if
if dx<=prec then
return
end if
if ld==dx then
ldc=ldc+1
if ldc>100 then
uo.print("Can not reach location!")
return
end if
else
ld=dx
end if
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
end if
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
end if
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
end sub
;-------------------------upgrate------------------------
sub tohide()
while NOT UO.Hidden()
UO.DeleteJournal()
if UO.Life<150 then
UO.UseType('0x0F0E','0x0631') ; inviz potion
wait(2000)
else
UO.UseSkill('Hiding')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied')
endif
UO.WarMode('flip')
wait(100)
UO.Warmode(0)
wend
end sub
sub mining()
uo.exec('exec main')
uo.exec('exec reconnector')
endsub
sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
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 MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub
я слышал что от правильностьи скрипта зависит крашит клиент или нет.
ребт подправьте плиз а то крашит постоянно на ночь оставить немогу!
это скрипт на маленькуювипуху...
сенк)