1 posts
Posted 07 June 2014 - 12:16 PM
So I made a program to create a simple text, and it called nil. Can I have some help?
if true then
local monitor = peripheral.wrap ("back")
monitor.setTextscale(5)
monitor.setCursorPos(1,1)
monitor.write ("Boo")
end
Thanks for the help.
1281 posts
Posted 07 June 2014 - 09:01 PM
I forgot the term for it, but first word lower letters and then first letter capitalized for every word afterwards is considered conventional variable naming in Lua. The issue here is you did not do this with monitor.setTextScale(), as im sure the error number pointed to that lines aswell(3). Please include the full error next time, and use code tags.
Edited on 07 June 2014 - 07:01 PM
1140 posts
Location
Kaunas, Lithuania
Posted 07 June 2014 - 09:08 PM
I forgot the term for it…
Camelcase.
Code tags look like this:
[co
de]
print("Lua code")
Translates to this:
print("Lua code")
Edited on 07 June 2014 - 07:08 PM
47 posts
Location
Quebec, Canada
Posted 08 June 2014 - 01:26 AM
So I made a program to create a simple text, and it called nil. Can I have some help?
"attempt to call nil" usually means you tried to call an inexistant function.
Check whether you made any mistake in the function's name, if you didn't then it's
probably because the function was not defined at the line where this error occured.
As CometWolf said, It's probably because you did not capitalize the 'S' in "setTextScale".