Jump to content




[CCGPU] Analog Clock [v1.0.3]

peripheral lua

  • You cannot reply to this topic
7 replies to this topic

#1 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 30 March 2012 - 06:40 PM

Hello,

I've just finished my Analog Clock. Use it with the awesome CCGPU Peripheral.

The clock will display the real Minecarft time.

Picture:

Posted Image

More Pictures : http://imgur.com/a/OBOU3

Code:

v 1.0.3 http://pastebin.com/SqJNC5Mm
v 1.0.2 http://pastebin.com/hTa8afcM
v 1.0.1 http://pastebin.com/buxrPKVF
v 1.0.0 http://pastebin.com/SBJeGtaH

Changelog:

v 1.0.3 :
  • color fading is now time-based.
  • the time until the color fade restarts is adjustable
  • minor performance optimization (circle is now only calculated once)
v 1.0.2 :
  • adjustable frequency of frame updates (per second)
v 1.0.1 :
  • added optional Color fading
  • optimized vertex calculation (clock is now maximum size)
v 1.0.0 :
  • first official release


#2 Mast3rPlan

  • Members
  • 14 posts

Posted 30 March 2012 - 06:49 PM

Amazing man, I love it!

#3 Loopin

  • Members
  • 31 posts

Posted 30 March 2012 - 07:58 PM

Oh my god man, really amazing!, this is the first program made using Gpu peripheral and i loved it!(i think was the first.)

#4 FuzzyPurp

    Part-Time Ninja

  • Members
  • 510 posts
  • LocationHarlem, NY

Posted 31 March 2012 - 08:48 PM

Just tried this - its amazing! MC 1.2.3, just finish backporting ccGPU. So grab it now.

#5 ssandiss

  • Members
  • 30 posts

Posted 10 July 2012 - 01:54 PM

What's CCGPU peripheral?
I've coded all the code into a computer what shall i do to make it work? :/
(Sorry for asking a probably noob question) :/

#6 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 10 July 2012 - 02:28 PM

You need this mod to run the code http://www.computerc...r-computercraft make shure yomu put a gpu next to the computer and place a graphical monitor with the same frequency and id in range.NOTE: there was an update made (see the last page of the thread)

#7 maximouli

  • New Members
  • 2 posts

Posted 26 February 2013 - 09:43 AM

You program is awesome ! Somebody nows how to modify the code to have the time of the real world (on earth :D) thanks

#8 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 27 February 2013 - 05:17 AM

View Postmaximouli, on 26 February 2013 - 09:43 AM, said:

You program is awesome ! Somebody nows how to modify the code to have the time of the real world (on earth :D) thanks

The important line is line 158
time = os.time()

When it's for example 8:37 the function will os.time() will return 8.6166666...
If you can manage to get the real world time into a variable you'll just have to manipulate this line or these lines: (160&161)

hours = math.floor(time)
minutes = math.floor((time-hours)*60)

hours must contain the hours [0-11] and minutes must contain the minutes [0-59] so you can modify lines 158-161.

However afaik you can't read the real wolrd time with a CC function so you maybe have to use the http api or something else.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users