Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- http://computercraft.info/wiki/Rednet_%28API%29
- local botname = "Miner 01"
- local clientid = 23
- -- -------------------------
- -- init wireless
- ----------------------------
- bRedNet = rednet.open("right")
- bRedNet = rednet.open("left")
- local function sendCommand(sCommand)
- local count = 0
- local maxCount = 100
- local delay = 0
- for i=0,maxCount do
- rednet.send(clientid, sCommand)
- sleep(0.01)
- end
- end
- print("***************")
- print("* MineControl *")
- print("***************")
- print("Control for: "..botname)
- print("Available commands:")
- print("(h)ome")
- print("(t)erminate")
- print("")
- local valid = false
- while not valid do
- print("Please enter command:")
- bCommand = read()
- if bCommand == "h" or bCommand == "t" then
- valid = true
- end
- end
- if bCommand == "h" then
- sendCommand("home")
- else
- sendCommand("terminate")
- end
Advertisement
Add Comment
Please, Sign In to add comment