SHARE
TWEET

Auto Inventory

Cosm Nov 24th, 2018 (edited) 231 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmd add autoinv load %whiteareas%
  2. cmd add autoinv if varset(%args%[1]) then goto 5
  3. cmd add autoinv message %p% INVALID USE! /autoinv help!
  4. cmd add autoinv exit
  5. cmd add autoinv if %args%[1] = \"break\" then goto 113
  6. cmd add autoinv let %status% = playerstatus(%p%)
  7. cmd add autoinv if %status%["op"] = %true% then goto 10
  8. cmd add autoinv message %p% You do not have permission to use this command!
  9. cmd add autoinv exit
  10. cmd add autoinv if %args%[1] = \"create\" then goto 17
  11. cmd add autoinv if %args%[1] = \"whitelist\" then goto 32
  12. cmd add autoinv if %args%[1] = \"delete\" then goto 60
  13. cmd add autoinv if %args%[1] = \"list\" then goto 71
  14. cmd add autoinv if %args%[1] = \"tp\" then goto 83
  15. cmd add autoinv if %args%[1] = \"help\" then goto 111
  16. cmd add autoinv goto 3
  17. cmd add autoinv let %count% = 0
  18. cmd add autoinv let %count% = %count% + 1
  19. cmd add autoinv let %index% = \"area\" + %count%
  20. cmd add autoinv if varset(%whiteareas%[%index%]) then goto 18
  21. cmd add autoinv let %coords%["x1"] = 0
  22. cmd add autoinv let %coords%["y1"] = 0
  23. cmd add autoinv let %coords%["z1"] = 0
  24. cmd add autoinv let %coords%["x2"] = 0
  25. cmd add autoinv let %coords%["y2"] = 0
  26. cmd add autoinv let %coords%["z2"] = 0
  27. cmd add autoinv let %coords%["level"] = 0
  28. cmd add autoinv let %whiteareas%[%index%] = %coords%
  29. cmd add autoinv save %whiteareas%
  30. cmd add autoinv message %p% %index% has been made successfully!
  31. cmd add autoinv exit
  32. cmd add autoinv if (varset(%args%[2])) and (varset(%args%[3])) and (varset(%args%[4])) and (varset(%args%[5])) and (varset(%args%[6])) and (varset(%args%[7])) and (varset(%args%[8])) then goto 35
  33. cmd add autoinv message %p% Usage: /autoinv whitelist <area-name> <x1> <y1> <z1> <x2> <y2> <z2>
  34. cmd add autoinv exit
  35. cmd add autoinv let %index% = %args%[2]
  36. cmd add autoinv if varset(%whiteareas%[%index%]) then goto 39
  37. cmd add autoinv message %p% This is not a valid area!
  38. cmd add autoinv exit
  39. cmd add autoinv let %x1% = %args%[3]
  40. cmd add autoinv let %y1% = %args%[4]
  41. cmd add autoinv let %z1% = %args%[5]
  42. cmd add autoinv let %x2% = %args%[6]
  43. cmd add autoinv let %y2% = %args%[7]
  44. cmd add autoinv let %z2% = %args%[8]
  45. cmd add autoinv if (%x1% > -4859483243) and (%x1% > -4859483243) and (%y1% > -4859483243) and (%z1% > -4859483243) and (%x2% > -4859483243) and (%y2% > -4859483243) and (%z2% > -4859483243) then goto 48
  46. cmd add autoinv message %p% Invalid coordinates!
  47. cmd add autoinv exit
  48. cmd add autoinv let %coords% = %whiteareas%[%index%]
  49. cmd add autoinv let %coords%["x1"] = %x1%
  50. cmd add autoinv let %coords%["y1"] = %y1%
  51. cmd add autoinv let %coords%["z1"] = %z1%
  52. cmd add autoinv let %coords%["x2"] = %x2%
  53. cmd add autoinv let %coords%["y2"] = %y2%
  54. cmd add autoinv let %coords%["z2"] = %z2%
  55. cmd add autoinv let %coords%["level"] = %level%
  56. cmd add autoinv let %whiteareas%[%index%] = %coords%
  57. cmd add autoinv save %whiteareas%
  58. cmd add autoinv message %p% %index% coordinates has been changed!
  59. cmd add autoinv exit
  60. cmd add autoinv if varset(%args%[2]) then goto 63
  61. cmd add autoinv message %p% Usage: /autoinv delete <area-name>
  62. cmd add autoinv exit
  63. cmd add autoinv let %index% = %args%[2]
  64. cmd add autoinv if varset(%whiteareas%[%index%]) then goto 67
  65. cmd add autoinv message %p% This is not a valid area!
  66. cmd add autoinv exit
  67. cmd add autoinv let %whiteareas%[%index%] =
  68. cmd add autoinv save %whiteareas%
  69. cmd add autoinv message %p% %index% has been deleted!
  70. cmd add autoinv exit
  71. cmd add autoinv let %counter% = 0
  72. cmd add autoinv let %areas% = 0
  73. cmd add autoinv let %counter% = %counter% + 1
  74. cmd add autoinv if %counter% = 200 then goto 80
  75. cmd add autoinv let %index% = \"area\" + %counter%
  76. cmd add autoinv if varset(%whiteareas%[%index%]) = %false% then goto 73
  77. cmd add autoinv let %areas% = %areas% + 1
  78. cmd add autoinv let %msg%[] = %areas% + \". \" + %index%
  79. cmd add autoinv goto 73
  80. cmd add autoinv let %msg% = join(%msg%, \"\\n\")
  81. cmd add autoinv message %p% \"Areas:\\n\" + %msg%
  82. cmd add autoinv exit
  83. cmd add autoinv if varset(%args%[2]) then goto 86
  84. cmd add autoinv message %p% Usage: /autoinv delete <area-name>
  85. cmd add autoinv exit
  86. cmd add autoinv let %index% = %args%[2]
  87. cmd add autoinv if varset(%whiteareas%[%index%]) then goto 90
  88. cmd add autoinv message %p% This is not a valid area!
  89. cmd add autoinv exit
  90. cmd add autoinv let %coords% = %whiteareas%[%index%]
  91. cmd add autoinv let %bx1% = %coords%["x1"]
  92. cmd add autoinv let %by1% = %coords%["y1"]
  93. cmd add autoinv let %bz1% = %coords%["z1"]
  94. cmd add autoinv let %bx2% = %coords%["x2"]
  95. cmd add autoinv let %by2% = %coords%["y2"]
  96. cmd add autoinv let %bz2% = %coords%["z2"]
  97. cmd add autoinv let %world% = %coords%["level"]
  98. cmd add autoinv let %new-x% = ((%bx1% + %bx2%)/2)
  99. cmd add autoinv let %new-z% = ((%bz1% + %bz2%)/2)
  100. cmd add autoinv let %new-y% = ((%by1% + %by2%)/2)
  101. cmd add autoinv goto 104
  102. cmd add autoinv message %p% Area coordinates has not been set!
  103. cmd add autoinv exit
  104. cmd add autoinv let %block% = blockinfo(%world%, %new-x%, %new-y%, %new-z%)
  105. cmd add autoinv if %block%["id"] = 0 then goto 108
  106. cmd add autoinv let %new-y% = %new-y% + 1
  107. cmd add autoinv goto 104
  108. cmd add autoinv move %p% %world% %new-x% %new-y% %new-z%
  109. cmd add autoinv message %p% Teleported to %index%!
  110. cmd add autoinv exit
  111. cmd add autoinv message %p% \"§aAuto inventory commands (1/1):\\n§2/autoinv create §7- registers an area\\n§2/autoinv whitelist <area-name> <x1> <y1> <z1> <x2> <y2> <z2> §7- whitelist the registered area\\n§2/autoinv delete <area> §7- deletes a registered area\\n§2/autoinv tp <area> §7- tps to registered area (if coordinates has been set)\\n§2/autoinv list §7- list all registered area\"
  112. cmd add autoinv exit
  113. cmd add autoinv let %bx% = %args%[4]
  114. cmd add autoinv let %by% = %args%[5]
  115. cmd add autoinv let %bz% = %args%[6]
  116. cmd add autoinv let %counter% = 0
  117. cmd add autoinv let %counter% = %counter% + 1
  118. cmd add autoinv if %counter% = 200 then exit
  119. cmd add autoinv let %index% = \"area\" + %counter%
  120. cmd add autoinv if varset(%whiteareas%[%index%]) = %false% then goto 117
  121. cmd add autoinv let %area% = %whiteareas%[%index%]
  122. cmd add autoinv let %world% = %area%["level"]
  123. cmd add autoinv if %level% != %world% then goto 117
  124. cmd add autoinv let %x1% = %area%["x1"]
  125. cmd add autoinv let %y1% = %area%["y1"]
  126. cmd add autoinv let %z1% = %area%["z1"]
  127. cmd add autoinv let %x2% = %area%["x2"]
  128. cmd add autoinv let %y2% = %area%["y2"]
  129. cmd add autoinv let %z2% = %area%["z2"]
  130. cmd add autoinv let %bx1% = %x1%
  131. cmd add autoinv let %bx2% = %x2%
  132. cmd add autoinv if %x1% < %x2% then let %bx1% = %x2%
  133. cmd add autoinv if %x1% < %x2% then let %bx2% = %x1%
  134. cmd add autoinv let %by1% = %y1%
  135. cmd add autoinv let %by2% = %y2%
  136. cmd add autoinv if %y1% < %y2% then let %by1% = %y2%
  137. cmd add autoinv if %y1% < %y2% then let %by2% = %y1%
  138. cmd add autoinv let %bz1% = %z1%
  139. cmd add autoinv let %bz2% = %z2%
  140. cmd add autoinv if %z1% < %z2% then let %bz1% = %z2%
  141. cmd add autoinv if %z1% < %z2% then let %bz2% = %z1%
  142. cmd add autoinv if %bx% > %bx1% then goto 117
  143. cmd add autoinv if %by% > %by1% then goto 117
  144. cmd add autoinv if %bz% > %bz1% then goto 117
  145. cmd add autoinv if %bx% < %bx2% then goto 117
  146. cmd add autoinv if %by% < %by2% then goto 117
  147. cmd add autoinv if %bz% < %bz2% then goto 117
  148. cmd add autoinv if %gm% = 1 then exit
  149. cmd add autoinv let %block% = blockinfo(%level%, %bx%, %by%, %bz%)
  150. cmd add autoinv if %block%["name"] = \"Stone\" then let %block%["id"] = 4
  151. cmd add autoinv if (%block%["id"] = 161) or (%block%["id"] = 18) or (%block%["id"] = 241) then exit
  152. cmd add autoinv if %block%["id"] = 2 then let %block%["id"] = 3
  153. cmd add autoinv if (%block%["id"] = 95) or (%block%["name"] = \"Glass\") or (%block%["id"] = 102) or (%block%["id"] = 160) then exit
  154. cmd add autoinv if %block%["name"] = \"Oak Wood\" then let %block%["variant"] = 0
  155. cmd add autoinv if %block%["name"] = \"Spruce Wood\" then let %block%["variant"] = 1
  156. cmd add autoinv if %block%["name"] = \"Birch Wood\" then let %block%["variant"] = 2
  157. cmd add autoinv if %block%["name"] = \"Jungle Wood\" then let %block%["variant"] = 3
  158. cmd add autoinv if %block%["name"] = \"Acacia Wood\" then let %block%["variant"] = 0
  159. cmd add autoinv if %block%["name"] = \"Dark Oak Wood\" then let %block%["variant"] = 1
  160. cmd add autoinv let %stairs% = array(53,67,108,109,114,128134,135,136,156,163,164,180,203)
  161. cmd add autoinv if %block%["id"] in %stairs% then let %block%["variant"] = 0
  162. cmd add autoinv let %ran% = 1
  163. cmd add autoinv if (%block%["id"] = 21) then let %ran% = random(4, 8)
  164. cmd add autoinv if (%block%["id"] = 73) or (%block%["id"] = 74) then let %ran% = random(4, 5)
  165. cmd add autoinv if %block%["id"] = 89 then let %ran% = random(3, 4)
  166. cmd add autoinv if (%block%["id"] = 21) then let %block%["id"] = 351
  167. cmd add autoinv if (%block%["id"] = 73) or (%block%["id"] = 74) then let %block%["id"] = 331
  168. cmd add autoinv if %block%["id"] = 89 then let %block%["id"] = 348
  169. cmd add autoinv if %block%["id"] = 351 then let %block%["variant"] = 4
  170. cmd add autoinv if %block%["id"] = 14 then let %block%["id"] = 266
  171. cmd add autoinv if %block%["id"] = 15 then let %block%["id"] = 265
  172. cmd add autoinv if %block%["id"] = 56 then let %block%["id"] = 264
  173. cmd add autoinv if %block%["id"] = 16 then let %block%["id"] = 263
  174. cmd add autoinv if %block%["id"] = 129 then let %block%["id"] = 388
  175. cmd add autoinv if %block%["id"] = 153 then let %ran% = random(2,5)
  176. cmd add autoinv if %block%["id"] = 153 then let %block%["id"] = 406
  177. cmd add autoinv let %inv% = playerinventory(%p%)
  178. cmd add autoinv let %id% = %block%["id"]
  179. cmd add autoinv let %meta% = %block%["variant"]
  180. cmd add autoinv let %size% = size(%inv%)
  181. cmd add autoinv let %size% = %size% - 1
  182. cmd add autoinv if %size% = -1 then goto 194
  183. cmd add autoinv let %slot% = %inv%[%size%]
  184. cmd add autoinv if (%slot%["id"] != %id%) or (%slot%["variant"] != %meta%) then goto 181
  185. cmd add autoinv if %slot%["count"] >= 64 then goto 181
  186. cmd add autoinv let %slot%["count"] = (%slot%["count"]) + %ran%
  187. cmd add autoinv if %slot%["count"] >= 64 then let %slot%["count"] = 64
  188. cmd add autoinv let %inv%[%size%] = %slot%
  189. cmd add autoinv carry %p% %inv%
  190. cmd add autoinv cancel
  191. cmd add autoinv block %level% %bx% %by% %bz% 0
  192. cmd add autoinv ascon /particle snowballpoof %bx% %by% %bz% 0.5 0.5 0.5 10
  193. cmd add autoinv exit
  194. cmd add autoinv if size(%inv%) != 36 then goto 198
  195. cmd add autoinv tip %p% Your inventory is full!
  196. cmd add autoinv cancel
  197. cmd add autoinv goto 208
  198. cmd add autoinv if %block%["name"] = \"Stone\" then let %block%["id"] = 4
  199. cmd add autoinv let %size% = size(%inv%)
  200. cmd add autoinv let %item%["id"] = %block%["id"]
  201. cmd add autoinv let %item%["variant"] = %block%["variant"]
  202. cmd add autoinv let %item%["count"] = 1
  203. cmd add autoinv let %item%["name"] = %block%["name"]
  204. cmd add autoinv let %item%["tags"] = \"\"
  205. cmd add autoinv let %inv%[%size%] = %item%
  206. cmd add autoinv carry %p% %inv%
  207. cmd add autoinv cancel
  208. cmd add autoinv block %level% %bx% %by% %bz% 0
  209. cmd add autoinv ascon /particle snowballpoof %bx% %by% %bz% 0.5 0.5 0.5 10
  210. cmd add autoinv exit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top