Relays are a default event that allow users to trigger events automatically.
Firing a Relay
To fire a relay, use this event:
 OnActivate => Self => FireRelay
This will fire a relay. By itself, this event is totally useless.
To make a brick change color using relays, use these events:
 OnActivate => Self => FireRelay  OnRelay => Self => SetColor [Red]
In this event string, the relay only serves to make changing colors needlessly complicated.
By now you will have noticed that delays are automatically added to any event that fires a relay. This is to prevent abuse.
This is the part that makes relays important. Look at this string of events.
 OnActivate => Self => FireRelay  OnRelay => Self => FireRelay  OnRelay => Self => SetColor [Red]  OnRelay => Self => SetColor [Blue]
As you can see, this would make an endless loop with a relay firing every two seconds, which would make the brick flash red and blue.