CubeScript : problem with sleep
#1
Hi everyone,

Do you know why

/sleep 1000 [say "hi"]

works, and why

/sleep 1000 [jump]

doesn't ?

Baruch
Thanks given by:
#2
you have to bind it I think. It doesn't work to avoid some scripts (not sure). It's not perfect btw (see the hax jump bind)
Thanks given by:
#3
Nope doesn't work either with bind.
Thanks given by:
#4
yeah I mean
bind SPACE [jump]
will work but
bind MOUSE1 [attack;jump; sleep 1000 [jump]]
wont

dunno ask 888 :p
Thanks given by:
#5
Yes, it seems sleep doesn't take movement instructions as arguments.
Thanks given by:
#6
(18 Feb 13, 06:19PM)Ashxelor Wrote: Yes, it seems sleep doesn't take movement instructions as arguments.

Rather, some functions explicitly check to see if their associated key is pressed or not.
Thanks given by:
#7
Movement functions will only work when used in a bind. There is more complexity to this, but its about right.
Thanks given by:
#8
give that script an ambien!
Thanks given by:
#9
Felix and Ronald_Reagan are right, movement functions/weapon switches/etc. only work when used with a keybind. So if you put any of those into a sleep (even if the sleep itself is keybound) it won't work.

Ex:

[cubescript]bind W [sleep 0 forward] // not gonna work with vanilla clients
bind W forward // should work fine

bind J [weapon 1; onrelease [weapon (currentprimary)]] // switches to pistol fine, but never switches back to primary onrelease[/cubescript]

Movement functions/weapon switches and such must be executed as the result of pressing a keybind to work. (i.e. instantaneously) By putting them into a sleep/onrelease it breaks that "rule".
Thanks given by:
#10
(18 Feb 13, 11:35PM)Vermi Wrote: give that script an ambien!
Thanks given by: