Author Topic: onRelay  (Read 562 times)

How do you use it?

I know it's a loop...

but how do I use it?

You would do:

input event here -> Self -> fireRelay

onRelay -> Self -> fireRelay

And for the action you want to repeat, use OnRelay as well

NOEDIT:

If you wanted to do a loop:

input event here -> Self -> fireRelay

onRelay -> Self -> fireRelay

To fire a relay to a brick far away:

input event here -> <NAMED BRICK> -> fireRelay

To fire a relay to a brick right next to the brick you evented:

input event here -> Self -> fireRelayUp/Down/North/South/East/West

To use a relay, wrench the brick you sent the relay to, then:

onRelay -> Self/<NAMED BRICK> -> output event here



FireRelay[dir] is a good way of getting around naming bricks, however the bricks have to be adjacent(touching)
Ex

   N
E + W
   S
____   ____
| 1  |  |  2   |
|___|  |___|   ...

brick 1: NAME=first
0    onActivate->self->fireRelayWest
0    onRelay->self->fireRelayWest

brick 2:
500 onRelay->self->fireRelayWest
0     onRelay->self->setColor [blue ]
500 onRelay->self->setColor [white ]

brick 3,4 ,5,....
see brick 2

last brick
500 onRelay->namedbrick[first]->fireRelay
0     onRelay->self->setColor [blue ]
500 onRelay->self->setColor [white ]


what it does:
when you click on brick 1 it makes the next brick change color to blue then back to white making it appear that a white brick was moving down the length of the brick line. Then once the "white brick" reaches the end the cycle starts over.

A lot easier than naming each brick, eh?
What is event better is with the firerelay[dir] you can just move the last brick down and add more middle bricks in between. so only the first and last bricks are different and only the first brick has a name.

P.S. apperently [color] changes the color in the forums

[red ] with no space
[black ]
who knew?

P.S. apperently [color] changes the color in the forums

[red ] with no space
[black ]
who knew?
Me Knew that you can change the color