Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local port = 512
- local modem
- local commands ={
- [17] = {messageToRobot = "forward",
- text = "Forward"},
- [31] = {messageToRobot = "back",
- text = "Forward"},
- [30] = {messageToRobot = "turnLeft",
- text = "Forward"},
- [32] = {messageToRobot = "tureRight",
- text = "Forward"},
- [57] = {messageToRobot = "up",
- text = "Forward"},
- [42] = {messageToRobot = "down",
- text = "Forward"},
- [18] = {messageToRobot = "use",
- text = "Forward"},
- [19] = {messageToRobot = "redstone",
- text = "Forward"}
- }
- function init()
- if component.isAvailable("modem") then
- modem = component.modem
- modem.open(port)
- else
- print("wtf")
- return false
- end
- end
- function lets()
- while true do
- if modem.broadcast(port,commands[event.pull()].messageToRobot) then
- print(commands[event.pull()].text)
- else
- print("error")
- end
- end
- end
- if init() then
- print("WASD, E: use, R: redstone, SHIFT: down, SPACE: up")
- lets()
- else
- print("bb")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement