Posted 27 April 2012 - 09:20 PM
So im making a program that will make it easier to control networks and redstone and eventually other things. I put it in two files for now so I could work on different parts of it. But I get odd errors.
RedControl.lua:
I stopped here because of this error:
Which again there is an '=' sign. Can someone help me with this. Also I am gonna change these a little as they are. Is there any other problems that you guys see or things you think I should change? Thanks.
RedControl.lua:
term.clear() term.setCursorPos(1,1)
term.write("Welcome to RedControl, \n Please enter your password.")
sleep(1)
term.setCursorPos(1,0)
input = read()
if input = ("password") then
term.clear()
term.setCursorPos(1,1)
term.write("Checking Password...")
sleep(5)
term.clear
term.setCursorPos(1,1)
term.write("Password Correct!")
else
term.clear()
term.setCursorPos(1,1)
term.write("Checking Password...")
sleep(5)
term.clear
term.setCursorPos(1,1)
term.write("Password Incorrect! Exiting program in 5 seconds...")
sleep(5)
exit()
end
term.clear
term.setCursorPos(1,1)
term.write("What would you like to do?")
I stopped here because of this error:
bios:206: [string "RedControl.lua"] :7: 'then' expected
I have 'then' were it says the error is. Then I get an error in RedNetwork.lua:
--Output = ("")
--Input = ("")
Message = ("")
LastId = 0
Port = ("")
function configure()
term.write("What would you like your default port to be?")
Port = read()
end
function start()
term.clear
term.setCursorPos(1,1)
--term.write("What port is your modem on?")
--Port = read()
rednet.open(Port)
term.write("Starting Modem... /n")
sleep(3)
term.write("Modem Started. /n")
end
function talk(message)
term.write("What would you like to send? /n")
message = read()
Message = read()
rednet.broadcast(message)
term.write("Sending... /n")
Message = Message
end
function listen(duration, message)
term.write("How long would you like to look for a signal? Leave blank to search until one is found. /n")
duration = read()
id,Message = rednet.receive(duration)
term.write("A message has been received from computer number" .. id .. "It is:" message "/n")
end
function reply(message)
term.write("Replying to most recent computer communicated with... /n")
term.write("What would you like to say?")
message = read()
rednet.send(LastId, message)
end
This is the error I get:
bios:206: [string "RedNetwork.lua"] :14: '=' expected
Which again there is an '=' sign. Can someone help me with this. Also I am gonna change these a little as they are. Is there any other problems that you guys see or things you think I should change? Thanks.