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

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
pivovar
Posts: 57
Joined: 2004-09-05 10:41:06

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

Post 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
то он отменял запрос , можно ли исправить мою мазню?
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post 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
pivovar
Posts: 57
Joined: 2004-09-05 10:41:06

Post 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



в твоей строке ошибку даёт.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

ты забыл EndIf
pivovar
Posts: 57
Joined: 2004-09-05 10:41:06

Post 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


тоесть тогда так , но ошибка всеравно вылазиет
в твоей строке.
pivovar
Posts: 57
Joined: 2004-09-05 10:41:06

Post by pivovar »

я думаю там ошибка if uo.hp<uo.str чтото наверно не правильно
может лучше сделать так
if uo.hp<170хелпоинтов , токо я хз как это написать ?!
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

А вообще-то нет такой функции, как UO.HP
Используй UO.Life
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post by Beyonder »

И еще:
Было:

Code: Select all

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

Нужно:

Code: Select all

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

Это так как в предложении апостроф.
I'm
Expert!
Posts: 1396
Joined: 2004-10-15 22:38:04
Location: Moscow City.
Contact:

Post by I'm »

Вот почему я почти вседа юзаю двойные ковычки :lol:
pivovar
Posts: 57
Joined: 2004-09-05 10:41:06

Post by pivovar »

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