Space Engineers

Space Engineers

Not enough ratings
Current Time
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.152 KB
7 Feb, 2015 @ 2:08pm
30 May, 2017 @ 3:42pm
5 Change Notes ( view )

Subscribe to download
Current Time

Description
Simple script, pulls the current time from the server/your computer and puts it on an antenna, trigger programming block with a timer block once every second for a constant time update.

Updates:
V2 - Added support for an audible alarm, to set this alarm you must have a soundblock on your ship (the script will grab the first soundblock it finds), then go into the code and change the line "setAlarm = false;" to "setAlarm = true;". To set when the alarm will go off you need to change the DateTime variable at the top of the script, comments in the script go into more detail here but essentially the DateTime constructor is DateTime(Year,Month,Day,Hour,Minute,Second), where the max hour value is 23. only the Hour and Minute values matter currently so change those to the time you want the alarm to go off and you should be good to go.

If you don't care about having an alarm then just leave the code as it is, it defaults to off.

V3 - Added LCD support, to enable go into the script and change "useLCD = false;" to "useLCD = true;" By default all LCDs with the word "Clock" in their name will be used to display time, you can change this by changing the panelName variable to whatever you want.

Also added beacon support, to enable go into the script and change "useBeacon = false;" to "useBeacon = true;" works the same as the original radio antenna only using a beacon instead.
19 Comments
MrFox 2 Nov, 2023 @ 8:52pm 
update?
JadeXyan  [author] 24 Aug, 2021 @ 11:04am 
It should be possible to adjust and expand the alarm code to allow it to trigger anything at a specific time/date (assuming this all still works and the scripting system hasn't changed in the years since I wrote this), if you only care about hours/minutes you'd just have to figure out how to access a door instead of a soundblock in code, not a lot beyond that I can do to help there since you likely want a specific door that's going to be unique to whatever you're building rather than all doors or the first door the code happens to find.

If you need time in the length of many days/months/years that would require expansion of the alarm code which is more doable on my end, though if I remember correctly the server going offline interrupted that sort of thing which is why I didn't include it in the original code
BibiFlox 23 Aug, 2021 @ 2:24pm 
Hello, is it possible to allow the opening of a door at a specific time?
Winfield 29 Sep, 2020 @ 7:12am 
Hello KadeXyan, my name is Jon and I help admin a server called Solar Conquest. We were wondering if it’s possible to have a timer triggered on a specific day of the week at a specific time. I realize this may be slightly beyond the current codes capabilities and if it is only able to call up the hours/minutes of a day we can work with that but it would still need to be able to trigger a timer at a specified time.

Can it be done? If so, we can automate some of the server functions that take up admin time and trigger events even without us being there.

Thank you for your time.
JadeXyan  [author] 18 Mar, 2019 @ 11:23am 
Hey, I'm not doing much with space engineers these days, but I've gone ahead and checked to see if it still works and it appears it still does (tested LCD panels and beacons).

For future finders of this --- Generally speaking this isn't a terribly complex script and I'm reasonably willing to update it if it does break if you ask here.


In other news, in my testing I did find a bug if you search for an lcd that shares its name with a similar beacon name, but that's fairly easily avoided. Anyway, hope you find the script useful, let me know if you have any questions.
JDaremo Fireheart 14 Mar, 2019 @ 5:02pm 
Is it still working? I was going to give this a try.
JadeXyan  [author] 30 May, 2017 @ 3:43pm 
Updated to get it working again with the current version of the game
BevansDesign 28 May, 2017 @ 11:12am 
Doesn't look like this is working anymore. There are a few errors on compile, as well as when run.
Pheona Coldfire 22 Jun, 2016 @ 3:00pm 
well I got it to work! thank you for the help. I was wondering tho is there a way to adjust the time? (as in it is showing the time but the time it is showing me is an hour off from my time)
Pheona Coldfire 19 Jun, 2016 @ 7:05am 
hmm ok I'll try it again, thank you!