Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- robot config https://cdn.discordapp.com/attachments/358433226290626564/959698093421518868/unknown.png
- -- added a tier 2 wireless card in the one available slot
- local event = require("event")
- local component = require("component")
- local os = require("os")
- local term = require("term")
- local robot = require("robot")
- local modem = component.modem
- local posX = 0
- local posY = 0
- local posZ = 0
- local vector = "north"
- local message = " "
- local robotBusy = 0
- local variables = {}
- function modemListen()
- modem.open(5)
- _, _, from, port, _, msg = event.pull(0.001, "modem_message")
- if msg ~= nil then
- message = msg
- else
- message = " "
- end
- end
- function listenForCommands()
- if message == "robotTurnLeft" then
- robot.turnLeft()
- end
- if message == "robotTurnRight" then
- robot.turnRight()
- end
- if message == "robotGoForward" then
- robot.forward()
- end
- if message == "robotGoBack" then
- robot.back()
- end
- if message == "robotGoUp" then
- robot.up()
- end
- if message == "robotGoDown" then
- robot.down()
- end
- end
- function sendMsgToComputer (msg)
- modem.open(5)
- modem.broadcast(5, tostring(msg))
- modem.close(5)
- end
- while true do
- modemListen()
- listenForCommands()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement