Author Topic: Help with events?  (Read 484 times)

How do I make it so if I click say... a remote control once, the TV turns on, and if I click it again, it goes off? What events do I put in to do so?

Appreciated if helped  :cookieMonster:

List of events to turn TV on

List of events to turn TV off, with events all disabled (unchecked)

OnActivate self toggleEventEnabled (List all event numbers except this one)


Let's say you had a lightbulb with a nomal red brick to turn it off and on (without anything JVS)

List of events to turn light on would be
Event turned on: 0
  • onActivate <NAMEDBRICK> lightbulb setLight somelighthere

List of events to turn lightbulb off would be
Event turned off: 1
  • onActivate <NAMEDBRICK> lightbulb setLight NONE

then
Event turned on: 2
  • onActivate Self ToggleEventEnabled 0 1


Which would look like this:

onActivate   lightbulb   setLight   Somelighthere   <this is event number 0, and it should be checked because it turns the light on.
onActivate   lightbulb   setLight   NONE   <this is event number 1, and it should be turned off because it turns the light off.
onActivate   Self   toggleEventEnabled   0 1   <this is the toggle event, since we're using events from 0-1 we list the individual numbers from 0 to 1.

ToggleEventEnabled turns off events that are on, and turns on events that are off.


Let's say you had a lightbulb with a nomal red brick to turn it off and on (without anything JVS)

List of events to turn light on would be
Event turned on: 0 [ 0 ] onActivate <NAMEDBRICK> lightbulb setLight somelighthere
List of events to turn lightbulb off would be
Event turned off: 1 [ 0 ] onActivate <NAMEDBRICK> lightbulb setLight NONE
then
Event turned on: 2 [ 0 ] onActivate Self ToggleEventEnabled 0 1

Which would look like this:

onActivate   lightbulb   setLight   Somelighthere   <this is event number 0, and it should be checked because it turns the light on.
onActivate   lightbulb   setLight   NONE   <this is event number 1, and it should be turned off because it turns the light off.
onActivate   Self   toggleEventEnabled   0 1   <this is the toggle event, since we're using events from 0-1 we list the individual numbers from 0 to 1.

ToggleEventEnabled turns off events that are on, and turns on events that are off.



Ugh stupid bullet tags.