This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DannySMc's profile picture

Title: Using programs to allow some features to work on the computer?

Started by DannySMc, 28 March 2013 - 04:43 AM
DannySMc #1
Posted 28 March 2013 - 05:43 AM
Okay so I am trying to make a simple clock, but it didn't work as it keeps saying: "startup:5: attempt to call nil", and I am getting confused now I had a search for what the error means and it says I have to make a program to utilize the certain bits of code's features? as the code is calling something that isn't recognised? have I not installed something correctly or? I am using minecraft 1.5.1 and the technic launcher (tekkit lite).

here is my code:

funtion infiniteLoop()
while true do
mon = peripheral.wrap("left")
mon.setTimeScale(3)
local time = os.time()
time = textutils.formatTime(time,false)
mon.clear()
mon.setCursorPos(1,1)
mon.write(time)
sleep(1)
end
end
infiniteLoop()

help please

EDIT:
I am a complete newbie to this language, as I use HTML,PHP,C++ etc :/
dan200 #2
Posted 28 March 2013 - 05:50 AM
There is no such thing as "mon.setTimeScale", did you mean mon.setTextScale?
CCJJSax #3
Posted 28 March 2013 - 05:52 AM
you defined "time" twice. I'm also pretty new to lua, but that might be your problem.
DannySMc #4
Posted 28 March 2013 - 05:55 AM
There is no such thing as "mon.setTimeScale", did you mean mon.setTextScale?
aahhhh i see thank you and also do you know how to make a lock that works so a door lock as i tried but it never works i shall paste my code in a minute