Date: 2017/01/29 17:19:03 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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>=<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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