|
takke Beginner
Joined: 11 Oct 2002 Posts: 29 Location: Sweden
|
Posted: Wed Oct 30, 2002 2:56 pm
Anti Idle? |
Hi again
Now I need a antiidle device. When the varable is 1 I want my char to make a random command every 15 sec. how can I make this happend?
Ohh btw I need help on that autoress thingie I posted earlier today |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Wed Oct 30, 2002 5:12 pm |
#var msg "sigh|stretch|yawn|cough"
#var idle 0
#alarm plus15 {#if (@idle = 1) {%item(@msg,%random(1,5))}}
replace plus with a plus sign. you can change msg to a string list with any commands you might like to implement. btw isn't 15 seconds a little too short? and how do we print plus signs anyway? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Oct 30, 2002 5:51 pm |
That would be:
#alarm *15 {#if (@idle = 1) {%item(@msg,%random(1,4))}}
+ shows up on this forum with no problem, there's no need to spell it out. However, * is what's actually needed. + is used for temporary (one-time) alarms. *15 is used when you want something to happen every 15 seconds. I changed the random number since there's only four actions in the @msg example.
LightBulb
Senior Member |
|
|
|
takke Beginner
Joined: 11 Oct 2002 Posts: 29 Location: Sweden
|
Posted: Wed Oct 30, 2002 10:08 pm |
Thanks guys
|
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Thu Oct 31, 2002 5:23 am |
thanks for the catch lightbulb . i didnt test that expression at all...for %random i was going by the function wizard, which says:
quote:
Return a random integer >= I and < J.
which if i had looked carefully i would have seen didn't make sense, because it looks like J is set up as the first argument and I the second. this is version 6.36b btw.
+
oh, i suppose its the preview window that + doesn't appear in. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Oct 31, 2002 5:40 am |
That's a small but significant change from 6.16
quote: return a random integer >= I and <= J
Please bring this up on the beta forum, a lot of scripts will probably need rewriting if it's < J instead of <= J.
LightBulb
Senior Member |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Thu Oct 31, 2002 5:45 am |
actually, thats just what it says, it still works like before, <=
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Oct 31, 2002 1:24 pm |
Yes, that appears to be just a typo in the entry for the function wizard of the %random function.
Kjata |
|
|
|
|
|