Ulysses

Ulysses Stuff => Releases => Topic started by: Caustic Soda-Senpai on January 18, 2015, 11:44:00 PM

Title: Restart Timer Command
Post by: Caustic Soda-Senpai on January 18, 2015, 11:44:00 PM
This was mostly just done for my server in the event that we needed a restart for some reason but I'm making it public cause I'm awesome.

Once you set the timer, it counts down from your set amount to 0 in minutes. It rounds to the nearest whole number, so no 2.5 minutes, etc.. It will also display each minute how many minutes you have remaining all the way to 0, where it gives you a final 3 seconds before it restarts the server. At any time during the countdown, you can abort it by typing !restartabort in chat. If you abort, it will show you how many minutes you had remaining before the shutdown.

Contains the following:

!restart - Sets the time for a server restart in minutes. (!restart <time>)

!restartabort - Aborts the current restart and displays the time remaining.

!restartpause - Pauses a Server Restart Timer.

!restartresume - Resumes a Server Restart Timer.

Let me know if there are any issues.

UPDATE:

Fixed the !restart 0 issue where the server would not run the restart.



Possible Updates:
More exact time remaining.
Partial Minutes - 30 seconds, 45 seconds, etc..
Graphical Interface displaying time left.

Suggestions/Requests?
Title: Re: Restart Timer Command
Post by: MrPresident on January 19, 2015, 08:15:48 AM
You can pause and unpause a timer to make your resume function:
http://wiki.garrysmod.com/page/timer/Pause (http://wiki.garrysmod.com/page/timer/Pause)
http://wiki.garrysmod.com/page/timer/UnPause (http://wiki.garrysmod.com/page/timer/UnPause)
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on January 19, 2015, 08:36:49 AM
Completely overlooked the pause function, thanks Mr.P
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on January 19, 2015, 04:58:59 PM
Update: Added Pause/Resume and some configuration options.
Title: Re: Restart Timer Command
Post by: JamminR on January 19, 2015, 08:27:23 PM
Nice work. Simple yet effective, and could actually be used as template for other ideas/learning.
Glad you found some of my ramblings useful.
Title: Re: Restart Timer Command
Post by: PatrickNL on February 25, 2015, 10:36:36 AM
If you set a time and it did restart, do i have to set up the time again?
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on February 25, 2015, 12:21:22 PM
at this time, yes. I will write an auto restart command that you can set to restart after (x) minutes after the server is launched
Title: Re: Restart Timer Command
Post by: PatrickNL on February 25, 2015, 01:20:47 PM
Yeah, i want it to make a restart 1x per day, but it's not working after map change :p
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on February 25, 2015, 10:54:44 PM
If you have a server that changes maps, then it won't be able to run every 86400 seconds (1 day) because it runs with the server. If the server changes maps, it kills the restart timer.
Title: Re: Restart Timer Command
Post by: Neku on February 25, 2015, 11:23:39 PM
If you have a server that changes maps, then it won't be able to run every 86400 seconds (1 day) because it runs with the server. If the server changes maps, it kills the restart timer.

Store the time in a data file. Or even a database.
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on February 25, 2015, 11:27:13 PM
I didnt think of that, that could work.
Title: Re: Restart Timer Command
Post by: silentkiller101 on March 15, 2015, 07:10:11 PM
Does this still work or did the update break it?
Title: Re: Restart Timer Command
Post by: XxLMM13xX on March 16, 2015, 05:16:11 PM
Does this still work or did the update break it?

Everything works fine for me!
Title: Re: Restart Timer Command
Post by: silentkiller101 on March 17, 2015, 12:01:26 PM
Everything works fine for me!

Doesn't work for me, when i click restart it says the server has been set to restart but then it doesn't do anything

Title: Re: Restart Timer Command
Post by: XxLMM13xX on March 17, 2015, 02:01:15 PM
Ohh yes this error! (not a console error) Just do !restart 1 its alot easier!
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on March 17, 2015, 02:03:57 PM
I am aware of the issue but haven't had the time to update it. I will let you know when I do.
Title: Re: Restart Timer Command
Post by: silentkiller101 on March 21, 2015, 03:47:57 PM
I am aware of the issue but haven't had the time to update it. I will let you know when I do.

Sorry, i meant to say it works its just when you type !restart 0 it doesn't immediately restart it unless that's intentional?

If you do !restart 5 it works
Title: Re: Restart Timer Command
Post by: allofmywutsteam on March 25, 2015, 02:57:53 PM
Ran a restart with 1 minute via xgui and it worked great. Love the countdown timer.

!restart 0 says it's going to restart but never does. !restart 1 says it will restart in a minute. I ran it already via xgui so I'm sure the 1 minute works, but the 0 doesn't insta-restart.
Title: Re: Restart Timer Command
Post by: Caustic Soda-Senpai on March 25, 2015, 05:21:58 PM
I'm aware of the !restart 0 issue. As I have replied in previous posts, I'll update as soon as I have time to do it.

EDIT: I have now updated the script to run the !restart 0 function.
Title: Re: Restart Timer Command
Post by: allofmywutsteam on March 25, 2015, 07:55:15 PM
I'm aware of the !restart 0 issue. As I have replied in previous posts, I'll update as soon as I have time to do it.

EDIT: I have now updated the script to run the !restart 0 function.

Don't see where you responded to this issue directly, but glad you got it working. I will test soon.

EDIT: !restart 0 confirmed works. Thanks!
Title: Re: Restart Timer Command
Post by: imSEnsE on July 03, 2018, 07:58:31 AM
Where do I find a Download?
Title: Re: Restart Timer Command
Post by: JamminR on July 03, 2018, 04:31:14 PM
At the bottom of the original first post.