Posted 18 November 2016 - 11:42 AM
So I was testing out the second part of my startup program, and this showed up
Can anyone help me?
Edit:No, changing the = to == won't work. it will just say "expected string" and yes, i've tried putting "" on the Wochilly
ReEdit:Apparently the expected string was caused due to me loading the API incorrectly. I've fixed it now, so ignore this post.
here's the program:bios.lua:14: [string ".temp"]:8: 'then' expected
If you're curious, here's the Basics API:os.loadAPI(Basics)
paintutils.drawQuestionBox()–this is from the Basics API, this didn't cause the error
textutils.slowPrint("Your name?")
term.setCursorPos(5, 8)
term.setBackgroundColor( colors.white )
local name = read()
term.clear()
if name = Wochilly then –this caused the error
paintutils.drawDialog()–yet again, another function from the API
textutils.slowPrint("Wochilly! Welcome back!")
term.setBackgroundColor( colors.black )
term.setTextColor( colors.lightBlue )
term.clear()
term.setCursorPos(1, 1)
print("CraftOS Binary Edition")\
else
print("TODO")
end
So apparently the error is saying the 8th line which checks if the name is Wochilly or not is expected to have a 'then' even though then is in plain sight.function paintutils.drawDialog()
paintutils.drawFilledBox(1, 15, 51, 19, colors.blue )
paintutils.drawFilledBox(2, 16, 50, 18, colors.lightBlue )
term.setCursorPos(2, 16)
term.setBackgroundColor( colors.lightBlue )
end
function paintutils.drawQuestionBox()
paintutils.drawFilledBox(3, 5, 47, 10, colors.yellow )
paintutils.drawLine(5, 8, 45, 8, colors.white )
term.setBackgroundColor( colors.yellow )
term.setTextColor( colors.black )
term.setCursorPos(5,7)
end
Can anyone help me?
Edit:No, changing the = to == won't work. it will just say "expected string" and yes, i've tried putting "" on the Wochilly
ReEdit:Apparently the expected string was caused due to me loading the API incorrectly. I've fixed it now, so ignore this post.
Edited on 19 November 2016 - 12:26 AM