Yoko
http://forum.yoko.com.ua/

Подскажите until ... or wait
http://forum.yoko.com.ua/viewtopic.php?f=20&t=15624
Page 1 of 1

Author:  GenDor [ 2010-03-03 16:42:49 ]
Post subject:  Подскажите until ... or wait

В теле скрипта присутствует
REPEAT
Wait(150)
Until UO.InJournal("You apply bandages to yourself") or wait(3500)

Т.е. я отслеживаю строку в жулнале, но хочу чтобы скрипт ждал ее не больше 3,5 секунд. В итоге скрипт ждет 3,5 секунды, а строчку в журнале не смотрит.
Подскажите, плз, что я не так сделал?

Спасибо!

Author:  Beyonder [ 2010-03-03 19:50:12 ]
Post subject:  Re: Подскажите until ... or wait

Самый простой вариант:

Code:
var timeLeft = 3000

repeat
    Wait(150)
    timeLeft = timeLeft - 150
until UO.InJournal("Message") or timeLeft <= 0

if (timeLeft <= 0) then
    UO.Print("Не дождались")
else
    UO.Print("Дождались")
endif

Author:  GenDor [ 2010-03-05 11:37:28 ]
Post subject:  Re: Подскажите until ... or wait

Beyonder wrote:
Самый простой вариант:

Code:
var timeLeft = 3000

repeat
    Wait(150)
    timeLeft = timeLeft - 150
until UO.InJournal("Message") or timeLeft <= 0

if (timeLeft <= 0) then
    UO.Print("Не дождались")
else
    UO.Print("Дождались")
endif


Туплю... -)

Спасибо!

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/