"What's a relay?"

Author Topic: "What's a relay?"  (Read 966 times)

A relay is a message that is sent either to brick touching it or a named brick.
Firerelaynorth etc. will NOT activate the onrelay input of a brick not touching it:

This is how it's done:
                                VVV   direction of brick

How we do this is Onactivate/self/firerelaynorth
And on the other brick: Onrelay/output blah blah blah

But don't fret! A brick can send a relay to a brick thats not anywhere near it!
Onactivate/NAMED BRICK(Brick01)/firerelay...
[WILL EDIT IN PICS LATER IMAGESHACK IS GIVING ME stuff]

And on the desired brick that will receive the relay (Brick01 in our case.)
Onrelay/ will make it receive the input! This is useful for buttons activating things far away and such.
Post you're common uses for relays here please.

I think relays can be used for loops, I could be wrong as I'm not sure how it's done.

I'm not a relay expert, but for loops, couldn't you just make the last brick in a sequence do this:
Onrelay - named brick (brick at start of sequence) - firerelaydirection?

I think relays can be used for loops, I could be wrong as I'm not sure how it's done.
Yep.
1:onactivate/relay
2:onactivate/enableevent/5/check
3:onrelay/decramentprintcount/1
4:onrelay/playsound/some terrorizing beep
5:1000delay/onrelay/relay
6:onprintcountunderflow/enableevent/5/unchecked
7:unprintcountunderflow/spawn explosion/tankshell/2

All targets being self, and the print brick being at 9.

For example would make a simple ticking time bomb that goes off 10 seconds after activating.