Page 1 of 1

Телепорт столб , проблема с оператором if

Posted: 2005-07-08 13:36:11
by pivovar

Code: Select all

sub Portal()
UO.exec("warmode 0")
var portal='0x1183'
uo.usefromground(portal)
 if uo.hp<uo.str or uo.injournal('No item found','You can't do it in current state!')
 then
  return
UO.Print('5')
wait (1000)
UO.Print('4')
wait (1000)
UO.Print('3')
wait (1000)
UO.Print('2')
wait (1000)
UO.Print('1')
wait (1000)
UO.Print('GO')
UO.exec("warmode 0")
wait (1000)
UO.exec("warmode 0")
end sub


Вот я тут накуралесил основная задача в том , чтобы Есле lastmsg =
You can't do it in current state! или No item found
то он отменял запрос , можно ли исправить мою мазню?

Posted: 2005-07-08 13:57:34
by flake

Code: Select all

if uo.hp<uo.str or uo.injournal('No item found','You can't do it in current state!') 
 then


Измени на

Code: Select all

if uo.hp<uo.str or uo.injournal('No item found')  OR UO.InJournal('You can't do it in current state!')  then

Posted: 2005-07-08 14:01:04
by pivovar
всеравно ошибку выдаёт там получилось так

Code: Select all

sub Portal()
UO.exec("warmode 0")
var portal='0x1183'
uo.usefromground(portal)
if uo.hp<uo.str or uo.injournal('No item found')  OR UO.InJournal('You can't do it in current state!')
 then
return
UO.Print('5')
wait (1000)
UO.Print('4')
wait (1000)
UO.Print('3')
wait (1000)
UO.Print('2')
wait (1000)
UO.Print('1')
wait (1000)
UO.Print('GO')
UO.exec("warmode 0")
wait (1000)
UO.exec("warmode 0")
end sub



в твоей строке ошибку даёт.

Posted: 2005-07-08 14:04:08
by flake
ты забыл EndIf

Posted: 2005-07-08 14:06:35
by pivovar

Code: Select all

sub Portal() 
UO.exec("warmode 0")
var portal='0x1183'
uo.usefromground(portal)
if uo.hp<uo.str or uo.injournal('No item found')  OR UO.InJournal('You can't do it in current state!')
 then
return
endif
UO.Print('5')
wait (1000)
UO.Print('4')
wait (1000)
UO.Print('3')
wait (1000)
UO.Print('2')
wait (1000)
UO.Print('1')
wait (1000)
UO.Print('GO')
UO.exec("warmode 0")
wait (1000)
UO.exec("warmode 0")
end sub


тоесть тогда так , но ошибка всеравно вылазиет
в твоей строке.

Posted: 2005-07-08 14:08:03
by pivovar
я думаю там ошибка if uo.hp<uo.str чтото наверно не правильно
может лучше сделать так
if uo.hp<170хелпоинтов , токо я хз как это написать ?!

Posted: 2005-07-08 14:52:33
by flake
А вообще-то нет такой функции, как UO.HP
Используй UO.Life

Posted: 2005-07-11 07:18:49
by Beyonder
И еще:
Было:

Code: Select all

('You can't do it in current state!')

Нужно:

Code: Select all

("You can't do it in current state!")

Это так как в предложении апостроф.

Posted: 2005-07-12 01:14:40
by I'm
Вот почему я почти вседа юзаю двойные ковычки :lol:

Posted: 2005-07-12 08:09:43
by pivovar
только всеравно не помогло :(