I have 5 brushes (script_mover) given a scriptname “axisfan” with an origin brush.
I also have made a button that calls a target_script_trigger also named “axisfan” that has a target of “switch”
The button works because the message is printed on the screen and the fan is running on start !
But it won’t stop …
I also have another problem with it … now someone can press the button and spam announce messages …
Can I disable it for about 3 seconds after it is switched ?
Here’s the script:
axisfan
{
spawn
{
accum 1 set 0 //0 = not running 1 = running
accum 2 set 0 //Did we just switch state (0 = no 1 = yes)
wait 100
trigger self start
accum 2 set 0
}
trigger stop
{
accum 2 abort_if_not_equal 0
accum 1 abort_if_not_equal 1
wm_announce "Stopping fan!"
stoprotation
accum 1 set 0
accum 2 set 1
}
trigger start
{
accum 2 abort_if_not_equal 0
accum 1 abort_if_not_equal 0
wm_announce "Starting fan!"
setrotation 300 0 0
accum 1 set 1
accum 2 set 1
}
trigger switch
{
trigger self start
trigger self stop
accum 2 set 0
}
}