Paste #54409: Diff note for paste #54408

Date: 2019/05/26 06:11:02 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste
Copy Link


 # 
 # ----| USAGE
 # 
 # The script will automatically look for new and removed regions whenever you
 # use the WorldGuard "/region" command. All regions are then converted to
 # notable cuboids.
 # 
 # If you wish to manually convert regions, you can run the task script
 # "worldguard_regions_to_notable_cuboids"
 # 
 # All notable cuboids created by this script will have names following this
 # template:
 # wgregion_W_<world name>_R_<region name>
 # 
 # You can then use these new notable regions in events, commands, tags, etc.
 # 
 # 
 
 worldguard_regions_to_notable_cuboids:
     type: task
     debug: false
     speed: 0
     script:
     - flag server worldguard_to_notable_cuboids:!
-    - foreach <server.list_worlds> {
-        - define w <def[value]>
-        - foreach <def[w].list_regions> {
-            - note <def[value].cuboid> as:wgregion_W_<def[w].name>_R_<def[value].id>
-            - flag server worldguard_to_notable_cuboids:->:<def[value]>
-        }
+    - foreach <server.list_worlds> as:w:
+        - foreach <[w].list_regions> as:r:
+            - note <[r].cuboid> as:wgregion_W_<[w].name>_R_<[r].id>
+            - flag server worldguard_to_notable_cuboids:->:<[r]>
+    - foreach <server.list_notables[cuboids].filter[starts_with[cu@wgregion_]].exclude[<server.flag[worldguard_to_notable_cuboids].as_list>]>:
+        - note remove as:<[value]>
-    }
-    - foreach <server.list_notables[cuboids].filter[starts_with[cu@wgregion_]].exclude[<server.flag[worldguard_to_notable_cuboids].as_list>]> {
-        - note remove as:<def[value]>
-    }
 
 worldguard_regions_to_notable_cuboids_evts:
     type: world
     debug: false
     events:
         on rg|region command:
         - wait 1t
-        - if '<li@define|create|d|remove|rem|delete|del|redefine|update|move|load|reload.contains[<context.raw_args.trim.before[ ]>]>' {
+        - if "<list[define|create|d|remove|rem|delete|del|redefine|update|move|load|reload].contains[<context.raw_args.trim.before[ ]>]>":
             - define rg_list li@
-            - foreach <server.list_worlds> {
-                - define rg_list <def[rg_list].include[<def[value].list_regions>]>
+            - foreach <server.list_worlds>:
+                - define rg_list <[rg_list].include[<[value].list_regions>]>
-            }
             - define add li@
-            - foreach <def[rg_list].exclude[<server.flag[worldguard_to_notable_cuboids].as_list||li@>]> {
-                - note <def[value].cuboid> as:wgregion_W_<def[value].world.name>_R_<def[value].id>
-                - define add <def[add].include[<def[value]>]>
+            - foreach <[rg_list].exclude[<server.flag[worldguard_to_notable_cuboids]||li@>]>:
+                - note <[value].cuboid> as:wgregion_W_<[value].world.name>_R_<[value].id>
+                - define add <[add].include[<[value]>]>
-            }
             - define sub li@
-            - foreach <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<def[rg_list]>]||li@> {
-                - note remove as:wgregion_W_<def[value].world.name>_R_<def[value].id>
-                - define sub <def[sub].include[<def[value]>]>
-            }
+            - foreach <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<[rg_list]>]||li@>:
+                - note remove as:wgregion_W_<[value].world.name>_R_<[value].id>
+                - define sub <[sub].include[<[value]>]>
+            - define new_list <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<[sub]>].include[<[add]>]||<[add]>>
-            - define new_list <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<def[sub]>].include[<def[add]>]||<def[add]>>
             - flag server worldguard_to_notable_cuboids:!
-            - flag server worldguard_to_notable_cuboids:|:<def[new_list]>
+            - flag server worldguard_to_notable_cuboids:|:<[new_list]>
-        }