I've managed to do most of it but now when I'm polishing it up it doesn't work somehow,
It starts off with a screen asking you if you want to use the command control or key control,
in command control you can type exit to go back to the choice menu, but it doesn't work, but it DOES work on the key one?
tid = 379
thing = "none"
rednet.open("right")
other = true
function s()
sleep(.4)
end
while true do
if other == true then
term.clear()
term.setCursorPos(1,1)
print("Blood-Corp Turtle Systems")
print("Please enter control type (command or key) : ")
local test = read()
if test == "command" then
thing = "command"
elseif test == "key" then
thing = "key"
end
end
if thing == "command" then
command = true
while command == true do
term.clear()
term.setCursorPos(1,1)
print("Blood-Corp Turtle Systems")
print("Commands : up,down,left,right,forward,back,exit.")
term.setCursorPos(1,3)
write("Enter Command : ")
local command = read()
if command == "forward" then
rednet.send(tid, "forward")
print("Sent Forward")
s()
elseif command == "left" then
rednet.send(tid, "right")
print("Sent Left")
s()
elseif command == "right" then
rednet.send(tid, "left")
print("Sent Right")
s()
elseif command == "back" then
rednet.send(tid, "back")
print("Sent Back")
s()
elseif command == "up" then
rednet.send(tid, "up")
print("Sent Up")
s()
elseif command == "down" then
rednet.send(tid, "down")
print("Sent Down")
s()
elseif command == "exit" then
command = false
other = true
s()
else
print("Unknown Command.")
print("Usage: up,down,left,right,forward,back,exit.")
sleep(1)
end
end
elseif thing == "key" then
term.clear()
term.setCursorPos(1,1)
print("Blood-Corp Turtle Systems")
print("Keys : ](up), [(down), a(right), d(left).\nKeys : w(forward), s(back), z(exit).")
key = true
while key == true do
local evt, c = os.pullEvent("char")
c = string.lower(c)
if c == "w" then
rednet.send(tid, "forward")
print("Sent Forward")
elseif c == "d" then
rednet.send(tid, "right")
print("Sent Left")
elseif c == "a" then
rednet.send(tid, "left")
print("Sent Right")
elseif c == "s" then
rednet.send(tid, "back")
print("Sent Back")
elseif c == "]" then
rednet.send(tid, "up")
print("Sent Up")
elseif c == "[" then
rednet.send(tid, "down")
print("Sent Down")
elseif c == "z" then
key = false
other = true
s()
else
print("Unknown Key.")
print("Usage : ](up), [(down), a(right), d(left).\nUsage : w(forward), s(back), z(exit).")
sleep(1)
end
end
end
end
Thanks!