Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rcmdlst = {
- [0] = "bmb",[79] = "place",[80] = "back",[81] = "ddn",[75] = "turnLeft",[76] = "tnl",
- [77] = "turnRight",[71] = "placeUp",[72] = "dfd",[73] = "dup",[82] = "placeDown",
- [83] = "drop",[74] = "refuel",[78] = "slct",[181] = "gpshst",[55] = "gpslct",[28] = "pckup",
- [210] = "place",[211] = "dig",[199] = "dropUp",[207] = "dropDown",[201] = "up",[209] = "down",
- [200] = "forward",[208] = "back",[203] = "turnLeft",[205] = "turnRight",[26] = "digUp",
- [27] = "digDown",[51] = "suckUp",[52] = "suckDown",[45] = "trmn8RC",
- }
- local cldt = {}
- function opnmdm()
- for i,v in pairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- if not rednet.isOpen(v) then rednet.open(v) end
- return true end
- end
- return false end
- shell.run('clear')
- if not opnmdm() then print("Modem Access Error") return false end
- repeat
- print("Enter confirmation password for remote turtle control")
- rednet.broadcast(io.read())
- cldt[1],cldt[2] = rednet.receive(2)
- if cldt[1] then print(cldt[1]..": "..cldt[2]) end
- until cldt[2] == "password accepted"
- print("Use numberpad to control turtleID"..cldt[1].."\n"..[[284693 for dig-moves, 5 to tunnel
- 170 to place[Up/Down]
- '.' Home End, to drop[Up/Down]
- Enter, <, >, to suck[Up/Down]
- Del, [, ] to dig [Up/Down] without moving
- Direction Keys and PgUp/Dn to move
- Press x to end Remote Control]])
- cldt[3] = false
- repeat
- cldt[4],cldt[5],cldt[6] = os.pullEvent()
- if cldt[4] == "key" and rcmdlst[cldt[5]] then rednet.broadcast(rcmdlst[cldt[5]])
- if cldt[5] == 45 then cldt[3] = true end
- elseif cldt[4] == "rednet_message" then print(cldt[5]..": "..cldt[6])
- if string.find(cldt[6],"^send") then rednet.send(cldt[5],io.read()) end
- elseif cldt[5] == "S" then write("Enter message> ") rednet.broadcast(io.read()) end
- until cldt[3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement