Posted 11 June 2015 - 02:26 PM
This is a function of the desktop. It should instead show signs CLOCK playing time.
playing time.
function DESKTOP()
while true do
term.setTextColor(1)
term.setBackgroundColor(1)
term.clear()
paintutils.drawPixel(1, 1, colors.red)
paintutils.drawLine(1, 1, 51, 1, colors.red)
paintutils.drawLine(1, 19, 51, 19, colors.red)
paintutils.drawLine(2, 1, 4, 1, colors.gray)
term.setCursorPos(2,1)
term.write('EOS')
paintutils.drawLine(46, 1, 50, 1, colors.gray)
term.setCursorPos(46,1)
term.write( CLOCK )
local event, button, xPos, yPos = os.pullEvent("mouse_click")
if xPos == 2 and yPos == 1 then
menu()
elseif xPos == 3 and yPos == 1 then
menu()
elseif xPos == 4 and yPos == 1 then
menu()
end
end
end
I wrote instead CLOCK
playing time.
function DESKTOP()
while true do
term.setTextColor(1)
term.setBackgroundColor(1)
term.clear()
paintutils.drawPixel(1, 1, colors.red)
paintutils.drawLine(1, 1, 51, 1, colors.red)
paintutils.drawLine(1, 19, 51, 19, colors.red)
paintutils.drawLine(2, 1, 4, 1, colors.gray)
term.setCursorPos(2,1)
term.write('EOS')
paintutils.drawLine(46, 1, 50, 1, colors.gray)
term.setCursorPos(46,1)
term.write( CLOCK )
local event, button, xPos, yPos = os.pullEvent("mouse_click")
if xPos == 2 and yPos == 1 then
menu()
elseif xPos == 3 and yPos == 1 then
menu()
elseif xPos == 4 and yPos == 1 then
menu()
end
end
end
I wrote instead CLOCK
textutils.formatTime (os.time (), false
, but the time is updated only when the mouse button is pressed. Help, please :)/>