SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local sizemul = 1 |
| 1 | + | local sizemul = 1 |
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | - | local txthi = 2 |
| 5 | + | local txthi = 2 |
| 6 | ||
| 7 | - | epoch_mul = 72000 |
| 7 | + | |
| 8 | - | norm_clr = {255, 255, 255}
|
| 8 | + | |
| 9 | - | prev_col = nil |
| 9 | + | local widsize = 80 |
| 10 | - | cur_col = norm_clr |
| 10 | + | local hisize = 10 |
| 11 | - | first_time = 1 |
| 11 | + | |
| 12 | - | local widsize = 80 |
| 12 | + | hisize = hisize * txthi |
| 13 | - | local hisize = 10 |
| 13 | + | local dedwid = 2 |
| 14 | local dedhi = 5 | |
| 15 | - | hisize = hisize * txthi |
| 15 | + | |
| 16 | - | local dedwid = 2 |
| 16 | + | os.loadAPI("AndysPrograms/gltime/api/getmnth")
|
| 17 | - | local dedhi = 5 |
| 17 | + | |
| 18 | local mineminute = 60 / 72 | |
| 19 | - | os.loadAPI("AndysPrograms/gltime/api/getmnth")
|
| 19 | + | mineminute = mineminute * 0.999 |
| 20 | local sizediv = 1 | |
| 21 | - | local mineminute = 60 / 72 |
| 21 | + | widsize = widsize / sizediv |
| 22 | - | --mineminute = mineminute * 0.999 |
| 22 | + | hisize = hisize / sizediv |
| 23 | - | local sizediv = 1 |
| 23 | + | local scaletsize = sizemul / sizediv |
| 24 | - | widsize = widsize / sizediv |
| 24 | + | |
| 25 | - | hisize = hisize / sizediv |
| 25 | + | local canvas = peripheral.wrap("back").canvas()
|
| 26 | - | local scaletsize = sizemul / sizediv |
| 26 | + | canvas.clear() -- Get rid of our previous clock |
| 27 | ||
| 28 | - | local canvas = peripheral.wrap("back").canvas()
|
| 28 | + | local group = canvas.addGroup({ 0, 0 })
|
| 29 | - | canvas.clear() -- Get rid of our previous clock |
| 29 | + | |
| 30 | -- Look, we add items to our group instead | |
| 31 | - | local group = canvas.addGroup({ 0, 0 })
|
| 31 | + | --group.addRectangle(0, 0, widsize, hisize, 0xFF000064) |
| 32 | ||
| 33 | - | -- Look, we add items to our group instead |
| 33 | + | local text = group.addText({ 5, 5 }, "")
|
| 34 | - | --group.addRectangle(0, 0, widsize, hisize, 0xFF000064) |
| 34 | + | local text2 = group.addText({ 5, 5 }, "")
|
| 35 | text.setScale(scaletsize) | |
| 36 | - | local text = group.addText({ 5, 5 }, "")
|
| 36 | + | text.setColour(255,1,255) |
| 37 | - | local text2 = group.addText({ 5, 5 }, "")
|
| 37 | + | |
| 38 | - | text.setScale(scaletsize) |
| 38 | + | local x, y, dx, dy = 0, 0, 5, 5 |
| 39 | - | --text.setColour(255,1,255) |
| 39 | + | |
| 40 | -- Compute the dimensions we can move within | |
| 41 | - | local x, y, dx, dy = 0, 0, 5, 5 |
| 41 | + | local width, height = canvas.getSize() |
| 42 | width = width - widsize | |
| 43 | - | -- Compute the dimensions we can move within |
| 43 | + | height = height - hisize |
| 44 | - | local width, height = canvas.getSize() |
| 44 | + | width = width - dedwid |
| 45 | - | width = width - widsize |
| 45 | + | height = height - dedhi |
| 46 | - | height = height - hisize |
| 46 | + | y = height |
| 47 | - | width = width - dedwid |
| 47 | + | while true do |
| 48 | - | height = height - dedhi |
| 48 | + | time_st = os.epoch() |
| 49 | - | y = height |
| 49 | + | |
| 50 | local _, day, month, _ = getmnth.getmnth() | |
| 51 | - | trans_time = 15 * 1000000 |
| 51 | + | print(os.epoch()) |
| 52 | - | trans_time = 5 * epoch_mul |
| 52 | + | group.setPosition(x, y) |
| 53 | - | col_prev_time = 0 |
| 53 | + | |
| 54 | - | prev_col = {1,1,1}
|
| 54 | + | if true then |
| 55 | - | function mix(mix_end, mix_start) |
| 55 | + | otftim2 = string.gsub(textutils.formatTime( os.time(), true ), ":", "") |
| 56 | - | if (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1) > 1 then |
| 56 | + | --print(otftim2) |
| 57 | - | -- term.setCursorPos(1,13) |
| 57 | + | --print(tonumber(otftim2)) |
| 58 | - | -- term.clearLine() |
| 58 | + | if tonumber(otftim2) >= 1600 and tonumber(otftim2) < 1800 then |
| 59 | - | -- print("done")
|
| 59 | + | text.setColour(252, 136, 3) |
| 60 | - | -- term.setCursorPos(1,11) |
| 60 | + | elseif tonumber(otftim2) >= 1800 and tonumber(otftim2) <= 2359 then |
| 61 | - | -- term.clearLine() |
| 61 | + | text.setColour(191, 72, 61) |
| 62 | - | -- print(mix_end) |
| 62 | + | |
| 63 | - | return mix_end |
| 63 | + | elseif tonumber(otftim2) >= 0 and tonumber(otftim2) <= 600 then |
| 64 | text.setColour(191, 72, 61) | |
| 65 | else | |
| 66 | - | --local temp_start = mix_start * (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1) |
| 66 | + | text.setColour(255, 255, 255) |
| 67 | - | --local temp_end = mix_end * (1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)) |
| 67 | + | |
| 68 | - | |
| 68 | + | |
| 69 | - | local temp_start = mix_start * (1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)) |
| 69 | + | |
| 70 | - | local temp_end = mix_end * (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1) |
| 70 | + | -- And update the time |
| 71 | - | -- term.setCursorPos(1,7) |
| 71 | + | |
| 72 | - | -- term.clearLine() |
| 72 | + | time_nospace_zero = string.gsub(textutils.formatTime(os.time(), false), " ", " ") |
| 73 | - | -- print(1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)) |
| 73 | + | time_nospace_10error = string.gsub(time_nospace_zero, "0:", "12:") |
| 74 | - | -- term.setCursorPos(1,8) |
| 74 | + | time_nospace = string.gsub(time_nospace_10error, "112:", "10:") |
| 75 | - | -- term.clearLine() |
| 75 | + | |
| 76 | - | -- print(os.epoch()) |
| 76 | + | text.setText(time_nospace) |
| 77 | text2.setText("\n"..day.." "..month)
| |
| 78 | - | -- term.setCursorPos(1,9) |
| 78 | + | if time_en == nil then |
| 79 | - | -- term.clearLine() |
| 79 | + | time_sub = 0 |
| 80 | - | -- print(((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1) |
| 80 | + | |
| 81 | - | -- term.setCursorPos(1,10) |
| 81 | + | mineminute = 60 / 72 |
| 82 | - | -- term.clearLine() |
| 82 | + | time_en = os.epoch() |
| 83 | - | -- print(temp_start) |
| 83 | + | time_sub = time_en - time_st |
| 84 | - | return temp_start + temp_end |
| 84 | + | if time_sub < 0 then |
| 85 | - | end |
| 85 | + | time_sub = time_sub / -1 |
| 86 | end | |
| 87 | - | disp_col = {1,1,1}
|
| 87 | + | mineminute = mineminute - (time_sub / 1000) |
| 88 | - | function table_to_textcol(tab) |
| 88 | + | sleep(mineminute) |
| 89 | - | disp_col = {1,1,1}
|
| 89 | + | end |