a333c

Untitled

Jul 16th, 2019
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. #Directions etc.
  2.  
  3. function fillDir(p: player, block: String, world: String, d: direction, x: String, y: String, z: String, loc2: location, xa: number, ya: number, za: number):
  4. set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
  5.  
  6. clear {scematic::block::%{_p}%::types::*}
  7.  
  8.  
  9. #addDir({_d}, {_xa} parsed as a number, {_ya} parsed as a number, {_za} parsed as a number, {_loc2})
  10. set {_loc2} to addDir({_world}, {_d}, {_xa}, {_ya}, {_loc2})
  11. send "Loc1: %{_loc1}%" to console
  12. send "Loc2: %{_loc2}%" to console
  13. loop blocks between block at {_loc1} and block at {_loc2}:
  14. add "%location of loop-block%$%loop-block%" to {scematic::block::%{_p}%::types::*}
  15.  
  16. if loop-block is air:
  17. set block at location of loop-block to green glass block
  18.  
  19. else:
  20. set block at location of loop-block to red glass block
  21.  
  22.  
  23. #function fillDir(x: String, y: String, z: String, loc2: location, world: String, block: String, p: player):
  24. #set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
  25. #if {_block} is "scematic_dirt_machine":
  26. # clear {scematic::block::%{_p}%::types::*}
  27. # loop blocks between block at {_loc1} and block at {_loc2}:
  28. # add "%location of loop-block%$%loop-block%" to {scematic::block::%{_p}%::types::*}
  29.  
  30. # if loop-block is air:
  31. # set block at location of loop-block to green glass block
  32.  
  33. # else:
  34. # set block at location of loop-block to red glass block
  35.  
  36. function addDir(w: string, final: direction, rem: number, yrem: number, l: location) :: location:
  37.  
  38. #add {_l} to {_list::*}
  39. #set {_loc} to {_list::1}
  40. #set {_type} to {_list::2}
  41. #set {_loc::*} to {_loc} split at ","
  42.  
  43. #set {_x} to {_loc::1}
  44. #set {_y} to {_loc::2}
  45. #set {_z} to {_loc::3}
  46. #replace "x: " in {_x} with ""
  47. #replace " y: " in {_y} with ""
  48. #replace " z: " in {_z} with ""
  49. send "Running..." to console
  50. #loop split "%{_dir}%" by "and":
  51. # if {_dir} is not set:
  52. # set {_dir} to numbersIn(loop-value)
  53. # set {_final} to loop-value
  54.  
  55. # else if numbersIn(loop-value) > {_dir}:
  56. # set {_dir} to numbersIn(loop-value)
  57. # set {_final} to loop-value
  58.  
  59. send "Running..." to console
  60. loop split "%{_l}%" by ",":
  61.  
  62. if loop-value contains "x:":
  63. set {_x} to loop-value parsed as a number
  64. replace "x:" in {_x} with ""
  65. if loop-value contains "y:":
  66. set {_y} to loop-value parsed as a number
  67. replace " y:" in {_y} with ""
  68. if loop-value contains "z:":
  69. set {_z} to loop-value parsed as a number
  70. replace " z:" in {_z} with ""
  71. #send "%loop-value%" to console
  72.  
  73. send "%{_final}%" to console
  74. if {_final} is north:
  75. send "Before: %{_z}%" to console
  76. send "%{_rem}%" to console
  77. add {_rem} to {_z}
  78. send "After: %{_z}%" to console
  79.  
  80. if {_final} is east:
  81. send "Before: %{_x}%" to console
  82. send "%{_rem}%" to console
  83. add {_rem} to {_x}
  84. send "After: %{_x}%" to console
  85.  
  86. if {_final} is south:
  87. send "Before: %{_z}%" to console
  88. send "%{_rem}%" to console
  89. add {_rem} to {_z}
  90. send "After: %{_z}%" to console
  91.  
  92. if {_final} is west:
  93. send "Before: %{_x}%" to console
  94. send "%{_rem}%" to console
  95. remove {_rem} from {_x}
  96. send "After: %{_x}%" to console
  97.  
  98. send "Running..." to console
  99. add {_yrem} to {_y}
  100. set {_loc} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) in world "%{_w}%"
  101. return {_loc}
Add Comment
Please, Sign In to add comment