Code: Select all
sub Starter()
var i=0,j=0,k=0,r=0,q=0,ii,jj
var TopX=324,TopY=65
dim PointX[5000], PointY[5000],PointT[5000]
var flag=0,PointCount=0,clicks=0,flag2=0
#BETEP™#
uo.Exec("filterspeech on")
uo.Exec("filterspeech add 'Where do you want to use the pickaxe?'")
if GetFromFile==1 then
uo.Print('Загружаем координаты из файла...')
f.open()
PointCount=safe call f.ReadNumber()
for i=1 to PointCount
PointT[i]=safe call f.ReadNumber()
PointX[i]=safe call f.ReadNumber()
PointY[i]=safe call f.ReadNumber()
next
f.close()
else
uo.Print('Выбери Кирку: ')
uo.Exec('addobject Pickaxe')
while uo.Targeting()
wait(100)
wend
uo.Print('Собираем координаты точек для ловли ...')
repeat
clicks=0
flag=0
uo.DeleteJournal()
uo.UseObject('Pickaxe')
waitForTarget()
uo.DeleteJournal()
WaitForTryRock()
if uo.Lasttile(1)==uo.getX() and uo.Lasttile(2)==uo.gety() then
flag=3
end if
PointCount=PointCount+1
PointX[PointCount]=uo.LastTile(1)
PointY[PointCount]=uo.LastTile(2)
PointT[PointCount]=uo.LastTile(0)
uo.Print('Найдена точка ловли '+str(PointCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2))+' '+str(PointCount))
until (Flag==3) or (PointCount==5000)
uo.Exec("filterspeech off")
uo.Print('Анализ закончен, координаты точек записаны в файл C:\Fish.dat')
SaveToFile(PointCount,PointX,PointY,PointT)
end if
uo.Print('Точек найдено: '+str(PointCount))
wait(2000)
while 1==1
if PointCount>0 then
for i=1 to PointCount
uo.Print('Идем к координате '+str(i)+': x='+str(PointX[i])+' y='+str(PointY[i]))
flag=GotoXY(PointX[i],PointY[i])
if flag==1 then
if TryHiding==1 then
ToHide()
end if
Fishing()
end if
next
end if
wend
end sub
sub Options()########################################## Конфиг
UO.Say("zdarova eto skript nastrojka!")
wait(3000)
UO.Say("sledujte instrukcii!")
wait(3000)
UO.Say("vi dolzni stojat licom k sunduku dla sbrosa!!")
wait(4000)
UO.Say("ukazite runbuk ")
UO.AddObject('RuneB1')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("ukazite sunduk pricelom")
UO.AddObject('Sunduk')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("ukazite sumku v sunduke")
UO.AddObject('SundukBag')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("otli4no")
UO.UseObject('Sunduk')
wait(3000)
UO.Say("ukazite sumku dla rar ribi")
UO.AddObject('StoreFish')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("ukazite sumku dla prajz ribi")
UO.AddObject('StorePRFish')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("ukazite sumku dla kart")
UO.AddObject('StoreMAP')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
wait(2000)
UO.Say("vse ok,perezapustite skript.")
end sub
Sub Fishing()
var mX, mY, mZ, i, j
var f
var a=0
#########################################################################
###################
### Массив рыбы ###
###################
dim Fish[6]
Fish[0]=0x09CC
Fish[1]=0x09CD
Fish[2]=0x09CE
Fish[3]=0x09CF
Fish[4]=0x14EB
Fish[5]=0x0DD6
Fish[6]=0x0DD6
Beginning:
uo.Set('finddistance','6')
mX = uo.getX("self")
mY = uo.getY("self")
mZ = uo.getZ("self")
uo.DeleteJournal()
for i = mX-6 to mX+6
for j = mY-6 to mY+6
if uo.Dead() then
return
end if
if TryToHide==1 then
ToHide()
end if
uo.Print("Сейчас ловим: "+str(mx-i)+" "+str(my-j))
while not uo.InJournal("You pull") and not uo.InJournal("in water") and not uo.InJournal("no fish") and not uo.InJournal("far away")
uo.DeleteJournal()
uo.Waittargettile("1341", str(i), str(j), str(mZ))
uo.Usetype('0x0DBF')
while not uo.InJournal("You pull") and not uo.InJournal("location") and not uo.InJournal("no fish") and not uo.InJournal("but fail") and not uo.InJournal("far away") and not uo.InJournal("in water")
wait (100)
if uo.InJournal("You pull") then
if a>0 then
uo.print(STR(a))
end if
if UO.InJournal("You pull out a fish!") then
if TakeFish==1 then
uo.Print('Собираем рыбу.')
for f=0 to 3
uo.FindType(Fish[f],"-1","ground")
if uo.Count(Fish[2])> 0 then
a= a+1
end if
uo.MoveItem("finditem","1","Fishs")
wait(200)
next
end if
endif
if UO.InJournal("You pull out a Tattered treasure map!") then
if TakeMaps==1 then
uo.Print('Собираем карты.')
for f=4 to 4
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","Maps")
wait(200)
next
end if
endif
if UO.InJournal("Truly Rare Fish") then
if TakeRareFish==1 then
uo.Print('Собираем рар рыбу.')
for f=5 to 5
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","RareFish")
wait(200)
next
end if
endif
if UO.InJournal("Prize") then
if TakePrizeFish==1 then
uo.Print('Собираем приз рыбу.')
for f=6 to 6
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","PrizeFish")
wait(200)
next
end if
endif
if TryRecall==1 and uo.Weight>=uo.STR*4+20 then
ToRecall()
end if
end if
wend
wend
uo.DeleteJournal()
next
next
end sub
Sub ToRecall()
RecallToHome()
Drop()
if EatingFood==1 then
EatingFood()
end if
wait(3000)
RecallToPoint()
end sub
sub RecallToHome()
uo.Print('Прыгаем Домой.')
RunebookRecall(RuneToHome)
end sub
sub RecallToPoint()
uo.Print('Прыгаем в Лес.')
RunebookRecall(RuneToPoint)
end sub
sub ToHide()
while not uo.Hidden()
uo.Print('Пытаемся уйти в хайд...')
uo.DeleteJournal()
uo.UseSkill('Stealth')
wait(4500)
wend
wait(100)
end sub
Sub WaitForRecall()
var Text1=uo.GetName()+": The spell fizzles."
var mess='',lastX=uo.getX(),lastY=uo.getY()
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 0
end if
if uo.getX()<>lastX or uo.getY()<>LastY then
return 1
end if
wait(50)
next
return 0
end sub
Sub WaitForTryRock()
var Text1="That is too far away."
var Text2="Try mining in rock."
var Text3="There is no ore here to mine."
var Text4="You have no line of sight to that location"
var Text5="You can't see the target"
for var i=0 to 50
if uo.Journal(0)==Text1 or uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 or uo.Journal(0)==Text5 then
return 1
end if
wait(200)
next
return 0
end sub
Sub WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub
Sub WaitForChangeXY(myX,myY,lastX,lastY)
for var i=1 to 50
if lastX<>myX or lastY<>myY then
return 1
end if
wait(200)
next
return 0
end sub
Sub GotoXY(x,y)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.getX();
myY=uo.getY();
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=1 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
uo.Press(38)
next
else
for z=0 to 3
uo.Press(37)
next
end if
else
if y<=myY then
for z=0 to 3
uo.Press(39)
next
else
for z=0 to 3
uo.Press(40)
next
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub
Sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub
Sub SaveToFile(PointCount,PointX,PointY,PointT)
var f=file("C:\Fish.dat")
var s=0,i=0
f.open()
f.create()
s=safe call f.writeln(PointCount)
for i=1 to PointCount
s=safe call f.writeln(str(PointT[i])+' '+str(PointX[i])+' '+str(PointY[i]))
next
f.close()
end sub
sub Drop()
if uo.Waiting() then
uo.CancelTarget()
end if
var Exit
var f
;var a=0
dim Fish[7]
Fish[0]=0x09CC
Fish[1]=0x09CD
Fish[2]=0x09CE
Fish[3]=0x09CF
Fish[4]=0x14EB
Fish[5]=0x0DD6
Fish[6]=0x0DD6
UO.UseObject('Sunduk')
wait(1000)
UO.UseObject('SundukBag')
wait(1000)
UO.UseObject('StoreFish')
wait(1300)
UO.UseObject('StoreMAP')
wait(1000)
UO.UseObject('StorePRFish')
wait(700)
exit=0
repeat
for f=0 to 3
uo.FindType(Fish[f],"-1","backpack")
uo.SetReceivingContainer('StoreFish')
if uo.GetQuantity('finditem')> 0 then
repeat
wait(130)
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1300)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
exit=0
repeat
for f=4 to 4
uo.FindType(Fish[f],"-1","backpack")
uo.SetReceivingContainer('StoreMAP')
if uo.GetQuantity('finditem')> 0 then
repeat
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
exit=0
repeat
for f=5 to 5
uo.FindType(Fish[f],"0x01BB","backpack")
uo.SetReceivingContainer('StorePRFish')
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"0x01BB","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
repeat
for f=6 to 6
uo.FindType(Fish[f],"backpack")
uo.SetReceivingContainer('StoreFish') ;rar
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
uo.Print("Улов выложен")
end sub
Sub RunebookRecall(n)
oldX=uo.getX()
oldY=uo.getY()
repeat
uo.Exec('warmode 0')
uo.UseObject('Runebook')
wait(1000)
uo.LClick(135, n*15+55)
wait(500)
uo.LClick(135, n*15+55)
time=uo.Timer()
repeat
wait(500)
until oldX<>uo.getX() or oldY<>uo.getY() or uo.Life==0 or uo.InJournal('needs') or time+200<uo.Timer()
uo.DeleteJournal()
until oldX<>uo.getX() or oldY<>uo.getY()
end sub
Sub Open(Container)
uo.DeleteJournal()
uo.UseObject(Container)
repeat
wait(500)
until uo.InJournal('Contains')
end sub
Sub EatingFood()
ToEat()
DropFood()
end sub
Sub ToEat()
uo.SetReceivingContainer('backpack')
Open('Sunduk')
uo.FindType(TypeFood,'-1','Sunduk')
uo.Grab('50','finditem')
wait(500)
repeat
Checklag()
uo.UseType(TypeFood)
wait(1000)
until uo.InJournal('You are simply too full to eat any more!')
uo.UnsetReceivingContainer()
end sub
Sub DropFood()
if uo.Waiting() then
uo.CancelTarget()
end if
var f,Exit
dim Food[1]
Food[0]=TypeFood
uo.SetReceivingContainer('Sunduk')
wait(500)
for f=0 to 0
Exit=0
repeat
uo.FindType(Food[f])
if uo.GetQuantity('finditem')>0 then
uo.Grab('0','finditem')
wait(1500)
else
Exit=1
end if
until Exit==1
next
uo.UnSetReceivingContainer('Sunduk')
end sub
Sub RecallAtAttack()
var mX,mY
reccal:
uo.DeleteJournal()
if uo.Waiting() then
uo.CancelTarget()
end if
mX=uo.getX("self")
mY=uo.getY("self")
uo.DeleteJournal()
uo.FindType('0x1F14',-1,'mY')
uo.Cast('Recall','finditem')
uo.Print('Атака! Реколимся!')
wait(4000)
if not uo.getX("self")<>mX and not uo.getY("self")<>mY then
goto reccal
end if
RecallToHome()
Drop()
Terminate()
end sub
sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime='0'
rFlag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rFlag then
ReconnectTime=MakeTime()
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 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
end if
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
end if
next
ret=t+" @ "+d
return ret
end sub
sub Terminate()
uo.Print('Все функции скрипта выключены!')
uo.DeleteJournal()
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
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