Incorrect User wrote:
И как это будет выглядеть? Например есть
Code:
repeat
uo.deletejournal(msg)
uo.waittargettile(-1, uo.getx() + x, uo.gety() + y, uo.getz())
uo.usetype("0x0E85")
waittime = uo.timer() + 100
wait(100)
until uo.dead() or uo.injournal(msg) or uo.timer() > waittime
until uo.injournal("too far away|no ore here|have no line|mining in rock")
А будет так что ли? В любом случае шило на мыло.
Code:
repeat
uo.deletejournal(msg)
uo.waittargettile(-1, uo.getx() + x, uo.gety() + y, uo.getz())
uo.usetype("0x0E85")
waittime = uo.timer() + 100
wait(100)
until uo.dead() or uo.injournal(msg) or uo.timer() > waittime
until FoundedParamId == 2 or FoundedParamId == 6 or FoundedParamId == 10
FoundedParamID пригодится, если надо обрабатывать сообщения отдельно, например:
Сейчас:
Code:
UO.DeleteJournal('Text1|Text2|Text3')
UO.WaitingForJournalText(1000, 'Text1|Text2|Text3')
if UO.InJournal('Text1') then
. . .
end if
if UO.InJournal('Text2') then
. . .
end if
if UO.InJournal('Text3') then
. . .
end ifприходится чистить журнал от сообщений, а так же каждый раз делать поиск по журналу UO.InJournal()
С FoundedParamID:
Code:
UO.WaitingForJournalText(1000, 'Text1|Text2|Text3')
if UO.FoundedParamID() == 0 then
. . .
end if
if UO.FoundedParamID() == 1 then
. . .
end if
if UO.FoundedParamID() == 2 then
. . .
end if
поиск в журнале происходит 1 раз
Если прикрутить еще и case, то:
Code:
UO.WaitingForJournalText(1000, 'Text1|Text2|Text3')
switch UO.FoundedParamID()
case 0:
. . .
case 1:
. . .
case 2:
. . .
end