- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Simple Cuboid


By sander758
Created: 2015/11/20 06:17:09 UTC-08:00 (9 years and 34 days ago)
Edited: 2016/07/12 12:44:27 UTC-07:00 (8 years and 164 days ago)
Likes: 3

Staff pick as of: 2015/11/20 06:19:42 UTC-08:00 (9 years and 34 days ago)
Denizen Version: Dev 402
Script Version: Version 1
Description:

Simple cuboid is used to simplify the maintenance of denizen cuboids. Just make sure you are OP or got the right permissions indicated in at the top of the script.
Ingame just type /chelp for a list of commands or check them here!
/ctool
/cpreview (name)
/cnew [name]
/cremove [name]
/clist [number]
/cteleport [name]

Just copy this script and add it in your denizen scripts folder and your good to go!


Download script | View raw 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
17300

#Simple cuboid by sander758
#
#Permissions
#   /ctool      - simplecuboid.tool
#   /cpreview   - simplecuboid.preview
#   /cnew       - simplecuboid.new
#   /clist      - simplecuboid.list
#   /cremove    - simplecuboid.remove
#   /cteleport  - simplecuboid.teleport
cuboid_tool:
    type: item
    material: i@stone_axe
    display name<gold>Cuboid Tool
    lore:
    - "<gray>Left click to set postion 1"
    - "<gray>Right click to set postion 2"
    
cuboid_events:
    type: world
    debug: false
    events:
        on system time hourly:
        - webget "http://morphanone.space/webizen.aspx/tracker?script=63&version=1"
        on system time minutely:
        - execute as_server "denizen save"
        on chelp command:
        - determine passively FULFILLED
        - narrate "<gold>Simple cuboid plugin by sander758"
        - narrate "<yellow> - /chelp <gray>Displays the cuboid commands"
        - narrate "<yellow> - /ctool <gray>Get the tool"
        - narrate "<yellow> - /cpreview <gold>(<yellow>name<gold><gray>Shows the outline of the specified cuboid. If no cuboid specified the outline of the current selected locations will be visible"
        - narrate "<yellow> - /cnew <gold>[<yellow>name<gold>] <gray>Create a new cuboid"
        - narrate "<yellow> - /clist <gold>[<yellow>number<gold>] <gray>List of all cuboids"
        - narrate "<yellow> - /cremove <gold>[<yellow>name<gold>] <gray>Remove a cuboid"
        - narrate "<yellow> - /cteleport <gold>[<yellow>name<gold>] <gray>Teleport to the center of the specified cuboid"
        on ctool command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.tool]> {
            - give cuboid_tool qty:1
            - narrate "<gold>Giving cuboid tool"
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        on cpreview command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.preview]> {
            - if <context.args.get[1]||nope> == nope {
                - if <pl.has_flag[cuboidToolLoc1]> && <pl.has_flag[cuboidToolLoc2]> {
                    - if <pl.flag[cuboidToolLoc1].as_location.world> == <pl.flag[cuboidToolLoc2].as_location.world> {
                        - narrate "<gold>Displaying the outline of the current selected locations"
                        - define loc1 <pl.flag[cuboidToolLoc1].as_location>
                        - define loc2 <pl.flag[cuboidToolLoc2].as_location>
                        - define locations <cu@%loc1%|%loc2%.outline>
                        - async {
                            - repeat 5 {
                                - foreach <def[locations]> {
                                    - playeffect <def[value].as_location.add[0.5,-0.5,0.5]> effect:red_dust data:0 offset:0 qty:1
                                }
                                - wait 10t
                            }
                        }
                    } else {
                        - narrate "<dark_red>Error: <red>Please select 2 locations in the same world"
                    }
                } else {
                    - narrate "<dark_red>Error: <red>Please select 2 valid locations"
                }
            } else {
                - if <context.args.get[1].as_cuboid.notable_name||nope> == nope {
                    - narrate "<dark_red>Error: <red><context.args.get[1]> doesnt exist"
                } else {
                    - narrate "<gold>Displaying the outline of <yellow><context.args.get[1]>"
                    - define locations <context.args.get[1].as_cuboid.outline>
                    - async {
                        - repeat 5 {
                            - foreach <def[locations]> {
                                - playeffect <def[value].as_location.add[0.5,-0.5,0.5]> effect:red_dust data:0 offset:0 qty:1
                            }
                            - wait 10t
                        }
                    }
                }
                
            }
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        on cnew command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.new]> {
            - if <context.args.get[1]||nope> == nope {
                - narrate "<dark_red>Error: <red>No cuboid name specified"
            } else {
                - if <pl.has_flag[cuboidToolLoc1]> && <pl.has_flag[cuboidToolLoc2]> {
                    - if <pl.flag[cuboidToolLoc1].as_location.world> == <pl.flag[cuboidToolLoc2].as_location.world> {
                        - if <context.args.get[1].as_cuboid.notable_name||nope> == nope {
                            - narrate "<gold>Created a new cuboid as <red><context.args.get[1]>"
                            - note cu@<pl.flag[cuboidToolLoc1].split[l@].get[2]>|<pl.flag[cuboidToolLoc2].split[l@].get[2]> as:<context.args.get[1]>
                        } else {
                            - narrate "<dark_red>Error: <red>That name already exists"
                        }
                    } else {
                        - narrate "<dark_red>Error: <red>Please select 2 locations in the same world"
                    }
                } else {
                    - narrate "<dark_red>Error: <red>Please select 2 valid locations"
                }
            }
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        on clist command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.list]> {
            - narrate "<gold>Amount of cuboids<yellow><server.list_notables[cuboids].size>"
            - narrate "<gold>List:"
            - define page <context.args.get[1]||1>
            - define first <def[page].mul_int[10].add_int[1].sub_int[10]>
            - define last <def[page].mul_int[10]>
            - foreach <server.list_notables[cuboids].alphanumeric.get[%first%].to[%last%]> {
                - narrate "<yellow><def[value].split[cu@].get[2]>"
            }
            - narrate "<gold>Page <yellow><context.args.get[1]||1><gold> of <yellow><server.list_notables[cuboids].size.div_int[10].add_int[1]> <gold>/clist [<yellow>number<gold>]"
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        on cremove command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.remove]> {
            - if <context.args.get[1]||nope> == nope {
                - narrate "<dark_red>Error: <red>No cuboid name specified"
            } else {
                - if <context.args.get[1].as_cuboid.notable_name||nope> == nope {
                    - narrate "<dark_red>Error: <red><context.args.get[1]> doesnt exist"
                } else {
                    - narrate "<gold>Removed <red><context.args.get[1]><gold> cuboid"
                    - note remove as:<context.args.get[1].as_cuboid.notable_name>
                }
            }
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        on cteleport command:
        - determine passively FULFILLED
        - if <player.is_op> || <player.has_permission[simplecuboid.teleport]>  {
            - if <context.args.get[1]||nope> == nope {
                - narrate "<dark_red>Error: <red>No cuboid name specified"
            } else {
                - if <context.args.get[1].as_cuboid.notable_name||nope> == nope {
                    - narrate "<dark_red>Error: <red><context.args.get[1]> doesnt exist"
                } else {
                    - narrate "<gold>Teleporting to the center of <yellow><context.args.get[1]>"
                    - teleport <context.args.get[1].as_cuboid.center>
                }
            }
        } else {
            - narrate "<red>You dont have permission for that command!"
        }
        
        on player right clicks block with cuboid_tool:
        - narrate "<gold>Set location 2 on <context.location>"
        - flag player cuboidToolLoc2:<context.location>
        on player left clicks block with cuboid_tool:
        - narrate "<gold>Set location 1 on <context.location>"
        - flag player cuboidToolLoc1:<context.location>
        
        on player breaks block:
        - if <pl.item_in_hand.simple> == i@CUBOID_TOOL {
            - determine passively CANCELLED
        }







View History