Date: 2018/08/20 13:19:56 UTC-07: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
#connect the bot and reload
connect_vote_counter:
type: world
events:
on server start:
- discord id:vote connect code:token
on system time hourly:
- discord id:vote disconnect
- discord id:vote connect code:NDgwNDI2NzQ3NzU0NTc3OTIw.DlnpKw.FuwRmUCZUqPOcR7L-KrpqWQJllc
- discord id:vote message channel:480429497703989258 "**Bot realoaded**"
on votifier vote:
- discord id:vote message channel:480429497703989258 "**[<c.service>] <c.username> just voted. (<c.time>)**"
vote_count_yaml:
type: world
events:
on server start:
- if <server.has_file[/vote_counts/<util.date.time.month>,<util.date.time.year>.yml]> {
- yaml "load:/vote_counts/<util.date.time.month>,<util.date.time.year>" id:<util.date.time.month>,<util.date.time.year>
}
else {
- yaml create id:<util.date.time.month>,<util.date.time.year>
}
on shutdown:
- yaml "savefile:/vote_counts/<util.date.time.month>,<util.date.time.year>.yml" id:<util.date.time.month>,<util.date.time.year>
on system time 11:59:
- announce "<&8>[<&6>Auto Restart<&8>] <&4>Restarting the server in one minute."
- wait 1m
- execute as_server "restart"
on vote votifier:
- yaml id:<util.date.time.month>,<util.date.time.year> set votes.<context.username>/:++
vstart:
type: command
name: vstart
script:
- if <server.has_file[/vote_counts/<util.date.time.month>,<util.date.time.year>.yml]> {
- yaml "load:/vote_counts/<util.date.time.month>,<util.date.time.year>" id:<util.date.time.month>,<util.date.time.year>
}
else {
- yaml create id:<util.date.time.month>,<util.date.time.year>
}