Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.48 KB | None | 0 0
  1. dRestaurantCommand:
  2. type: command
  3. debug: false
  4. name: drestaurant
  5. description: Commands to create and manage dRestaurants.
  6. usage: <&nl>/drestaurant <&lt>tool<&gt><&nl>/drestaurant <&lt>create<&gt> <&lt>name<&gt><&nl>/drestaurant <&lt>edit<&gt> <&lt>name<&gt><&nl>/drestaurant <&lt>delete<&gt> <&lt>name<&gt><&nl>/drestaurant <&lt>hire<&gt> <&lt>waitress/chef<&gt><&nl>/drestaurant <&lt>fire<&gt> <&lt>waitress/chef<&gt><&nl>/drestaurant <&lt>buy<&gt> <&lt>restaurant<&gt><&nl>/drestaurant <&lt>sell<&gt> <&lt>restaurant<&gt>
  7. aliases:
  8. - restaurant
  9. - dr
  10. - drest
  11. allowed help:
  12. - determine <player.has_permission[dRestaurant.user]>
  13. # This is what is run when someone types the root command. This subscript
  14. # quickly passes the command on to the command argument handlers below. If the
  15. # argument doesn't exist, or is not specified, it runs the help subscript.
  16. script:
  17. - define arg1 '<c.args.get[1].escaped||help>'
  18. - define args 'li@help|tool|create|edit|delete|chunkLoad'
  19. - if !<def[args].contains[%arg1%]> inject locally help
  20. else inject locally %arg1%
  21.  
  22. #
  23. # END dRestaurant Command Script Basics
  24. #--------------------------------------
  25. #
  26. # dRestaurant Command Arguments
  27. #
  28. # Each of these subscripts is an argument for the root command.
  29. #
  30. help:
  31. - if <player.has_permission[dRestaurant.create]> inject locally msgsHelpAdmin instantly
  32. else inject locally msgsHelpUser instantly
  33. - define footerText '<&f><&sp><&sp>Authors<&co> <&7>|Anthony| <&7>calico-kid'
  34. - inject locally msgsFooter instantly
  35. - queue stop
  36.  
  37. tool:
  38. - if <player.has_permission[dRestaurant.create]> {
  39. - give i@dRestaurantTool
  40. - narrate "<&b><&l>dRestaurant<&co><&r> <&a>Right click to select pos1"
  41. - narrate "<&b><&l>dRestaurant<&co><&r> <&a>Left click to select pos2"
  42. - queue stop
  43. }
  44.  
  45. create:
  46. - if <player.has_permission[dRestaurant.create]> {
  47. - define name '<c.args.get[2].escaped||null>'
  48. - if <def[name].is[==].to[null]> {
  49. - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
  50. - queue stop
  51. }
  52. - if <cu@restaurant_%name%||null> != null {
  53. - narrate "<&4><&l>ERROR<&co><&r> <&a>There is already a restaurant by this name!"
  54. - queue stop
  55. }
  56. - define pos1 <player.flag[dRestaurantToolPOS1]||null>
  57. - define pos2 <player.flag[dRestaurantToolPOS2]||null>
  58. - if <def[pos1].is[==].to[null]>
  59. || <def[pos2].is[==].to[null]> {
  60. - narrate "<&4><&l>ERROR<&co><&r> <&a>You must use the dRestaurant region tool to select 2 locations!"
  61. - queue stop
  62. }
  63. - take i@dRestaurantTool
  64. - note cu@%pos1%|%pos2% 'as:restaurant_%name%'
  65. - note in@menuinventory as:%name%
  66. - flag server dRestaurant.%name%.Owner:<player>
  67. - flag player dRestaurantToolPOS1:!
  68. - flag player dRestaurantToolPOS2:!
  69. - narrate "dRestaurant<&co> %name% region created!"
  70. }
  71.  
  72. edit:
  73. - define name '<c.args.get[2].escaped||null>'
  74. - if <player.has_permission[dRestaurant.admin]>
  75. || <el@val[<player.has_permission[dRestaurant.edit]>].and[<server.flag[dRestaurant.%name%.Owner].is[==].to[<player>]>]> {
  76. - if <def[name].is[==].to[null]> {
  77. - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
  78. - queue stop
  79. }
  80. - if <cu@restaurant_%name%||null> == null {
  81. - narrate "<&4><&l>ERROR<&co><&r> <&a>There is no restaurant by this name!"
  82. - queue stop
  83. }
  84. - define pos1 <player.flag[dRestaurantToolPOS1]||null>
  85. - define pos2 <player.flag[dRestaurantToolPOS2]||null>
  86. - if <def[pos1].is[==].to[null]>
  87. || <def[pos2].is[==].to[null]> {
  88. - narrate "<&4><&l>ERROR<&co><&r> <&a>You must use the dRestaurant region tool to select 2 locations!"
  89. - queue stop
  90. }
  91. - take i@dRestaurantTool
  92. - note cu@%pos1%|%pos2% 'as:restaurant_%name%'
  93. - narrate "dRestaurant<&co> %name% region updated!"
  94. - flag player dRestaurantToolPOS1:!
  95. - flag player dRestaurantToolPOS2:!
  96. }
  97.  
  98. delete:
  99. - define name '<c.args.get[2].escaped||null>'
  100. - if <player.has_permission[dRestaurant.admin]>
  101. || <el@val[<player.has_permission[dRestaurant.create]>].and[<server.flag[dRestaurant.%name%.Owner].is[==].to[<player>]>]> {
  102. - if <def[name].is[==].to[null]> {
  103. - narrate "<&4><&l>ERROR<&co><&r> <&a>You must specify a name!"
  104. - queue stop
  105. }
  106. - if <cu@restaurant_%name%||null> == null {
  107. - narrate "<&4><&l>ERROR<&co><&r> <&a>There is no restaurant by this name!"
  108. - queue stop
  109. }
  110. - note remove 'as:restaurant_%name%'
  111. - flag server dRestaurant.%name%:!
  112. - narrate "dRestaurant<&co> %name% removed!"
  113. }
  114.  
  115. chunkLoad:
  116. - if !<player.has_permission[dRestaurant.admin]> queue clear
  117. - define dRestaurants <server.list_flags[dRestaurant.].parse[split[.].get[1|2].replace[dRestaurant].with[cu@restaurant].replace[|].with[_].replace[li@].to_lowercase].deduplicate>
  118. - if <def[dRestaurants].is_empty||true> queue clear
  119. - define chunks <def[dRestaurants].parse[list_partial_chunks.replace[li@]]||li@>
  120. - define chunksWorld <def[chunks].filter[world.is[==].to[<player.world>]]||li@>
  121. - foreach %chunksWorld% {
  122. - chunkload add %value%
  123. - run s@dRestaurantMsg 'def:<&5>Loading chunk <&f><def[value]>' instantly
  124. }
  125.  
  126. fire:
  127. - stub
  128.  
  129. buy:
  130. - stub
  131.  
  132. sell:
  133. - stub
  134.  
  135. #
  136. # END dRestaurant Command Arguments
  137. #--------------------------------------
  138. #
  139. # dRestaurant Command Messages
  140. #
  141. # These are not complete! They are mostly just stubs till the rest is fleshed out!
  142. #
  143. msgsHeader:
  144. - ^narrate "<&5>|----------------------------------------|"
  145. - ^narrate "<&5>|<&sp><&sp><&sp><&6>dRestaurant <&7>%msgsHeaderTitle%"
  146. - ^narrate "<&5>|<&sp><&sp><&sp><&e>MineConomy <&f>Exclusive"
  147. - ^narrate "<&5>|<&f>"
  148.  
  149. msgsFooter:
  150. - ^define anthony "text:'<&7>|Anthony|',clickEvent:{action:open_url,value:'http://mineconomy.org'},hoverEvent:{action:show_item,value:'{<i@AnthonyBanner.json>}'}"
  151. - ^define calico "text:'<&7>calico-kid',clickEvent:{action:open_url,value:'http://google.com'},hoverEvent:{action:show_item,value:'{<i@CalicoBanner.json>}'}"
  152. - ^define spacer "text:' '"
  153. - ^define prefix "text:'<&5>| <&f>Authors: '"
  154. - ^execute as_server "tellraw <player.name> {text:'',extra:[{%prefix%},{%anthony%},{%spacer%},{%calico%}]}"
  155. - ^narrate "<&d>|-----------S-c-r-o-l-l---U-p-------------|"
  156.  
  157. msgsHelpAdmin:
  158. - define msgsHeaderTitle 'Admin Help'
  159. - inject locally msgsHeader instantly
  160. - ^narrate "<&5>|<&sp><&sp><&sp><&f>You can create restaurants and staff"
  161. - ^narrate "<&5>|<&sp><&sp><&f>them with chefs and waitresses that will"
  162. - ^narrate "<&5>|<&sp><&sp><&f>automagically tend to your guests. Just"
  163. - ^narrate "<&5>|<&sp><&sp><&f>keep your restaurant stocked with the"
  164. - ^narrate "<&5>|<&sp><&sp><&f>materials for your menu and have the"
  165. - ^narrate "<&5>|<&sp><&sp><&f>proper kitchen equipment."
  166. - ^narrate "<&5>|<&sp><&f>"
  167.  
  168. msgsHelpUser:
  169. - define msgsHeaderTitle 'User Help'
  170. - inject locally msgsHeader instantly
  171. - ^narrate "<&5>|<&sp><&sp><&sp><&sp><&f>dRestaurant brings a realistic restaurant"
  172. - ^narrate "<&5>|<&sp><&sp><&f>experience to Minecraft. Fully automated NPCs will"
  173. - ^narrate "<&5>|<&sp><&sp><&f>serve your customers and prepare their food."
  174. - ^narrate "<&5>|<&sp><&f>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement