Can anyone tell me how to make my own blocks? I know how to do the shift-click-r thing, but i want the code for an online/offline sensor.

Offline
For an online/offline sensor (yes I know I've talked to you about this on that project), just use an Obsolete Block.
In the "Other Obsolete Blocks" section of that article (the one I linked to), are details on how to get an obsolete block, and in another section, how to use an obsolete block to make an offline/online sensor...

Offline