Yoko

All sides of Injection
It is currently 2024-04-18 23:45:52

All times are UTC+02:00




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
PostPosted: 2012-06-23 20:33:54 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Здравствуйте господа,у меня такая проблема.Есть макрос на Мининг работает идеально,сначала запускаем скрипт марка тайлов в шахте,потом запускаем сам Мининг.Но вот что я хочу,можно ли переделать его под Фишинг по конкретным тайлам,на сервере нету кораблей все ловят либо с пристыни либо по берегу,макров с корабля навалом.
Сам я не умею скриптить но поковырялся,исправил надписи при которых он должен идти дальше,тк сервак русифицирован,он подходит к воде и выдает таргет с удочки но по тайлу не тыкает видимо хочет подойти в плотную как в шахте он подходит.
Суть,нужно чтобы делал тоже самое что и мининг но заменить тайлы шахты на воду,чтобы сначала я маркал тайлы воды,и затем включал сам макрос и он ходил и ловил по этим координатам.Чтобы не пытался подойти на тайл с водой,а ловил за 1-2 клетки от воды.



ЭТО МОЯ ВЕРСИЯ.
НИЖЕ ВЫЛОЖУ ОРИГИНАЛ.

Code:
sub collecting() 

var i,s=0,flag=0
var f=file("D:\_GAMES\UO OLMER\riba.txt")
dim RockX[500],RockY[500],RockT[500]
var Count=0

while not flag ==1
 
   uo.usetype ('0x0E85')
   WaitForTarget()
   
   while uo.targeting()
   wait(100)
   wend
   
   if  uo.LastTile(1)==UO.GetX("self") then
      if uo.lastTile(2)==UO.GetY("self")  then
         flag=1
      endif
   endif

   
   if flag == 0 then
      RockX[Count]=uo.LastTile(1)
      RockY[Count]=uo.lastTile(2)
      RockT[Count]=uo.LastTile(0)
      uo.print('Найдена кочка № '+str(count)+': x='+str(uo.lasttile(1))+' y='+str(uo.lastTile(2)))
       

      Count = Count+1
   
   endif
   
   
wend


uo.print ("Найдено " + str(Count) + " кочек")
#################################################
################Запись в файл####################
#################################################

f.open()
f.create()
s=safe call f.writeln(Count)
   for i=0 to Count-1
   s=safe call f.writeln(str(RockT[i])+' '+str(RockX[i])+' '+str(RockY[i]))
   next
f.close()

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


end sub



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


sub mining()

var i,flag,j
var Count
var f=file("D:\_GAMES\UO OLMER\riba.txt")
dim RockX[500],RockY[500],RockT[500]
uo.deletejournal()

#################################################
###############Загружаем из файла################
#################################################

uo.print('Загружаем координаты из файла...')
f.open()
Count=safe call f.readNumber()

uo.print("Загружено "+str(Count)+ " кочек")

for i=0 to Count-1
RockT[i]=safe call f.ReadNumber()
RockX[i]=safe call f.ReadNumber()
RockY[i]=safe call f.ReadNumber()
next
f.close()


#################################################
###############Ходим по координатам##############
#################################################

while UO.Weight<650
uo.deletejournal()
   if Count>0 then
   for i=0 to Count-1
      flag=0
      j=0
      uo.print('Идем к тайлу '+str(i)+': x='+str(Rockx[i])+' y='+str(RockY[i]))

      while not flag==1
         flag=gotoxy(RockX[i],RockY[i])
         wait (1000)
      wend
       
       
uo.deletejournal()
 GetRock(str(RockT[i]),str(RockX[i]),str(RockY[i]),str(uo.getz()))
       
   next
   endif
wend

uo.print ("Выловлено")   

end sub


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

sub GetRock(tile,x,y,z)

uo.print('Начинаем ловку...')

while not UO.InJournal("Слишком долекло.") and not UO.InJournal("Здесь рыбы нет.") and not UO.InJournal("Вы что-то выловили.") and not UO.InJournal("Не клюет.") and not UO.InJournal("There is no ore here to mine.") and not UO.InJournal ("Тут не осталось руды") and not UO.InJournal("дотянуться") and not UO.InJournal("You put the iron ores in your pack.")
   uo.deletejournal()
   UO.Waittargettile(tile,x,y,z)
   uo.print ("Используем удочку...")
   UO.Usetype("0x0DBF")
   UO.Usetype("0x0DC0")
   UO.Usetype("0x0DBF")
             
   while not UO.InJournal("Слишком долекло.") and not UO.InJournal("Здесь рыбы нет.") and not UO.InJournal("Вы что-то выловили.") and not UO.InJournal("Не клюет.") and not UO.InJournal("There is no ore here to mine.") and not UO.InJournal ("Тут не осталось руды") and not UO.InJournal("but fail") and not UO.InJournal("nothing") and not UO.InJournal("Try") and not UO.InJournal("You put the iron ores in your pack.")
      wait (1000)
   wend
wend



end sub
##########################################
#############Дополнительные###############
################Функции###################
##########################################


sub abs(num)
if num>=0 then
return num
else
return num*(-1)
end if
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 abs(x-myX)<=1 AND abs(y-myY)<=2 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 WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub



ЭТО ОРИГИНАЛ КОЛЕКТИНГА И МИНИНГА.


Code:
sub collecting() 

var i,s=0,flag=0
var f=file("C:\_GAMES\Ultima Online\Ultima Online\Inject\rock.txt")
dim RockX[500],RockY[500],RockT[500]
var Count=0

while not flag ==1
 
   uo.usetype ('0x0E85')
   WaitForTarget()
   
   while uo.targeting()
   wait(100)
   wend
   
   if  uo.LastTile(1)==UO.GetX("self") then
      if uo.lastTile(2)==UO.GetY("self")  then
         flag=1
      endif
   endif

   
   if flag == 0 then
      RockX[Count]=uo.LastTile(1)
      RockY[Count]=uo.lastTile(2)
      RockT[Count]=uo.LastTile(0)
      uo.print('Найдена кочка № '+str(count)+': x='+str(uo.lasttile(1))+' y='+str(uo.lastTile(2)))
       

      Count = Count+1
   
   endif
   
   
wend


uo.print ("Найдено " + str(Count) + " кочек")
#################################################
################Запись в файл####################
#################################################

f.open()
f.create()
s=safe call f.writeln(Count)
   for i=0 to Count-1
   s=safe call f.writeln(str(RockT[i])+' '+str(RockX[i])+' '+str(RockY[i]))
   next
f.close()

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


end sub



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


sub mining()

var i,flag,j
var Count
var f=file("C:\_GAMES\Ultima Online\Ultima Online\Inject\rock.txt")
dim RockX[500],RockY[500],RockT[500]
uo.deletejournal()

#################################################
###############Загружаем из файла################
#################################################

uo.print('Загружаем координаты из файла...')
f.open()
Count=safe call f.readNumber()

uo.print("Загружено "+str(Count)+ " кочек")

for i=0 to Count-1
RockT[i]=safe call f.ReadNumber()
RockX[i]=safe call f.ReadNumber()
RockY[i]=safe call f.ReadNumber()
next
f.close()


#################################################
###############Ходим по координатам##############
#################################################

while UO.Weight<650
uo.deletejournal()
   if Count>0 then
   for i=0 to Count-1
      flag=0
      j=0
      uo.print('Идем к кочке '+str(i)+': x='+str(Rockx[i])+' y='+str(RockY[i]))

      while not flag==1
         flag=gotoxy(RockX[i],RockY[i])
         wait (1000)
      wend
       
       
uo.deletejournal()
 GetRock(str(RockT[i]),str(RockX[i]),str(RockY[i]),str(uo.getz()))
       
   next
   endif
wend

uo.print ("Выкопано")   

end sub


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

sub GetRock(tile,x,y,z)

uo.print('Начинаем копку...')

while not UO.InJournal("Try") and not UO.InJournal("location") and not UO.InJournal("Попробуйте") and not UO.InJournal("far away") and not UO.InJournal("There is no ore here to mine.") and not UO.InJournal ("Тут не осталось руды") and not UO.InJournal("дотянуться") and not UO.InJournal("You put the iron ores in your pack.")
   uo.deletejournal()
   UO.Waittargettile(tile,x,y,z)
   uo.print ("Используем кирку...")
   UO.Usetype("0x0E85")
             
   while not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("Попробуйте") and not UO.InJournal("дотянуться") and not UO.InJournal("There is no ore here to mine.") and not UO.InJournal ("Тут не осталось руды") and not UO.InJournal("but fail") and not UO.InJournal("nothing") and not UO.InJournal("Try") and not UO.InJournal("You put the iron ores in your pack.")
      wait (1000)
   wend
wend



end sub
##########################################
#############Дополнительные###############
################Функции###################
##########################################


sub abs(num)
if num>=0 then
return num
else
return num*(-1)
end if
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 abs(x-myX)<=1 AND abs(y-myY)<=2 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 WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub




Прощу помощи.


Top
   
PostPosted: 2012-06-25 15:29:00 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Code:
      while not flag==1 
         flag=gotoxy(RockX[i],RockY[i])
         wait (1000)
      wend

Замени на это:
Code:
var prec = 2 ; подход
while abs(uo.getx('self') - RockX[i]) > prec or abs(uo.gety('self') - RockY[i]) > prec
    gotoxy(RockX[i],RockY[i])
    wait(1000)
wend

это подход, но переменную лучше объявлять до while UO.Weight<650.


Last edited by ZeroDX on 2012-06-27 23:18:35, edited 1 time in total.

Top
   
PostPosted: 2012-06-27 14:31:01 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Заменил,он вообще даже подходить не пытается,просто дает таргет от удочки и все.


Top
   
PostPosted: 2012-06-27 17:25:43 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
ага ошибка в условии. замени меньше на больше, 2 раза


Top
   
PostPosted: 2012-06-27 20:54:53 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Эммм? ))) а ты не мог бы рабочий выложить? )) а то я не очень понимаю что и где изменить,


Top
   
PostPosted: 2012-06-27 23:19:51 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Поменял в посте с решением, вся разница была в знаках < и >.


Top
   
PostPosted: 2012-06-28 12:46:59 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Ходить он начал )) но тыкать удочкой по координатам не хочет,записал видео,выложил на Ютуб,ссылка ниже.

http://www.youtube.com/watch?v=-ADFNr92h3Q&feature=colike


Top
   
PostPosted: 2012-06-28 12:56:45 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
координата Z у воды не равна Z чара (на некоторых шардах).
Попробуй поставить Z = 251, или ,infotile на воду и посмотри там параметр.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2012-06-28 14:04:06 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
6040 2261 1123 -5 вот параметры после infotile,тока куда что вставлять я не найду, Z = 251 нету там Z вообще кроме как в ABS...


Top
   
PostPosted: 2012-06-28 14:17:18 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
я даже в ABS поменял все значения, z=0 на z=251 )) тоже самое,подходит к месту дает таргет 1 раз и все.


Top
   
PostPosted: 2012-06-28 14:47:03 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Code:
sub mining() 

var i,flag,j
var Count
var f=file("D:\_GAMES\UO OLMER\riba.txt")
dim RockX[500],RockY[500],RockT[500]
uo.deletejournal()

#################################################
###############Çàãðóæàåì èç ôàéëà################
#################################################

uo.print('Çàãðóæàåì êîîðäèíàòû èç ôàéëà...')
f.open()
Count=safe call f.readNumber()

uo.print("Çàãðóæåíî "+str(Count)+ " êî÷åê")

for i=0 to Count-1
RockT[i]=safe call f.ReadNumber()
RockX[i]=safe call f.ReadNumber()
RockY[i]=safe call f.ReadNumber()
next
f.close()


#################################################
###############Õîäèì ïî êîîðäèíàòàì##############
#################################################

while UO.Weight<650
uo.deletejournal()
   if Count>0 then
   for i=0 to Count-1
      flag=0
      j=0
      uo.print('Èäåì ê òàéëó '+str(i)+': x='+str(Rockx[i])+' y='+str(RockY[i]))

      var prec = 2 ; ??????
      while abs(uo.getx('self') - RockX[i]) > prec or abs(uo.gety('self') - RockY[i]) > prec
      gotoxy(RockX[i],RockY[i])
      wait(1000)
wend
       
       
uo.deletejournal()
 GetRock(str(RockT[i]),str(RockX[i]),str(RockY[i]),str(uo.getz()))
       
   next
   endif
wend

uo.print ("Âûëîâëåíî")   

end sub


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

sub GetRock(tile,x,y,z)
VAR FPole1   = '0x0DBF'
VAR FPole2   = '0x0DC0'

uo.print('Íà÷èíàåì ëîâêó...')

while not UO.InJournal("ëèøêîì äîëåêëî|äåñü ðûáû íåò|û ÷òî-òî âûëîâèëè|å êëþåò|here is no ore here to mine|óò íå îñòàëîñü ðóäû|äîòÿíóòüñÿ|ou put the iron ores in your pack")
   uo.deletejournal()
   UO.Waittargettile(tile,x,y,-5)
   uo.print ("Èñïîëüçóåì óäî÷êó...")

         if UO.Count( FPole1 ) || UO.Count( FPole2 ) then
            if UO.Count( FPole1 ) then
               UO.UseType( FPole1 )
               return
            else
               UO.UseType( FPole2 )
               return
            endif
         else
            uo.print('Íå÷åì ëîâèòü ðûáó!')
         endif

   while not UO.InJournal("Ñëèøêîì äîëåêëî|äåñü ðûáû íåò|û ÷òî-òî âûëîâèëè|å êëþåò|here is no ore here t|íå îñòàëîñü ðóäû|but fail|nothing|Try|ou put the iron ores in your pack")
      wait (1000)
   wend
wend



end sub
##########################################
#############Äîïîëíèòåëüíûå###############
################Ôóíêöèè###################
##########################################


sub abs(num)
if num>=0 then
return num
else
return num*(-1)
end if
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 abs(x-myX)<=1 AND abs(y-myY)<=2 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 WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub


Top
   
PostPosted: 2012-06-28 15:16:15 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
2 ZeroDX мой скрипт на добычу у него на шарде работает - там надо только добавить сообщение в оба msg
'нет рыбы'
у меня там поправка на Z стоит 251 вроде - если время есть посмотри.
Я щаз завален работой по гланды :?

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2012-06-28 15:54:06 
Offline
User avatar

Joined: 2012-06-23 20:18:34
Posts: 9
Все делал как надо,все равно чето не хочет пишет QuietMode off,убираю галочку Verbose Menu,вообще пишет тока "ВСЕ!" ну соответственно ставлю обратно начинает писать QuietMode off,до этого первый раз запустил он крутился чето хотел делать,щас вообще перестал дрыгатся ).



Code:
VAR    Shovel1   = '0x0F39'
VAR    Shovel2   = '0x0F3A'
VAR    Pickaxe1   = '0x0E85'
VAR    Pickaxe2   = '0x0E86'
VAR    axe1      = '0x0F43'
VAR    axe2      = '0x0F44'
VAR    FPole1   = '0x0DBF'
VAR    FPole2   = '0x0DC0'
VAR    log      = '0x1BDD'
VAR    knife      = '0x0F51'
VAR    Steak      = '0x097A'
var    weapon   = '0x1404'
var    Enemy   = '0x00000000'
VAR MaxVes = 550, printcolour = '1069'
VAR delay1 = 100 , delay2 = 300, delay3 = 700
VAR MaxRangeMining = 2, MaxRangeLumber = 3, MaxRangeFishing = 6
VAR X, Y, Z, i, Tiles, Lasttimer, MaxRange, action, timemove
VAR allmsg = 'нет рыбы|table|attacking you|%|destroyed|broke|useable|put the|is nothing here to mine|Wthere do you|have no line|mining elsewhere|too far away|so close to yourself|Logs|nothing|ou hack at the tree|no logs|no ore|ou can|reach this|hat is too far away|do much|t appears immune to your blow|cannot|fishing elsewhere|too far away|pull out|anything|no fish|0xAD00|0xA867|0xA2DE|0xAD03|0x5DE0|0x5DE1|0x5DE2|0x5DE3|0x5DE4|0x5DE5|0x5DE6|0x5DE7|выкопали|Вы положили|Вам не удалось|У вас нет|ничего|Тут ничего|Попробуйте|атакует|положили|древесина кончилась|дрова|ударили по дереву|ут нечего рубить|ы не можете до этого достать|ерево слишком далеко|то кажется свободным для вашего удара|поймали|не получилось|нету рыбы|месте|далеко|вытащили удочку'
VAR endmsg = 'нет рыбы|%|destroyed|is nothing here to mine|have no line|Try mining elsewhere|too far away|so close to yourself|nothing|no logs|no ore|ou can|cannot|fishing elsewhere|no fish|0xAD00|0xA867|0xA2DE|Тут ничего|нет руды|У вас нет|Попробуйте|древесина кончилась|ут нечего рубить|ы не можете до этого достать|ерево слишком далеко|свободным для вашего удара|нету рыбы|в другом месте|далеко|вытащили удочку'
VAR mX = UO.GetX('self'), mY = UO.GetY('self'), mZ = UO.GetZ('self')

sub Mining()
   UO.SetGlobal('action','1')
   UO.SetGlobal('MaxRange','2')
   uo.mfgi( 'resend' )
   extraction()
end sub
sub Lumber()
   UO.SetGlobal('action','2')
   UO.SetGlobal('MaxRange','3')
   uo.mfgi( 'resend' )
   extraction()
end sub
sub Fishing()
   UO.SetGlobal('action','3')
   UO.SetGlobal('MaxRange','6')
   uo.mfgi( 'resend' )
   extraction()
end sub

Sub extraction()
   for Y = -val(uo.GetGlobal('MaxRange')) to val(uo.GetGlobal('MaxRange'))
      for X = -val(uo.GetGlobal('MaxRange')) to val(uo.GetGlobal('MaxRange'))
         if val(uo.GetGlobal('action')) == 1 then
            Tiles = MiningTiles(mX+X, mY+Y)
         else
            if val(uo.GetGlobal('action')) == 2 then
               Tiles = Tree(mX+X, mY+Y)
            else
               Tiles = FishTiles(mX+X, mY+Y)
               mZ = -5
            end if
         end if
         if Tiles then
            repeat
               CheckAll()
               UO.DeleteJournal()
               UO.WaitTargetTile(Tiles, mX+X, mY+Y, mZ)
               Tools()
               LastTimer=UO.Timer()
               repeat
                  wait( delay1 )
               until UO.InJournal( allmsg ) || UO.Timer()>LastTimer+delay2 || UO.Weight > MaxVes || UO.Dead()
               CheckAll()
            until UO.InJournal( endmsg ) || UO.Timer()>LastTimer+delay3 || UO.Weight > MaxVes || UO.Dead()
            uo.mfgi( 'add', '6017', mX+X, mY+Y, mZ )
         end if
      next
   next
   UO.Set('quiet','0')
   uo.charprint(printcolour, 'ВСЕ!')
   UO.Sound(100)
end sub
Sub CheckAll()
   UO.Set('quiet','1')
   if UO.InJournal('is attacking you') then
      Enemy = UO.JournalSerial(UO.InJournal("is attacking you")-1)
      DeleteJournal('is attacking you')
      Gong(1)
      uo.Usetype( weapon )
      UO.Attack( Enemy )
      LastTimer=UO.Timer()
      repeat
         wait( delay2 )
      until uo.dead() or uo.GetX(Enemy)==0 || UO.Timer()>LastTimer+delay2
      uo.Warmode(0)
      wait(delay2)
   end if
   If UO.Life < Uo.Str/10 then
      UO.Set('quiet','0')
      uo.charprint(printcolour, 'Умираю!')
      MyTerminate()
   endif
   If UO.Weight > MaxVes Then
      UO.Set('quiet','0')
      uo.charprint(printcolour, 'Перегруз!')
      MyTerminate()
   endif
   if uo.Warmode()==1 then
      uo.Warmode(0)
      wait(delay2)
   end if
   DIM Fish[5]
   Fish[1]  = '0x09CC'   ; тип рыбы 1
   Fish[2]  = '0x09CD'   ; тип рыбы 2
   Fish[3]  = '0x09CE'   ; тип рыбы 3
   Fish[4]  = '0x09CF'   ; тип рыбы 4
   For i=1 To 4
      UO.FindType( Fish[i], -1, 'ground' )
      If UO.FindCount() > 0 Then
         timemove=UO.Timer()
         while UO.ContainerOf( UO.GetSerial('finditem') )=='0xFFFFFFFF' && timemove+20>UO.Timer()
            uo.MoveItem('finditem',0,'backpack')
            wait(delay1)
         wend
         if uo.count( knife ) then
            UO.WaitTargetObject( 'finditem' )
            UO.UseType( knife )
            while UO.Count( Fish[i] )
               wait( delay1 )
            wend
            UO.FindType( Steak )
            while UO.FindCount()>1
               UO.MoveItem( 'finditem', '0' , 'backpack' )
               wait( delay1 )
               UO.FindType( Steak )
            wend
         endif
      endif
   Next
   if UO.InJournal('в черте города') then
      DeleteJournal('в черте города')
      uo.charprint(printcolour, 'Ресурсы тут добывать нельзя!')
      MyTerminate()
   end if
end sub
Sub Tools()
   if val(uo.GetGlobal('action')) == 1 then
      if UO.Count(Shovel1) then
         UO.UseType(Shovel1)
         return
      else
         if UO.Count(Shovel2) then
            UO.UseType(Shovel2)
            return
         else
            if UO.Count(Pickaxe1) then
               UO.UseType(Pickaxe1)
               return
            else
               if UO.Count(Pickaxe2) then
                  UO.UseType(Pickaxe2)
                  return
               else
                  UO.Set('quiet','0')
                  uo.charprint(printcolour, 'Нечем копать!')
                  MyTerminate()
               endif
            endif
         endif
      endif
   else
      if val(uo.GetGlobal('action')) == 2 then
         if UO.Count(axe1) || UO.Count(axe2) then
            if UO.Count(axe1) then
               UO.UseType(axe1)
               return
            else
               UO.UseType(axe2)
               return
            endif
         else
            UO.Set('quiet','0')
            uo.charprint(printcolour, 'Нечем рубить!')
            MyTerminate()
         endif
      else
         if UO.Count( FPole1 ) || UO.Count( FPole2 ) then
            if UO.Count( FPole1 ) then
               UO.UseType( FPole1 )
               return
            else
               UO.UseType( FPole2 )
               return
            endif
         else
            uo.charprint(printcolour, 'Нечем ловить рыбу!')
            MyTerminate()
         endif
      end if
   end if
end sub
Sub MiningTiles(X,Y)
   if UO.PrivateGetTile(X, Y, -1, 616, 618) then
      for i=616 to 618
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 1339, 1363) then
      for i=1339 to 1363
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 2272, 2282) then
      for i=2272 to 2282
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 4963, 4973) then
      for i=4963 to 4973
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 6001, 6012) then
      for i=6001 to 6012
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 13121, 13369) then
      for i=13121 to 13369
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 13446, 13455) then
      for i=13446 to 13455
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 13484, 13492) then
      for i=13484 to 13492
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   if UO.PrivateGetTile(X, Y, -1, 13625, 13628) then
      for i=13625 to 13628
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   return 0
end sub
Sub Tree(X,Y)
   DIM  R[34]
   R[1] = 3274;
   R[2] = 3275;
   R[3] = 3276;
   R[4] = 3277;
   R[5] = 3280;
   R[6] = 3283;
   R[7] = 3286;
   R[8] = 3288;
   R[9] = 3290;
   R[10] = 3293;
   R[11] = 3296;
   R[12] = 3299;
   R[13] = 3302;
   R[14] = 3320;
   R[15] = 3323;
   R[16] = 3326;
   R[17] = 3329;
   R[18] = 3393;
   R[19] = 3394;
   R[20] = 3395;
   R[21] = 3396;
   R[22] = 3415;
   R[23] = 3416;
   R[24] = 3417;
   R[25] = 3418;
   R[26] = 3419;
   R[27] = 3438;
   R[28] = 3439;
   R[29] = 3440;
   R[30] = 3441;
   R[31] = 3442;
   R[32] = 3460;
   R[33] = 3461;
   R[34] = 3462;
   for i = 1 to 34
      if uo.privategettile( x, y, -1, R[i], R[i]) then
         return R[i]
      endif
   next
   return false
end sub
Sub FishTiles(X,Y)
   if UO.PrivateGetTile(X, Y, -1, 6038, 6066) then
      for i=6038 to 6066
         if UO.PrivateGetTile(X, Y, -1, i, i) then
            return i
         end if
      next
   end if
   return 0
end sub
Sub Gong(times)
   VAR i
   for i=1 to times
      UO.Exec("playwav d:\Games\Ultima\GMYokoInjection\ALARM")
      wait(200)
   next
end sub
Sub DeleteJournal(msg)
   While UO.InJournal(msg)
      UO.SetJournalLine(UO.InJournal(msg) - 1,'')
   wend
endsub
Sub MyTerminate()
   UO.Set('quiet','1')
   UO.CancelMenu()
   UO.IgnoreReset()
   UO.Set('quiet','0')
   UO.Exec('terminate all')
end sub
Sub checklag()
   DeleteJournal("ackpack")
   UO.Click("backpack")
   repeat
      wait(100)
   until UO.InJournal("ackpack")
end sub
sub clean()
   var m = 50
   for Y = -m to m
      for X = -m to m
         uo.mfgi( 'clear', mX+X, mY+Y, mZ )
      next
   next
end sub


Top
   
PostPosted: 2012-06-28 20:04:28 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
ну вроде как в строке
Code:
if UO.PrivateGetTile(X, Y, -1, 6038, 6066) then
-1 надо поменять на z уровня моря
и ходилку надо прикручивать =)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited