people playing: 108, servers online: 33, games played: 142,188,271 Top Player: HiPower

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Dec 10, 2011   #1
Shakky
Senior Member
 
Red Belt
Join Date: Nov 2007
Posts: 513



[REQ]ingame clock
We need a ingame clock! Maybe with a feature to see what time is it in other timezones too!
Shakky is offline   Reply With Quote
Old Dec 10, 2011   #2
Nirs
Engraze's bitch
 
Snow Belt
Join Date: Jan 2008
Posts: 2,071
Clan: Hack



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 06:20 AM..
Nirs is offline   Reply With Quote
Old Dec 10, 2011   #3
Dansan123
Member
 
Black Belt
Join Date: Apr 2011
Posts: 495



nice! but, can you make it so it is 12 hour not 24 hour?
Dansan123 is offline   Reply With Quote
Old Dec 10, 2011   #4
Nirs
Engraze's bitch
 
Snow Belt
Join Date: Jan 2008
Posts: 2,071
Clan: Hack



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)
Nirs is offline   Reply With Quote
Old Dec 10, 2011   #5
Sage
Elitist
 
6th Dan Black Belt
Join Date: Jul 2011
Posts: 6,673



which part/ what line of the startup.lua do i put it in?
Like a lie
Sage is offline   Reply With Quote
Old Dec 10, 2011   #6
Nirs
Engraze's bitch
 
Snow Belt
Join Date: Jan 2008
Posts: 2,071
Clan: Hack



Shocktrooper, as new line to the end startup.lua
Nirs is offline   Reply With Quote
Old Dec 10, 2011   #7
KillTheCook
Senior Member
 
Black Belt
Join Date: Aug 2011
Posts: 1,360
Clan: Frost



Wow nice found it.It only works on multiplayer but its cool
thnx nirs
(\(\(\ My work /)/)/)
/)
_('ω'(Q) Have a Banana

Last edited by KillTheCook; Dec 10, 2011 at 08:49 AM..
KillTheCook is offline   Reply With Quote
Old Dec 10, 2011   #8
Nirs
Engraze's bitch
 
Snow Belt
Join Date: Jan 2008
Posts: 2,071
Clan: Hack



it shows clock everytime. and on sp too. try restart your toribash.
Nirs is offline   Reply With Quote
Old Dec 10, 2011   #9
Dansan123
Member
 
Black Belt
Join Date: Apr 2011
Posts: 495



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!!!
Dansan123 is offline   Reply With Quote
Old Dec 10, 2011   #10
Sage
Elitist
 
6th Dan Black Belt
Join Date: Jul 2011
Posts: 6,673



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
Sage is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:01 PM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game