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

Телепорт столб , проблема с оператором if
http://forum.yoko.com.ua/viewtopic.php?f=20&t=4457
Page 1 of 1

Author:  pivovar [ 2005-07-08 13:36:11 ]
Post subject:  Телепорт столб , проблема с оператором if

Code:
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
то он отменял запрос , можно ли исправить мою мазню?

Author:  flake [ 2005-07-08 13:57:34 ]
Post subject: 

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


Измени на

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

Author:  pivovar [ 2005-07-08 14:01:04 ]
Post subject: 

всеравно ошибку выдаёт там получилось так

Code:
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



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

Author:  flake [ 2005-07-08 14:04:08 ]
Post subject: 

ты забыл EndIf

Author:  pivovar [ 2005-07-08 14:06:35 ]
Post subject: 

Code:
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


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

Author:  pivovar [ 2005-07-08 14:08:03 ]
Post subject: 

я думаю там ошибка if uo.hp<uo.str чтото наверно не правильно
может лучше сделать так
if uo.hp<170хелпоинтов , токо я хз как это написать ?!

Author:  flake [ 2005-07-08 14:52:33 ]
Post subject: 

А вообще-то нет такой функции, как UO.HP
Используй UO.Life

Author:  Beyonder [ 2005-07-11 07:18:49 ]
Post subject: 

И еще:
Было:
Code:
('You can't do it in current state!')

Нужно:
Code:
("You can't do it in current state!")

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

Author:  I'm [ 2005-07-12 01:14:40 ]
Post subject: 

Вот почему я почти вседа юзаю двойные ковычки :lol:

Author:  pivovar [ 2005-07-12 08:09:43 ]
Post subject: 

только всеравно не помогло :(

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