Paste #39444: Edit of P#39423 - Edit of P#39422 - Stuff

Date: 2017/01/29 17:19:03 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


WorldEvents:
  type: world
  debug: false
  events:
    on server start:
    - run Player_Count_Refresh
    - run locally spawnloc
    - run locally start
# Just because it's sane
    - run locally announcements delay:5s

  start:
  # SQLManager expects you to have this subscript so it can restart things if needed.
  # It's also not a bad idea for you to have a command to restart your own script systems.
  # The command simply runs the start subscript. Or maybe on scripts reloaded event too.
    - define yamlName 'XPCoreSQL'
    - define scriptName '<script.name>'
    - yaml 'load:%yamlName%/XPCOreSQL.yml' 'id:%yamlName%_config'
    - inject s@XPCoreSQLTables
    - inject s@SQLManager

  spawnloc:
    - foreach <server.list_players>
      - adjust <def[value]> 'location:l@-54.5,52.1,-94.5,0,90,MainLobby'

  cuboids:
  # You really shouldn't have to recreate cuboids on every server start
    - note cu@-19,51,-114,Mainlobby|-19,58,-104,Mainlobby as:cuboid1
    - note cu@-19,51,-86,Mainlobby|-19,38,-76,Mainlobby as:cuboid2
    - note cu@-46,51,-59,Mainlobby|-36,58,-59,Mainlobby as:cuboid3
    - note cu@-64,51,-59,Mainlobby|-74,58,-59,Mainlobby as:cuboid4

  announcements:
    - define announcements 1
    - while <def[announcements].is[==].to[1]> {
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '                <&a><&l>Welcome to the XPCraft Server!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '                      <&a>Type /vote for voting links!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '       <&a>Use the server selector or portals to play games!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '             <&a>Sign up on our forums at www.xpcraft.com!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '     <&a>Click the tutorial holograms to learn about our games!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - announce '<&a>Use coupon code XPCRAFT for 50% off any store purchases!'
      - announce '<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>-<&6>-<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>='
      - wait 240s
      }

#### XPCORESQL.YML FILE ####
XPCoreSQL:
  type: task
  debug: true
  script:
  # This script is used later in this Usage guide
  - define sqlScriptName 'XPCoreSQLTables'
  - define sqlFile '<script.relative_filename>'
  - if <yaml.list.contains[%sqlScriptName%]> yaml unload 'id:%sqlScriptName%'
  - yaml 'load:%sqlFile%' 'id:%sqlScriptName%'
  - if !<yaml.list.contains[%sqlScriptName%]> {
    - announce "<&c>XPCore<&co><&b> An error occurred while loading %sqlScriptname%!" to_console
    - announce "<&b>XPCore<&co><&3> Aborting..." to_console
    - inject s@%scriptName% p:unload
    }

  tables:
    XPCoreValues:
      columns:
        ID: INT NOT NULL AUTO_INCREMENT PRIMARY KEY
        PLAYERUUID: varchar(255) NOT NULL UNIQUE
        XP: int
        CLAIMEDCODES: tinyint
        RANK: varchar(25)
        NORMALPACKS: TINYINT NOT NULL DEFAULT '0'
        SUPERPACKS: TINYINT NOT NULL DEFAULT '0'
        MEDALLIONS: INT NOT NULL DEFAULT '0'
        PLAYPOINTS: INT NOT NULL DEFAULT '0'
        TOURNAMENTPOINTS: SMALLINT NOT NULL DEFAULT '0'


# This is just a user level config file. No script container bits needed
#### XPCORESQLTABLES.YML FILE ####
config: 
  MySQL: 
    connection: 
      retry: 3 
      retryDelay: 10s 
      keepAlive: 5m 
      host: localhost 
      port: 3306 
      username: root 
      password: goeatachode
    database: Server
    tables: 
      XPCoreValues: XPCore