Stand by script

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
lixo
Posts: 9
Joined: 2004-05-08 00:34:20

Stand by script

Post by lixo »

I have tried many times to make my script stay in "stand by". When a certain phrase appears in the journal, my character should do an action.

ex: with the script already running, if i say $, my char casts in lor on me
Lord Ruslan Nightmare
Expert!
Posts: 359
Joined: 2004-04-25 11:11:07
Contact:

Post by Lord Ruslan Nightmare »

Code: Select all

uo.deletejournal()
while 1
  var cmd = " cast on me " #syntax - <name> cast on me <spell>
  var index = uo.injournal(cmd)
  var s = uo.journal(index)
  var myname = uo.getname()
  if index and index == uo.injournal(myname) then
    uo.waittargetobject(uo.journalserial(index))
    uo.exec("cast " +right(s,len(s)-len(myname)-len(cmd)))
    wait(3000)
  endif
  wait(50)
wend
Last edited by Lord Ruslan Nightmare on 2004-06-18 08:10:34, edited 1 time in total.
Без труда не выловишь и рыбку из пруда,
А без пруда не выловишь её и с трудом...
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

wait(50) after while or before wend, elsewhere script will cause lags (empty cycle)
Post Reply