This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sk1alpha's profile picture

Rednet cable, computers and alot of headache

Started by Sk1alpha, 20 January 2014 - 11:04 PM
Sk1alpha #1
Posted 21 January 2014 - 12:04 AM
So check this out im pretty new to cp craft and ive got a big task on my hands.
Im writing a reactor/factory contol program and i decided to make it as complex as possible for my first task.

What i am trying to do here is have this computer output different set of color profiles on a rednet cable as to do what ever so choose…
problem is im getting an error on the end line saying " 'end' expected (to close 'if' at line
5) which would be the if input == password then.
Im stumped, anyhelp?

Also this code must be able to keep an action going while requesting input to start another and keep said action going unless specified input requests a cancel….i really need to find something better to do with my free time.


print("Enter terminal Access Code")
-- password lock
local password = "password"
term.setCursorPos(1,3)
local input = read()
if input == password then
print("BUNCH OF RANDOM GARBAGE I HAVE IN HERE")
print("about 5 more lines of this of which include the input options to trigger event")
-- everything above this works fine
local input = read()
if input == "reactor" then
redstone.setBundledOutput("back", colors.orange)
sleep(10) -- for testings sake since i have yet to get this to work
end
MR_nesquick #2
Posted 21 January 2014 - 01:05 AM
you got two if statements. try to add a new "end" and it should work fine
you can also check out this link to see what the error code means