помогите начинающему

Ask for help

Moderators: Murderator+, Murderator

Post Reply
apollo440xtz
Posts: 1
Joined: 2004-04-19 01:50:19
Contact:

помогите начинающему

Post by apollo440xtz »

вот что я наваял:

Code: Select all

sub shahta ()
var i=0
while UO.Life > (40)
if UO.InJournal("idu v shahtu") then
UO.DeleteJournal()
i=i+1
endif

if UO.InJournal("proba!!!!") and i==1 then
UO.DeleteJournal()
goto start1
endif

if UO.InJournal("proba!!!!") and i==2 then
UO.DeleteJournal()
goto start2
endif

if UO.InJournal("proba!!!!") and i==3 then
UO.DeleteJournal()
goto start3
endif

if UO.InJournal("proba!!!!") and i==4 then
UO.DeleteJournal()
goto start4
endif
wend

start1:
UO.Exec("cast Recall 0x40008AEB")
wait(3500)
if UO.InJournal("the spell fizzles") then
wait (500)
goto start1
UO.DeleteJournal()
endif

start2:
UO.Exec("cast Recall 0x40008AFC")
wait(3500)
if UO.InJournal("the spell fizzles") then
wait (500)
goto start2
UO.DeleteJournal()
endif

start3:
UO.Exec("cast Recall 0x400074BA")
wait(3500)
if UO.InJournal("the spell fizzles") then
wait (500)
goto start3
UO.DeleteJournal()
endif

start4:
UO.Exec("cast Recall 0x400013B2")
wait(3500)
if UO.InJournal("the spell fizzles") then
wait (500)
goto start4
UO.DeleteJournal()
i=0
endif

end sub

но у меня чар реколится по всем 4 рунам вместо того что бы остановится на какойто одной и ждать очередного появления в журнале данной фразы
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

логика у тебя какаято корявая
ну пошёл ты на start1 а выхода от туда нет. после старт1 идёт старт2 и так далее до конца всей процедуры.

ну и язык бедноват. почитай хотя бы scripting.txt а ещё лучше документацию к языку Бейсик.

заметь так же что ты в IF-ах поставил очистку журнала после GOTO в результате чего её никогда не произойдёт.

ещё и после обрыва цикла он начнёт по всем подряд рунам бегать.

короче скрипт писался бездумно.

вот кусок переписал но только для того чтобы ты посмотрел внимательно, понял где ты не прав и написал по-своему.

Code: Select all

sub recallme(rune)
  start1:
  UO.DeleteJournal()
  UO.Exec("cast Recall "+rune)
  wait(3500)
  if UO.InJournal("the spell fizzles") then
    goto start1
  endif
end sub

sub shahta ()
DIM runes[10]
runes[1]="0x40008AEB"
runes[2]="0x40008AFC"
runes....

var i=0
while UO.Life > 40
if UO.InJournal("idu v shahtu") then
UO.DeleteJournal()
i=i+1
endif

if UO.InJournal("proba!!!!") then
 recallme(runes[i])
endif
wend

 recallme(runes[1])

end sub
Post Reply