Yoko

All sides of Injection
It is currently 2026-02-16 14:40:09

All times are UTC+02:00




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
PostPosted: 2005-01-14 04:56:57 
Offline
User avatar

Joined: 2004-11-26 16:43:57
Posts: 12
Location: Королёв М.О.
Вот скрипт на майнинг (Переделанный Шахтёр 2.3 с рунбуков на руны)
Проблемма в том, что когда чар доходит до последней рунки
if NRuna>6 then
NRuna=1
вылетает ошибка "Unhandled error in parser" (вроде так)

Помогите плиз найти ошибку, если не сложно.

Вот скрипт:
Code:
Var DRuna='0x406FF2E9' ; АЙДИ рунки домой 
Var NRuna=1
Var UnloadCont='0x402FFA68' ; АЙДИ сундука для руды

sub maning()
var mx, my, mz, i, j, jor, ser, noto
DIM MRuna[5] ; Массив из АЙДИ рунок в шахты
MRuna[1]='0x40B3734E'
MRuna[2]='0x40B3734A'
MRuna[3]='0x40B378B5'
MRuna[4]='0x40B378B3'
MRuna[5]='0x40B3734D'

uo.print('!!SELECT PICKAXE!! ')
uo.exec('addobject Shovel')
while uo.targeting()
wait(100)
wend

na4alo:
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("Hiding...")
UO.UseSkill("Hiding")
wait(4000)
wend
UO.Print("Mining in: "+str(mx-i)+" "+str(my-j))
infologs()
while not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock")
##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("Iron Ore")
UO.DeleteJournal()
if uo.waiting() then
uo.canceltarget()
endif
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Useobject("Shovel")
while not UO.InJournal("You put") and not UO.InJournal("heavy") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait (500)
if uo.injournal("heavy") then
##Pause()
endif
if uo.dead() then
##Pause()
endif
for jor = 0 to 9   
ser = uo.journalserial(jor)
noto = uo.getnotoriety(ser)

if noto <> 1 and noto <> 0 and not uo.injournal("elemental") then
if uo.waiting() then
uo.canceltarget()
endif
goto end
endif


next   
wend
if uo.weight > 550 then  ; Максимальный вес при котором домой с рудой
goto end
endif
wend
UO.DeleteJournal()
next
next
end:
if uo.waiting() then
uo.canceltarget()
endif
RecallRune(DRuna)
wait(5000)
while not UO.Hidden()
UO.Warmode("0")
uo.print("Hiding...")
UO.UseSkill("Hiding")
wait(4000)
wend
loot()


UO.SetReceivingContainer(UnloadCont)
Wait(100)
UO.Grab('0',MRuna[NRuna])
Wait(1000)
NRuna=NRuna+1
if NRuna>6 then
NRuna=1
endif
UO.UnSetReceivingContainer()
uo.useobject(UnloadCont)
Wait(100)
UO.Grab('0',MRuna[NRuna])
GetRegy()
wait(1000)
reccal:
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
endif
RecallRune(MRuna[NRuna])
wait(5000)
goto na4alo
end sub

sub GetRegy()
if uo.count('0x0F7B')<10 then
uo.FindType('0x0F7B',-1,UnloadCont) ;Blood Moss
wait(100)
uo.Grab('10','finditem')
wait(500)
end if
if uo.count('0x0F86')<10 then
uo.FindType('0x0F86',-1,UnloadCont) ;Mandrake Roots
wait(100)
uo.Grab('10','finditem')
wait(500)
end if
if uo.count('0x0F8D')<5 then
uo.FindType('0x0F8D',-1,UnloadCont) ;Spider's Silk
wait(100)
uo.Grab('5','finditem')
wait(500)
end if
if uo.count('0x0F7A')<5 then
uo.FindType('0x0F7A',-1,UnloadCont) ;Black Pearls
wait(100)
uo.Grab('5','finditem')
wait(500)
end if
end sub

sub loot()    ; перекладка руды в сундук
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
DIM Ore[20]
Ore[0]=0x19B9 ; 4 and more ore
Ore[1]=0x19B7 ; 1 ore
Ore[2]=0x19BA ; 2 ore
Ore[3]=0x19B8 ; 3 ore
Ore[4]=0x0F11 ; saphires
Ore[5]=0x0F16 ; amethysts
Ore[6]=0x0F18 ; tourmalines
Ore[7]=0x0F15 ; citrines
Ore[8]=0x0F10 ; emeralds
Ore[9]=0x0F0F ; star sapphires
Ore[10]=0x0F26 ; diamonds
Ore[11]=0x1F4C ; recall scrolls
Ore[12]=0x0EED ; gold
Ore[13]=0x0F20 ; tourmaline
UO.SetReceivingContainer(UnloadCont)
wait(500)
For a=0 to 13
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()
end sub

sub RecallRune(rn) ; Рекол по рункам
var mx, my
reccal:
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
endif
mx = UO.GetX("self")
my = UO.GetY("self")
UO.DeleteJournal()
UO.Cast('Recall',rn)
wait(4000)
if not UO.GetX("self") <> mx and not UO.GetY("self") <> my then
goto reccal
endif
end sub

sub pwav() ; звук при выкапывании ЭЛЕМЕНТАЛА 
uo.playwav("C:\WINDOWS\Media\ding.wav")
endsub

sub pwavw(); звук при появлении ПК
uo.playwav("C:\WINDOWS\Media\ding.wav")
endsub

sub infologs()
UO.Print('You have '+Str(UO.Count('0x19B7')+UO.Count('0x19B8')+UO.Count('0x19B9')+UO.Count('0x19BA'))+' ore in backpack')
UO.Print('It's '+Str(UO.Count('0x19B7','0x0000')+UO.Count('0x19B8','0x0000')+UO.Count('0x19B9','0x0000')+UO.Count('0x19BA','0x0000'))+' айрон и ' +str(UO.Count('0x19B7')+UO.Count('0x19B8')+UO.Count('0x19B9')+UO.Count('0x19BA')-(UO.Count('0x19B7','0x0000')+UO.Count('0x19B8','0x0000')+UO.Count('0x19B9','0x0000')+UO.Count('0x19BA','0x0000')))+' colored ore')
end sub


Top
   
 Post subject:
PostPosted: 2005-01-14 06:57:38 
Offline
Junior Expert
User avatar

Joined: 2004-11-13 00:43:55
Posts: 474
Location: Киберзадроцк
Зачем ты написал MRuna[NRuna] ешё и в ковычках??? попробуй просто без ковычек один раз написать RecallRune(MRuna)


Top
   
 Post subject:
PostPosted: 2005-01-14 10:46:07 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
Индексы массивов начинаются с 0. Т.е. если ты объявил массив как
Code:
DIM MRuna[5]

то использовать можно элементы от MRuna[0] до MRuna[4]


Top
   
 Post subject:
PostPosted: 2005-01-14 10:50:54 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
Во блин !!!
Увеличь размерность массива просто !!!
У меня почему-то работает и так !!!
тем более что у тебя рунок 5 а проверяешь ты на 6
Поставь проверку на 5 уж тада

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-01-14 10:54:01 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
AlexeyVorotnikov wrote:
Индексы массивов начинаются с 0. Т.е. если ты объявил массив как
Code:
DIM MRuna[5]

то использовать можно элементы от MRuna[0] до MRuna[4]

Использовать можно с 0 до 5 !!! То есть 6 элементов массива !!!

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-01-14 11:01:27 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
666Man666 wrote:
Зачем ты написал MRuna[NRuna] ешё и в ковычках??? попробуй просто без ковычек один раз написать RecallRune(MRuna)

Это обращение к элементу массива, так и должно быть !!!

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-01-14 11:10:22 
Offline
Junior Expert
User avatar

Joined: 2004-11-13 00:43:55
Posts: 474
Location: Киберзадроцк
Асканели харош флудить...


Top
   
 Post subject:
PostPosted: 2005-01-14 11:56:50 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
666Man666 wrote:
Асканели харош флудить...

Блин , приятно коментировать свою модификацию скрипта !!!

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-01-14 12:05:28 
Offline
Expert!
User avatar

Joined: 2004-04-04 21:40:09
Posts: 1007
666Man666 wrote:
Асканели харош флудить...


А у него постов меньше чем у тебя. :roll: :mrgreen:


Top
   
 Post subject:
PostPosted: 2005-01-14 14:04:49 
Offline
User avatar

Joined: 2004-11-26 16:43:57
Posts: 12
Location: Королёв М.О.
AlexeyVorotnikov wrote:
Индексы массивов начинаются с 0. Т.е. если ты объявил массив как
Code:
DIM MRuna[5]

то использовать можно элементы от MRuna[0] до MRuna[4]


Сделал так, заработало! :)


Top
   
 Post subject:
PostPosted: 2005-01-14 14:40:38 
Offline
Sphere expert
User avatar

Joined: 2004-10-01 08:27:38
Posts: 1143
Location: Уфа
AGRS wrote:
666Man666 wrote:
Асканели харош флудить...


А у него постов меньше чем у тебя. :roll: :mrgreen:

Да !!! Обидно даже !!!

_________________
Сделал дело - флуди смело !!!


Top
   
 Post subject:
PostPosted: 2005-02-06 19:42:41 
Offline

Joined: 2004-11-21 21:45:20
Posts: 30
[ quote=&quot;.AlexeyVorotnikov&quot;]Indeksy massifs they
begin with 0. I.e. if you declared massif as [ code].DIM
MRuna[5][/.code ] that to use it is possible elements from MRuna[0 ]
to MRuna[4][/.quote ]

I don't understand this, i always have thought, that i.e. DIM[5], can be used elements from 1 to 5, and not from 0 to 4, can anyone confirm that?


Top
   
 Post subject:
PostPosted: 2005-02-06 21:45:01 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
Arsys wrote:
[ quote=&quot;.AlexeyVorotnikov&quot;]Indeksy massifs they
begin with 0. I.e. if you declared massif as [ code].DIM
MRuna[5][/.code ] that to use it is possible elements from MRuna[0 ]
to MRuna[4][/.quote ]

I don't understand this, i always have thought, that i.e. DIM[5], can be used elements from 1 to 5, and not from 0 to 4, can anyone confirm that?

In such languages as C and Java array indexes start from 0 and finish at array length - 1. Besause I write programs in Java on the hole, I tought that in Injection script its behave in the same way. But actually in Injection script if You declare array as DIM arr[5], You can use indexes from 0 to 5.

PS: sorry for my bad English.


Top
   
 Post subject:
PostPosted: 2005-02-11 15:45:47 
Offline

Joined: 2004-11-30 22:52:17
Posts: 8
слущайтк а это на какую шахту ?? просто чуть со стула не упал когда такой скрипт увидел ))


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 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Limited