Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Fingercomp

Simple Clock

Recommended Posts

Long time ago I wrote a small program. It displays in-game time and real-life time.

Pastebin: pastebin get aKjh5SZL clock.lua

 

By default, touching the screen switches mode (from RL to in-game and vise versa).

 

There are also some settings to play with.

MT_BG    = 0x000000 -- In-game Time (MT) mode background color.
MT_FG    = 0xFFFFFF -- MT mode foreground color.
DAY      = 0xFFFF00 -- "Day"       |
EVENING  = 0x202080 -- "Evening"   | String
NIGHT    = 0x000080 -- "Night"     | colors
MORNING  = 0x404000 -- "Morning"   |
RT_BG    = 0x000000 -- Real-life Time (RT) Mode background color.
RT_FG    = 0xFFFFFF -- RT mode foreground color.
TIMEZONE = 0        -- Set TZ to make program display your local time.
                    -- Example values: -6, 2.5, 12.
CORRECT  = 0        -- Some TZ correction. Needs if host TZ is not UTC, or time gets messed up again.
W, H     = 40, 8    -- Width and height of screen in "pixels".
REDSTONE = false    -- Enable/disable redstone mode switching behaviour.
TOUCH    = true     -- Same as this (↑). But for screen touching.
KEY1     = 13       -- Make program stop when key pressed ([Enter] by default).
KEY2     = 28       -- ↑
SHOWSECS = true     -- Shows seconds in RT mode if value is true.
AUTOMODE = true     -- Controls which mode will be chosen on program start.
                    -- MT = true
                    -- RT = false
SWDATEMT = true     -- Shows date line in MT mode if value is true.
SWDATERT = true     -- Shows date line in RT mode if value is true.
SWDTMMT  = true     -- Shows time of day line in MT mode if value is true.
SWDTMRT  = true     -- Same as this (↑). But for RT mode.
Link to post
Share on other sites
  1. Start the program.
  2. Switch to RT mode (i.e. click on the screen).
  3. Calculate the difference between the time displayed on the screen, and the real UTC time, in hours (for example, -1 means the real time is 1 hour behind the time shown).
  4. Open the program (edit programname.lua) and go to line 10, the one that starts with "CORRECT =".
  5. Replace 0 with the difference you've calculated in step 3.
  6. On the previous line, replace 0 with the timezone you want (sample values: -6, +3, -10, +11).
  7. Save the file (Ctrl+S) and quit (Ctrl+W).
  8. Restart the program.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.