Posted 12 December 2012 - 12:18 PM
I have a turtle that controls a lot of functions of my base. This particular turtle controls my turtle quarry. This is the startup program:
Feedback is appreciated!
Thanks! :D/>
function check()
if (message) == "Quarry" then
shell.run("Quarry")
else
rednet.send(8, "Computer "..id.." tried to activate me!")
print("Computer " ..id.." tried to activate me!")
end --I thought this was the end for the function
rednet.open("right")
id, message = rednet.receive()
if (id) == 20 then
check()
else
print("Computer "..id.." tried to activate me!")
rednet.send(8, "Computer "..id.." tried to activate me!")
end
What I am trying to get this program to do is listen for rednet signals from computer #8 and a certain message. If a different computer tries to activate the program it will print it on the screen and(if the computer is listening) send the same message to computer #8. I am new to functions and wanted to try to use them, but when I try to run this it gives me this error:
bios:338: [string "startup"]:16: 'end'
expected (to close 'function' at line
1)
I am new to Lua and know that I probably made a mistake somewhere that is very simple for a pro.Feedback is appreciated!
Thanks! :D/>