Paste #43307: yep...

Date: 2017/08/05 00:13:42 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


gpa_gpu_essentialsCmdListener:
  type: world
  debug: false
  events:
    on setspawn command:
    - if !<server.list_plugin_names.contains[Essentials]> || <context.server> {
      - queue clear
    }
    - define spawn_loc '<player.location.simple>'
    - if '!<yaml[gpa_gpu_config].read[essentials listener.search for safe spawn location].as_boolean||true>' {
      - goto skip_safe_search
    }
    - narrate '<&a>[GPUEssentialsHook] <&f>Wait while we sync your Essentials spawn to a usable spawn location...'
    - define y_off '1'
    - while <def[spawn_loc].below.material.is_solid.not.OR[<def[spawn_loc].material.is_solid>].OR[<def[spawn_loc].above.material.is_solid>]> {
      - if <def[spawn_loc].y> >= <def[spawn_loc].world.max_height> {
        - define y_off '-1'
      }
      else if <def[spawn_loc].y> <= 1
      {
        - narrate '<&a>[GPUEssentialsHook] <&c>Fail! <&f>This location is considered unsafe from y=0 to y=255. Cancelling command.'
        - determine 'FULFILLED'
      }
      - define spawn_loc '<def[spawn_loc].add[0,<def[y_off]>,0]>'
    }
    - narrate '<&a>[GPUEssentialsHook] <&a>Success! <&f>Found a safe spawn location.'
    - mark skip_safe_search
    - if <context.args.get[1]||default> == default {
      - adjust <player.location.world> 'grandpartyaddons.gpu.spawn_location:<def[spawn_loc]>'
      - flag server 'grandpartyaddons.spawn_location.worlds.<def[spawn_loc].world.name>:<def[spawn_loc]>'
    }
    - flag server 'grandpartyaddons.spawn_location.groups.<context.args.get[1]||default>:<def[spawn_loc]>'
    - wait '4t'
    - narrate '<&a>[GPUEssentialsHook] <&f>Saved Essentials spawn data.'

    on ping command:
    - if !<server.list_plugin_names.contains[Essentials]> || '<yaml[gpa_gpu_config].read[essentials listener.return ping number].as_boolean||true>' {
      - queue clear
    }
    - if <context.server>
    {
      - define rv_lines 'li@https&co//goo&dotgl/pN32LX|https&co//goo&dotgl/wTLLbn|https&co//goo&dotgl/WTjhYa|https&co//goo&dotgl/5SdyoD'
      - define rv_get '<util.random.int[1].to[<def[rv_lines].size>]>'
      - announce '0ms. [ <def[rv_lines].get[<def[rv_get]>].unescaped> ]' to_console
    }
    else {
      - narrate '<player.ping>ms'
    }
    - determine 'FULFILLED'