Code:
...
if(key is pressed(key:0)) then(
### Turns hallucinate0 on/off
if (check tag (17) == off) then(
set tag (17, on)
RGBConstraint := 100
Red0 := 0
Blue0 := 0
Green0 := 0
hallucinate0
) else (
set tag (17, off)
hallucinate0Reset
)
)
...
...
if(key is pressed(key:0)) then(
### Turns hallucinate0 on/off
if (check tag (17) == off) then(
set tag (17, on)
RGBConstraint := 100
Red0 := 0
Blue0 := 0
Green0 := 0
hallucinate0
) else (
set tag (17, off)
hallucinate0Reset
)
)
...
The hallucinate0 code is:
Code:
script, hallucinate0, begin
If (RGBConstraint <95> 105) then(
set tag (16, off)
)
If (check tag (16) == true) then(
increment (Red0, 0)
increment (Green0, 0)
increment (Blue0, 1)
increment (RGBConstraint, 1)
) else (
decrement (Red0, 0)
decrement (Green0, 0)
decrement (Blue0, 1)
decrement (RGBConstraint, 1)
)
reset palette
tweak palette (Red0, Green0, Blue0)
update palette
# Repeat this script again in 1 tick without blocking other scripts
set timer(1, 0, 1, @hallucinate0, 0, (timerflag: menu))
end
script, hallucinate0, begin
If (RGBConstraint <95> 105) then(
set tag (16, off)
)
If (check tag (16) == true) then(
increment (Red0, 0)
increment (Green0, 0)
increment (Blue0, 1)
increment (RGBConstraint, 1)
) else (
decrement (Red0, 0)
decrement (Green0, 0)
decrement (Blue0, 1)
decrement (RGBConstraint, 1)
)
reset palette
tweak palette (Red0, Green0, Blue0)
update palette
# Repeat this script again in 1 tick without blocking other scripts
set timer(1, 0, 1, @hallucinate0, 0, (timerflag: menu))
end
And the hallucinate0Reset code is:
Code:
script, hallucinate0Reset, begin
stop timer (1)
reset palette
#suspend timers
end
script, hallucinate0Reset, begin
stop timer (1)
reset palette
#suspend timers
end
I don't think there is a problem with my on/off button since it seemed to work when I used "suspend timers" in place of "stop timer(1)," but I can't use that feature since it suspends all timers.
Is there something I'm not understanding about "stop timer," or is there some other reason that it may not be working?
Thanks, I'm sorry for the sudden swell of questions I've been asking in the past few day... guess it means I'm active on my game though.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases



