Server Code:
-- Intro
term.setColor(colors.blue)
print("End Farm Server")
term.setColor(colors.white)
print("Written By Ian")
rednet.open(rednetSide)
-- Variable
rednetSide = "top"
-- Main Loop
term.setCursorPos(1,4)
term.setColor(colors.green)
write("True")
term.setColor(colors.red)
term.setCursorPos(8,4)
write("False")
term.setColor(colors.white)
term.setCursorPos(1,6)
write("Command: ")
-- Broadcast
while true do
if read() == "True" then
rednet.broadcast(read())
end
if read() == "False" then
rednet.broadcast(read())
end
else
term.setColor(colors.red)
print("Invalid Command")
sleep(0.5)
end
end
end
Error: bios:14: [string "startup"]:39: 'end' expected to (to close 'while' at line 28)
I have had this error two times in two different programs I wrote and from what I can see there is an end to close the while XD so if someone could explain the error in depth that would also help me to try and solve these problems myself in the future thanks
Client Code:
rednet.open("right")
term.clear()
function active()
while true do
turtle.attack()
turtle.drop()
end
end
while true do
id,message = rednet.receive()
if id == 311 then
if message == "True" then
active()
end
if message == "False" then
os.reboot()
end
end
end
I do not know what is wrong with this code. but just checking












