Page 1 of 1

Need help for a command

Posted: 2009-03-01 11:42:19
by tippmann
Hi everybody,
i need a little bit of help for something.

In this exemple:

repeat

if uo.warmode() == uo.warmode(true) then
uo.warmode(false)
endif

UO.useskill('Meditation')
wait(800)

until HERE

I need a command who will be true on a keypress.
exemple: until key press "space"

i want to use a key to interrupt a loop in my script by pressing a key ingame. Thank you

another script exemple:

While not key press "space"
wait(1000)
wend

Posted: 2009-03-02 12:05:56
by Yavanna Kementari
well I'm using global variables to solve such problems... you can use client macro such as:
say ',exec releaseScript'

and having a function

Code: Select all

sub releaseLoop()
UO.SetGlobal("releaseLoop",STR(not VAL(UO.GetGlobal("releaseLoop"))))
UO.Print("releaseLoop: "+UO.GetGlobal("releaseLoop"))
end sub


in a loop, you'll have:

Code: Select all

repeat
...whatever...
until VAL(UO.GetGlobal("releaseLoop")) == 1
UO.SetGlobal("releaseLoop","0")