Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Make sure this program is named "startup"
- This program assumes your modem is on top of
- the computer block and that your bundled cable
- is hooked up to the back side of the computer.]]--
- -- Opening the wireless modem
- rednet.open( "top" )
- -- loop, waiting to receive from the other comp
- while true do
- local network, command = rednet.receive()
- -- Command for turning forcefield ON
- if command == "FF on" then
- -- waiting for a password to be sent from other comp
- verPass = false
- while not verPass do
- local network, password = rednet.receive()
- -- checking if pw is true
- if password == "yourPass" then
- -- telling other comp pw is correct, and turning on
- -- the forcefield.
- rednet.send( 1, "correct" )
- rs.setBundledOutput( "back", colors.red )
- os.sleep( 0.2 )
- rs.setBundledOutput( "back", 0 )
- verPass = true
- -- checking if pw is false
- elseif password ~= "yourPass" then
- -- telling other comp password is correct
- rednet.send( 1, "incorrect" )
- verPass = true
- end
- end
- -- command for turning the forcefield back off
- elseif command == "FF off" then
- rs.setBundledOutput( "back", colors.blue )
- os.sleep( 0.2 )
- rs.setBundledOutput( "back", 0 )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement