Date: 2019/10/30 12:26:13 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
menu:
type: world
debug: true
events:
on player quit:
- flag player scoreboard:false
# Start the Undo Command stuff
#- if <yaml.list>:
# clear the undo list
on server start:
- flag server start_time:<server.current_time_millis>
# Start the Undo Command stuff
- inject locally "events.on reload scripts"
on reload scripts:
# Start the Undo Command stuff
- if <yaml.list> !contains editor_undo:
- if <server.has_file[editor_undo]>:
- yaml load:editor_undo.yml id:editor_undo
- else:
- yaml create id:editor_undo
on player joins:
#make a yaml file entry to store a list of locations/materials for an undo command
- narrate "<s@editor_undo.contains[<player.name>]>"
# If the file does not have an entry for the player, make one
- if <editor_undo.contains[<player.name>]> == false:
# Set an entry
- yaml id:editor_undo set editor_undo.<player.name>:true
# Save it so I can look at it and say hrmmm why still not work
- yaml savefile:editor_undo.yml id:editor_undo
- wait 2s
# Cmon baby I know its in there....
- narrate "set to <s@editor_undo.contains[<player.name>]>"
on undo command:
- determine passively FULFILLED
- if !<player.is_op>:
- queue clear
- else:
- inject locally "events.on player joins"