Posted 01 June 2014 - 03:35 AM
Hi, I'm new to Lua and computer craft but I have been programming for a long time. I recently had a major loss of vision because of diabetes and I just recently had surgery to reverse it. (Currently having someone proof read this). I'm using a magnifier right now to program computers and turtles in minecraft. I felt like explaining this because my question is a rather simple one but I have the most problems with it because of my vision.
Question: I'm getting an this error(bios:339: [string"rTable"]:9: ')' expected) whenever I run this code.
I'm thinking it's a syntax error, but I wouldn't be here unless I was stumped. I apologize if this question is to trivial for the forum or answered somewhere else. If there is an answer to the problem in a post or in a tutorial please link, I would be more than happy to read it, I just have problems navigating around. Thank you :)
Question: I'm getting an this error(bios:339: [string"rTable"]:9: ')' expected) whenever I run this code.
local id = nil
local packet = {["id"] = 1, ["name"] = "Bob", ["msg"] = "hi there"}
local msg = nil
while true do
id, msg = rednet.receive(10)
if id ~= nil and msg ~= nil then
packet = textutils.unserialize(msg)
print("id: "...packet.id)
print("name: "...packet.name)
print("msg: "....packet.msg)
break
end
end
I'm thinking it's a syntax error, but I wouldn't be here unless I was stumped. I apologize if this question is to trivial for the forum or answered somewhere else. If there is an answer to the problem in a post or in a tutorial please link, I would be more than happy to read it, I just have problems navigating around. Thank you :)