Paste #32705: Diff note for paste #32704

Date: 2016/04/14 09:47:31 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste
Copy Link


-SprintCheck:
-    type: world
+"BodyStats":
+    Type: world
     debug: true
     events:
-        on player toggles sprinting:
-          - foreach <server.list_online_players.aslist> {
-            - narrate "SprintCheck start"
-            - if <def[player.walk_speed]> > 0.2 {
-              - narrate "<def[player.walk_speed]>"
-                #If the temperature flag is below 10 the event should be cancelled. If it is not, the flag should rise by one and the thirst flag should decrease by 2 and another check should be made - if it is above 70, the event will be cancelled, as it will if the thirst flag is below 35. If it does succeed, it will lower the stamina flag by 3.
-                - if <def[player.flag[BodyStatsTemp]]||0> < 10 {
-                - queue clear
-                }
-              - flag <def[player]> BodyStatsTemp:+:1
-              - flag <def[player]>BodyStatsThirst:-:2
-              - if <def[player.flag[BodyStatsTemp]]||0> > 70 {
-                - queue clear
-                }
-              - if <def[player.flag[BodyStatsThirst]]||0> < 35 {
-                - queue clear
-                }
-              - flag <def[player]>BodyStatsStamina:-:3
-              }
+        on server start:
+          - wait 1t
+          - run "RollingClock1"
+          - wait 1t
+          - inject "SprintCheck"
+
+SprintCheck:
+    type: task
+    script:
+      - foreach <server.list_online_players.aslist> {
+        - narrate "SprintCheck start"
+        - if <def[player.walk_speed]> > 0.2 {
+          - narrate "<def[player.walk_speed]>"
+            #If the temperature flag is below 10 the event should be cancelled. If it is not, the flag should rise by one and the thirst flag should decrease by 2 and another check should be made - if it is above 70, the event will be cancelled, as it will if the thirst flag is below 35. If it does succeed, it will lower the stamina flag by 3.   
+          - if <def[player.flag[BodyStatsTemp]]||0> < 10 {
+            - queue clear
+            }
+          - flag <def[player]> BodyStatsTemp:+:1
+          - flag <def[player]>BodyStatsThirst:-:2
+          - if <def[player.flag[BodyStatsTemp]]||0> > 70 {
+            - queue clear
+            }
+          - if <def[player.flag[BodyStatsThirst]]||0> < 35 {
+            - queue clear
+            }
+          - flag <def[player]>BodyStatsStamina:-:3
           }
+        }
+      - wait 1t
+      - inject "SprintCheck"