Skip to content

Commit 6ef6f15

Browse files
committed
copy/paste commands update
1 parent 757a58e commit 6ef6f15

File tree

2 files changed

+44
-37
lines changed

2 files changed

+44
-37
lines changed

copy_paste_commands.dsc

+38-37
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
#
99
# @author mcmonkey
1010
# @date 2020/12/16
11-
# @denizen-build REL-1736
12-
# @script-version 1.0
11+
# @updated 2022-04-08
12+
# @denizen-build REL-1765
13+
# @script-version 2.0
1314
#
1415
# Dependencies:
15-
# Cuboid Tool script - https://forum.denizenscript.com/resources/cuboid-selector-tool.1/
16+
# Selector Tool script - https://forum.denizenscript.com/resources/cuboid-selector-tool.1/
1617
#
1718
# Installation:
18-
# Just put this script and the cuboid tool script in your scripts folder and reload.
19+
# Just put this script and the selector tool script in your scripts folder and reload.
1920
#
2021
# Usage:
21-
# Refer to the cuboid tool info for how to get and use a CTool.
22+
# Refer to the selector tool info for how to get and use a SelTool.
2223
#
2324
# Use "/ccopy" to copy your selected area (relative to where you stand).
2425
# Use "/crotate [90/180/270]" or "/cflip [x/z]" to rotate/flip the copy.
@@ -36,17 +37,17 @@ ccopy_command:
3637
description: Copies a place.
3738
permission: dscript.ccopy
3839
script:
39-
- if !<player.has_flag[ctool_selection]>:
40-
- narrate "<&c>You need a <&b>/ctool <&c>selection to use this command."
40+
- if !<player.has_flag[seltool_selection]>:
41+
- narrate "<&[error]>You need a <&[emphasis]>/seltool <&[error]>selection to use this command."
4142
- stop
4243
- if <schematic[<player.uuid>_copy].exists>:
43-
- narrate "<&c>Forgetting previously copied area."
44+
- narrate "<&[error]>Forgetting previously copied area."
4445
- schematic unload name:<player.uuid>_copy
45-
- narrate <&2>Copying...
46+
- narrate <&[base]>Copying...
4647
- flag player copying duration:1d
47-
- ~schematic create name:<player.uuid>_copy <player.location.block> <player.flag[ctool_selection]> delayed flags
48+
- ~schematic create name:<player.uuid>_copy <player.location.block> area:<player.flag[seltool_selection]> delayed flags
4849
- flag player copying:!
49-
- narrate <&2>Copied.
50+
- narrate <&[base]>Copied.
5051

5152
cpaste_command:
5253
type: command
@@ -57,17 +58,17 @@ cpaste_command:
5758
permission: dscript.cpaste
5859
script:
5960
- if !<schematic[<player.uuid>_copy].exists>:
60-
- narrate "<&c>You must copy something with <&b>/copy <&2>or <&b>/cload <&2>first."
61+
- narrate "<&[error]>You must copy something with <&[emphasis]>/copy <&[base]>or <&[emphasis]>/cload <&[base]>first."
6162
- stop
6263
- if <player.has_flag[copying]>:
63-
- narrate "<&c>You must wait until the copying is complete before you can paste."
64+
- narrate "<&[error]>You must wait until the copying is complete before you can paste."
6465
- stop
65-
- narrate <&2>Pasting...
66+
- narrate <&[base]>Pasting...
6667
- if <context.args.first||null> == noair:
6768
- ~schematic paste name:<player.uuid>_copy <player.location.block> noair delayed
6869
- else:
6970
- ~schematic paste name:<player.uuid>_copy <player.location.block> delayed
70-
- narrate <&2>Pasted.
71+
- narrate <&[base]>Pasted.
7172

7273
cpreview_command:
7374
type: command
@@ -78,21 +79,21 @@ cpreview_command:
7879
permission: dscript.cpreview
7980
script:
8081
- if !<schematic[<player.uuid>_copy].exists>:
81-
- narrate "<&c>You must copy something with <&b>/copy <&2>or <&b>/cload <&2>first."
82+
- narrate "<&[error]>You must copy something with <&[emphasis]>/copy <&[base]>or <&[emphasis]>/cload <&[base]>first."
8283
- stop
8384
- if <player.has_flag[copying]>:
84-
- narrate "<&c>You must wait until the copying is complete before you can paste."
85+
- narrate "<&[error]>You must wait until the copying is complete before you can paste."
8586
- stop
86-
- narrate <&2>Pasting...
87+
- narrate <&[base]>Pasting...
8788
- define duration <context.args.first||10s>
8889
- if <duration[<[duration]>]||null> == null:
89-
- narrate "<&c>That preview duration is invalid."
90+
- narrate "<&[error]>That preview duration is invalid."
9091
- stop
9192
- if <context.args.get[2]> == noair:
92-
- ~schematic paste name:<player.uuid>_copy <player.location.block> noair delayed fake_to:<player.location.find.players.within[200]> fake_duration:<[duration]>
93+
- ~schematic paste name:<player.uuid>_copy <player.location.block> noair delayed fake_to:<player.location.find_players_within[200]> fake_duration:<[duration]>
9394
- else:
94-
- ~schematic paste name:<player.uuid>_copy <player.location.block> delayed fake_to:<player.location.find.players.within[200]> fake_duration:<[duration]>
95-
- narrate <&2>Pasted.
95+
- ~schematic paste name:<player.uuid>_copy <player.location.block> delayed fake_to:<player.location.find_players_within[200]> fake_duration:<[duration]>
96+
- narrate <&[base]>Pasted.
9697

9798
cload_command:
9899
type: command
@@ -103,17 +104,17 @@ cload_command:
103104
permission: dscript.cload
104105
script:
105106
- if <context.args.is_empty>:
106-
- narrate "<&c>/cload [name]"
107+
- narrate "<&[error]>/cload [name]"
107108
- stop
108109
- define name <context.args.first.escaped>
109110
- if !<server.has_file[schematics/<[name]>.schem]>:
110-
- narrate "<&c>Unknown area save."
111+
- narrate "<&[error]>Unknown area save."
111112
- stop
112113
- if <schematic[<player.uuid>_copy].exists>:
113-
- narrate "<&c>Forgetting previously copied area."
114+
- narrate "<&[error]>Forgetting previously copied area."
114115
- schematic unload name:<player.uuid>_copy
115116
- ~schematic load name:<player.uuid>_copy filename:<[name]> delayed
116-
- narrate <&2>Loaded.
117+
- narrate <&[base]>Loaded.
117118

118119
csave_command:
119120
type: command
@@ -124,16 +125,16 @@ csave_command:
124125
permission: dscript.csave
125126
script:
126127
- if <context.args.is_empty>:
127-
- narrate "<&c>/csave [name]"
128+
- narrate "<&[error]>/csave [name]"
128129
- stop
129130
- if !<schematic[<player.uuid>_copy].exists>:
130-
- narrate "<&c>You must copy something with <&b>/copy <&2>or <&b>/cload <&2>first."
131+
- narrate "<&[error]>You must copy something with <&[emphasis]>/copy <&[base]>or <&[emphasis]>/cload <&[base]>first."
131132
- stop
132133
- define name <context.args.first.escaped>
133134
- if <server.has_file[schematics/<[name]>.schem]>:
134-
- narrate "<&c>Overwriting existing area save."
135+
- narrate "<&[error]>Overwriting existing area save."
135136
- ~schematic save name:<player.uuid>_copy filename:<[name]> delayed
136-
- narrate <&2>Saved.
137+
- narrate <&[base]>Saved.
137138

138139
cflip_command:
139140
type: command
@@ -144,17 +145,17 @@ cflip_command:
144145
permission: dscript.cflip
145146
script:
146147
- if !<schematic[<player.uuid>_copy].exists>:
147-
- narrate "<&c>You must copy something with <&b>/copy <&2>or <&b>/cload <&2>first."
148+
- narrate "<&[error]>You must copy something with <&[emphasis]>/copy <&[base]>or <&[emphasis]>/cload <&[base]>first."
148149
- stop
149150
- choose <context.args.first||null>:
150151
- case x:
151152
- ~schematic name:<player.uuid>_copy flip_x delayed
152-
- narrate "<&2>Flipped your copy around the X axis."
153+
- narrate "<&[base]>Flipped your copy around the X axis."
153154
- case z:
154155
- ~schematic name:<player.uuid>_copy flip_z delayed
155-
- narrate "<&2>Flipped your copy around the Z axis."
156+
- narrate "<&[base]>Flipped your copy around the Z axis."
156157
- default:
157-
- narrate "<&c>/cflip [x/z]"
158+
- narrate "<&[error]>/cflip [x/z]"
158159

159160
crotate_command:
160161
type: command
@@ -165,10 +166,10 @@ crotate_command:
165166
permission: dscript.crotate
166167
script:
167168
- if !<schematic[<player.uuid>_copy].exists>:
168-
- narrate "<&c>You must copy something with <&b>/copy <&2>or <&b>/cload <&2>first."
169+
- narrate "<&[error]>You must copy something with <&[emphasis]>/copy <&[base]>or <&[emphasis]>/cload <&[base]>first."
169170
- stop
170171
- if !<list[90|180|270].contains[<context.args.first||null>]>:
171-
- narrate "<&c>/crotate [90/180/270]"
172+
- narrate "<&[error]>/crotate [90/180/270]"
172173
- stop
173174
- ~schematic name:<player.uuid>_copy rotate angle:<context.args.first> delayed
174-
- narrate "<&2>Rotated your copy by <&b><context.args.first><&2>."
175+
- narrate "<&[base]>Rotated your copy by <&[emphasis]><context.args.first><&[base]>."

selector_tool.dsc

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
# Use "/selshow" to show your current cuboid selection.
3333
# Requirers permission "selector_tool.selshow"
3434
#
35+
# If you have Depenizen and WorldEdit, this will automatically send your selections to WorldEdit as well.
36+
#
3537
# In a script or "/ex" command, use "<player.has_flag[seltool_selection]>" to check if the player has a selection.
3638
# and "<player.flag[seltool_selection]>" to get the selected area.
3739
# Flag "seltool_type" defines the current selection type (cuboid, ellipsoid, sphere, polygon).
@@ -243,6 +245,8 @@ selector_tool_leftclick_task:
243245
- case polygon:
244246
- flag player seltool_selection:<list[<context.location>].to_polygon.include_y[<context.location.y.add[2]>]>
245247
- inject selector_tool_status_task path:<[type]>
248+
- if <plugin[Depenizen].exists> && <plugin[WorldEdit].exists>:
249+
- adjust <player> we_selection:<player.flag[seltool_selection]>
246250
- determine cancelled
247251

248252
selector_tool_world:
@@ -274,6 +278,8 @@ selector_tool_world:
274278
- case polygon:
275279
- flag player seltool_selection:<player.flag[seltool_selection].with_corner[<context.location>].include_y[<context.location.y>]>
276280
- inject selector_tool_status_task path:<[type]>
281+
- if <plugin[Depenizen].exists> && <plugin[WorldEdit].exists>:
282+
- adjust <player> we_selection:<player.flag[seltool_selection]>
277283
- determine cancelled
278284
# Prevent misuse
279285
after player drops selector_tool_item:

0 commit comments

Comments
 (0)