Paste #102705: Diff Report Between Paste #102704 and #80291

Date: 2022/10/27 17:00:33 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste Edit Of Paste 102704
Copy Link


+
 auto_restarter_world:
     type: world
     debug: false
     events:
         on system time 03:00:
         - run auto_restarter_task
         on player logs in server_flagged:restart_happening:
         - determine "KICKED:Server is restarting momentarily, please wait."
 
 auto_restarter_task:
     type: task
     debug: false
     script:
     - wait 1m
-    - define marks <list[30m|20m|15m|10m|5m|4m|3m|2m|1m|30s|15s|10s|5s].parse[as_duration]>
+    - define marks <list[30m|20m|15m|10m|5m|4m|3m|2m|1m|30s|15s|10s|5s].parse[as[duration]]>
     - foreach <[marks]> as:mark:
         - if <server.online_players.is_empty>:
             - foreach stop
-        - define display_in "<[mark].formatted.replace[s].with[ seconds].replace[m].with[ minutes].replace[1 minutes].with[1 minute]>"
+        - announce "<&c>Server will automatically restart in <[mark].formatted_words>."
-        - announce "<&c>Server will automatically restart in <[display_in]>."
         - if <[mark].in_seconds> <= 60:
-            - title "subtitle:<&c>Restart in <[display_in]>." fade_out:10s targets:<server.online_players>
+            - title "subtitle:<&c>Restart in <[mark].formatted_words>." fade_out:10s targets:<server.online_players>
             - flag server restart_happening duration:<[mark].add[10s]>
-        - wait <[mark].sub[<[marks].get[<[loop_index].add[1]>]||0s>]||5s>
+        - wait <[mark].sub[<[marks].get[<[loop_index].add[1]>]||0s>]>
     - flag server restart_happening duration:5s
     - announce "<&c>Server RESTARTING NOW!"
     - kick <server.online_players> "reason:Restarting! Please wait a minute before rejoining."
     - wait 1s
     - adjust server restart
+