Ok, firstly I'm a complete noob to CC and Lua so if I'm making a really obvious mistake cut me a little slack.
Anyway what I want to do is fairly simple: have a monitor that displays a short message and the time. Displaying my message was easy but adding in the time is confusing me. This is the program I have now (named "Text"):
term.clear
term.setCursorPos(5, 3)
nTime == os.time()
print ("Welcome Player")\(
print ("The time is "..textutils.formatTime ( nTime, false))
every time i try to run this I get this error code; bios:206: [string "text"]:2: '=' expected
it says to add an = sign but I don't think I need one anywhere it's really anoying
also will I need some sort of loop to refresh the time and keep it updated (I'll be displaying all this on a big monitor)
thanks!
[Question] trouble with displaying time
Started by Oneredweasel, Nov 26 2012 07:17 AM
3 replies to this topic
#1
Posted 26 November 2012 - 07:17 AM
#2
Posted 26 November 2012 - 07:18 AM
On the first line, there should be () after term.clear.
Also, on line 4, that ( probably shouldn't be there.
Also, on line 4, that ( probably shouldn't be there.
#3
Posted 26 November 2012 - 10:28 PM
Kingdaro pointed out two errors.
I also spotted this.
I also spotted this.
nTime == os.time() Should be nTime = os.time()
#4
Posted 27 November 2012 - 12:14 AM
THANKS! that was a quick response and this has been bothering me to no end, all I had to do was add that () and then turn the == on line 3 into a =.
p.s. the \( on line 4 was just a typo, my actual program didn't have that
p.s. the \( on line 4 was just a typo, my actual program didn't have that
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











