Space Engineers

Space Engineers

Ikke nok vurderinger
Current Time
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
Filstørrelse:
Offentliggjort:
Opdateret:
1.152 KB
7. feb. 2015 kl. 14:08
30. maj 2017 kl. 15:42
5 ændringsbemærkninger ( vis )

Abonner for at downloade
Current Time

Beskrivelse
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 kommentarer
MrFox 2. nov. 2023 kl. 20:52 
update?
JadeXyan  [ophavsmand] 24. aug. 2021 kl. 11:04 
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 kl. 14:24 
Hello, is it possible to allow the opening of a door at a specific time?
Winfield 29. sep. 2020 kl. 7:12 
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  [ophavsmand] 18. mar. 2019 kl. 11:23 
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 kl. 17:02 
Is it still working? I was going to give this a try.
JadeXyan  [ophavsmand] 30. maj 2017 kl. 15:43 
Updated to get it working again with the current version of the game
BevansDesign 28. maj 2017 kl. 11:12 
Doesn't look like this is working anymore. There are a few errors on compile, as well as when run.
Pheona Coldfire 22. juni 2016 kl. 15:00 
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. juni 2016 kl. 7:05 
hmm ok I'll try it again, thank you!