Toribash
Original Post
[REQ]ingame clock
We need a ingame clock! Maybe with a feature to see what time is it in other timezones too!
add that string to your startup.lua

lua code:
add_hook("draw2d", "showclock", function () now = os.date("*t"); wx, wy=get_window_size(); draw_text(string.format("%02s:%02s", now.hour, now.min), wx-50, wy-20); end)
Last edited by Nirs; Dec 10, 2011 at 07:20 AM.
Originally Posted by Dansan123 View Post
nice! but, can you make it so it is 12 hour not 24 hour?

lua code:
add_hook("draw2d", "showclock", function () now = os.date("*t"); wx, wy=get_window_size(); draw_text(string.format("%02s:%02s", math.fmod(now.hour,12), now.min), wx-50, wy-20); end)
Wow nice found it.It only works on multiplayer but its cool
thnx nirs
Last edited by KillTheCook; Dec 10, 2011 at 09:49 AM.
(\(\(\ My work /)/)/)
/)
_('ω'(Q) Have a Banana
Originally Posted by Nirs View Post
lua code:
add_hook("draw2d", "showclock", function () now = os.date("*t"); wx, wy=get_window_size(); draw_text(string.format("%02s:%02s", math.fmod(now.hour,12), now.min), wx-50, wy-20); end)

SWEET! thanks nirs!!!
Originally Posted by Nirs View Post
it shows clock everytime. and on sp too. try restart your toribash.

oh yeah thanks, now it appears in the bottom left, took a bit time finding it though
Like a lie