Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rcTable = {[17] = "RCF", [50] = "RCMF", [200] = "RCGF", [28] = "RCPF", [57] = "RCAF", [31] = "RCB", [30] = "RCL", [32] = "RCR", [44] = "RCRF", [19] = "RCU", [20] = "RCMU", [21] = "RCGU", [22] = "RCPU", [45] = "RCAU", [33] = "RCD", [34] = "RCMD", [35] = "RCGD", [36] = "RCPD", [46] = "RCAD", [2] = "RC1", [3] = "RC2", [4] = "RC3", [5] = "RC4", [6] = "RC5", [7] = "RC6", [8] = "RC7", [9] = "RC8"}
- --(Add): Redstone pulse, Redstone toggle, Drop item, Suck items
- function RCTC()
- termReset()
- print("Remote Controlled Turtles Controller initiating...")
- sleep(1)
- termReset()
- print("Remote Controlled Turtles Controller initiated, enjoy!")
- controls()
- while true do
- parallel.waitForAny(send, recv)
- end
- end
- function send()
- local sEvent, par = os.pullEvent("key")
- for k, v in pairs(rcTable) do
- if(sEvent == "key") then
- rednet.broadcast(rcTable[par])
- else
- termReset()
- print("Error: Invalid key!")
- controls()
- end
- end
- end
- function recv()
- local scrap, msg = rednet.receive()
- if msg == "RFNF" then
- termReset()
- print("No Fuel in slot 16!")
- controls()
- elseif msg == "RFF" then
- termReset()
- print("Turtle has plenty of fuel! :D")
- controls()
- elseif msg == "RFNV" then
- termReset()
- print("Item in slot 16 is not valid fuel!")
- controls()
- elseif msg == "RFS" then
- termReset()
- print("Refuel successful!")
- controls()
- end
- end
- function controls()
- sleep(1)
- termReset()
- if pocket then --This part revamped for PDA's by Aus4000
- print[[
- RCT
- Controls:
- +------------------+
- |Action|F|B|L|R|U|D|
- +------+-+-+-+-+-+-|
- |Go/Trn|W|S|A|D|R|F|
- |Mine |M|#|#|#|T|G|
- |GoMine|^|#|#|#|Y|H|
- |Place |<|#|#|#|U|J|
- |Attack| |#|#|#|X|C|
- +------------------+
- |Refuel:Z (Slot 16)|
- |Select-a-slot:1-8 |
- +------------------+
- By 44shades44]]
- else
- print[[
- Remote Controlled Turtles (RCT)
- Controls:
- +-------------------------------------+
- |Direction | F | B | L | R | U | D |
- +-----------+-----+---+---+---+---+---+
- |Go/Turn | W | S | A | D | R | F |
- |Mine | M | # | # | # | T | G |
- |Mine & Go | Up | # | # | # | Y | H |
- |Place Block|Enter| # | # | # | U | J |
- |Attack |Space| # | # | # | X | C |
- +-------------------------------------+
- |Refuel: Z | Select slot 1-8: 1-8 |
- |Turtle refuels from slot 16 (last 1) |
- |Turtle selects slot 1 after refuel |
- +-------------------------------------+
- By 44shades44]]
- end
- end
- function termReset()
- term.clear()
- term.setCursorPos(1,1)
- end
- if pocket then --also added by Aus4000 for PDA's
- rednet.open("back")
- RCTC()
- else
- termReset()
- print("What side is your modem on?")
- rednet.open(read())
- RCTC()
- end
- -- Thanks Aus4000
Add Comment
Please, Sign In to add comment