Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dRestaurantCommand:
- type: command
- debug: false
- name: drestaurant
- description: Commands to create and manage dRestaurants.
- usage: <&nl>/drestaurant <<>tool<>><&nl>/drestaurant <<>create<>> <<>name<>><&nl>/drestaurant <<>edit<>> <<>name<>><&nl>/drestaurant <<>delete<>> <<>name<>><&nl>/drestaurant <<>hire<>> <<>waitress/chef<>><&nl>/drestaurant <<>fire<>> <<>waitress/chef<>><&nl>/drestaurant <<>buy<>> <<>restaurant<>><&nl>/drestaurant <<>sell<>> <<>restaurant<>>
- aliases:
- - restaurant
- - dr
- - drest
- allowed help:
- - determine <player.has_permission[dRestaurant.user]>
- # This is what is run when someone types the root command. This subscript
- # quickly passes the command on to the command argument handlers below. If the
- # argument doesn't exist, or is not specified, it runs the help subscript.
- script:
- - define arg1 '<c.args.get[1].escaped||help>'
- - define args 'li@help|tool|create|edit|delete|chunkLoad'
- - if !<def[args].contains[%arg1%]> inject locally help
- else inject locally %arg1%
- #
- # END dRestaurant Command Script Basics
- #--------------------------------------
- #
- # dRestaurant Command Arguments
- #
- # Each of these subscripts is an argument for the root command.
- #
- help:
- - if <player.has_permission[dRestaurant.create]> inject locally msgsHelpAdmin instantly
- else inject locally msgsHelpUser instantly
- - define footerText '<&f><&sp><&sp>Authors<&co> <&7>|Anthony| <&7>calico-kid'
- - inject locally msgsFooter instantly
- - queue stop
- tool:
- - if <player.has_permission[dRestaurant.create]> {
- - give i@dRestaurantTool
- - narrate "<&b><&l>dRestaurant<&co><&r> <&a>Right click to select pos1"
- - narrate "<&b><&l>dRestaurant<&co><&r> <&a>Left click to select pos2"
- - queue stop
- }
- create:
- - if <player.has_permission[dRestaurant.create]> {
- - define name '<c.args.get[2].escaped||null>'
- - if <def[name].is[==].to[null]> {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
- - queue stop
- }
- - if <cu@restaurant_%name%||null> != null {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>There is already a restaurant by this name!"
- - queue stop
- }
- - define pos1 <player.flag[dRestaurantToolPOS1]||null>
- - define pos2 <player.flag[dRestaurantToolPOS2]||null>
- - if <def[pos1].is[==].to[null]>
- || <def[pos2].is[==].to[null]> {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>You must use the dRestaurant region tool to select 2 locations!"
- - queue stop
- }
- - take i@dRestaurantTool
- - note cu@%pos1%|%pos2% 'as:restaurant_%name%'
- - note in@menuinventory as:%name%
- - flag server dRestaurant.%name%.Owner:<player>
- - flag player dRestaurantToolPOS1:!
- - flag player dRestaurantToolPOS2:!
- - narrate "dRestaurant<&co> %name% region created!"
- }
- edit:
- - define name '<c.args.get[2].escaped||null>'
- - if <player.has_permission[dRestaurant.admin]>
- || <el@val[<player.has_permission[dRestaurant.edit]>].and[<server.flag[dRestaurant.%name%.Owner].is[==].to[<player>]>]> {
- - if <def[name].is[==].to[null]> {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
- - queue stop
- }
- - if <cu@restaurant_%name%||null> == null {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>There is no restaurant by this name!"
- - queue stop
- }
- - define pos1 <player.flag[dRestaurantToolPOS1]||null>
- - define pos2 <player.flag[dRestaurantToolPOS2]||null>
- - if <def[pos1].is[==].to[null]>
- || <def[pos2].is[==].to[null]> {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>You must use the dRestaurant region tool to select 2 locations!"
- - queue stop
- }
- - take i@dRestaurantTool
- - note cu@%pos1%|%pos2% 'as:restaurant_%name%'
- - narrate "dRestaurant<&co> %name% region updated!"
- - flag player dRestaurantToolPOS1:!
- - flag player dRestaurantToolPOS2:!
- }
- delete:
- - define name '<c.args.get[2].escaped||null>'
- - if <player.has_permission[dRestaurant.admin]>
- || <el@val[<player.has_permission[dRestaurant.create]>].and[<server.flag[dRestaurant.%name%.Owner].is[==].to[<player>]>]> {
- - if <def[name].is[==].to[null]> {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
- - queue stop
- }
- - if <cu@restaurant_%name%||null> == null {
- - narrate "<&4><&l>ERROR<&co><&r> <&a>There is no restaurant by this name!"
- - queue stop
- }
- - note remove 'as:restaurant_%name%'
- - flag server dRestaurant.%name%:!
- - narrate "dRestaurant<&co> %name% removed!"
- }
- chunkLoad:
- - if !<player.has_permission[dRestaurant.admin]> queue clear
- - define dRestaurants <server.list_flags[dRestaurant.].parse[split[.].get[1|2].replace[dRestaurant].with[cu@restaurant].replace[|].with[_].replace[li@].to_lowercase].deduplicate>
- - if <def[dRestaurants].is_empty||true> queue clear
- - define chunks <def[dRestaurants].parse[list_partial_chunks.replace[li@]]||li@>
- - define chunksWorld <def[chunks].filter[world.is[==].to[<player.world>]]||li@>
- - foreach %chunksWorld% {
- - chunkload add %value%
- - run s@dRestaurantMsg 'def:<&5>Loading chunk <&f><def[value]>' instantly
- }
- fire:
- - stub
- buy:
- - stub
- sell:
- - stub
- #
- # END dRestaurant Command Arguments
- #--------------------------------------
- #
- # dRestaurant Command Messages
- #
- # These are not complete! They are mostly just stubs till the rest is fleshed out!
- #
- msgsHeader:
- - ^narrate "<&5>|----------------------------------------|"
- - ^narrate "<&5>|<&sp><&sp><&sp><&6>dRestaurant <&7>%msgsHeaderTitle%"
- - ^narrate "<&5>|<&sp><&sp><&sp><&e>MineConomy <&f>Exclusive"
- - ^narrate "<&5>|<&f>"
- msgsFooter:
- - ^define anthony "text:'<&7>|Anthony|',clickEvent:{action:open_url,value:'http://mineconomy.org'},hoverEvent:{action:show_item,value:'{<i@AnthonyBanner.json>}'}"
- - ^define calico "text:'<&7>calico-kid',clickEvent:{action:open_url,value:'http://google.com'},hoverEvent:{action:show_item,value:'{<i@CalicoBanner.json>}'}"
- - ^define spacer "text:' '"
- - ^define prefix "text:'<&5>| <&f>Authors: '"
- - ^execute as_server "tellraw <player.name> {text:'',extra:[{%prefix%},{%anthony%},{%spacer%},{%calico%}]}"
- - ^narrate "<&d>|-----------S-c-r-o-l-l---U-p-------------|"
- msgsHelpAdmin:
- - define msgsHeaderTitle 'Admin Help'
- - inject locally msgsHeader instantly
- - ^narrate "<&5>|<&sp><&sp><&sp><&f>You can create restaurants and staff"
- - ^narrate "<&5>|<&sp><&sp><&f>them with chefs and waitresses that will"
- - ^narrate "<&5>|<&sp><&sp><&f>automagically tend to your guests. Just"
- - ^narrate "<&5>|<&sp><&sp><&f>keep your restaurant stocked with the"
- - ^narrate "<&5>|<&sp><&sp><&f>materials for your menu and have the"
- - ^narrate "<&5>|<&sp><&sp><&f>proper kitchen equipment."
- - ^narrate "<&5>|<&sp><&f>"
- msgsHelpUser:
- - define msgsHeaderTitle 'User Help'
- - inject locally msgsHeader instantly
- - ^narrate "<&5>|<&sp><&sp><&sp><&sp><&f>dRestaurant brings a realistic restaurant"
- - ^narrate "<&5>|<&sp><&sp><&f>experience to Minecraft. Fully automated NPCs will"
- - ^narrate "<&5>|<&sp><&sp><&f>serve your customers and prepare their food."
- - ^narrate "<&5>|<&sp><&f>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement