Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require "component"
- modem = component.modem
- event = require "event"
- modem.open(8268)
- while true do
- print("Input Command: ")
- command = string.lower(io.read())
- if command == "forward" then
- modem.broadcast(8267, "Forward")
- elseif command == "turn left" then
- modem.broadcast(8267, "Turn Left")
- elseif command == "turn right" then
- modem.broadcast(8267, "Turn Right")
- elseif command == "backward" then
- modem.broadcast(8267, "Backward")
- elseif command == "exit" then os.exit()
- elseif command == "swing" then
- modem.broadcast(8267, "Swing")
- elseif command == "swing up" then
- modem.broadcast(8267, "Swing Up")
- elseif command == "swing down" then
- modem.broadcast(8267, "Swing Down")
- elseif command == "equip" then
- modem.broadcast(8267, "Equip")
- elseif command == "place" then
- modem.broadcast(8267, "Place")
- elseif command == "up" then
- modem.broadcast(8267, "Up")
- elseif command == "down" then
- modem.broadcast(8267, "Down")
- end
- local _, _, from, port, _, message = event.pull("modem_message")
- print("Error message from "..from..": "..message)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement