Advertisement
Zeldaboy111

Skript #216 - test

Jul 16th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 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, 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(east, 10, 10)
  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 addDirs(world: String, final: direction, rem: number, yrem: number, l: location) :: number:
  37. send "&6%{_l}%" to console
  38. loop split "%{_l}%" by ",":
  39.  
  40. if loop-value contains "x:":
  41. set {_x} to loop-value
  42. replace "x: " in {_x} with ""
  43. if loop-value contains "y:":
  44. set {_y} to loop-value
  45. replace " y: " in {_y} with ""
  46. if loop-value contains "z:":
  47. set {_z} to loop-value
  48. replace " z: " in {_z} with ""
  49.  
  50. set {_z} to ({_z} parsed as a number)
  51. set {_x} to ({_x} parsed as a number)
  52. set {_z} to ({_z} parsed as a number)
  53.  
  54. if {_final} is north:
  55. send "Before: %{_z}%" to console
  56. send "%{_rem}%" to console
  57.  
  58. add {_rem} to {_z}
  59. send "After: %{_z}%" to console
  60.  
  61. if {_final} is east:
  62. send "Before: %{_x}%" to console
  63. send "%{_rem}%" to console
  64.  
  65. add {_rem} to {_x}
  66. send "After: %{_x}%" to console
  67.  
  68. if {_final} is south:
  69. send "Before: %{_z}%" to console
  70. send "%{_rem}%" to console
  71.  
  72. add {_rem} to {_z}
  73. send "After: %{_z}%" to console
  74.  
  75. if {_final} is west:
  76. send "Before: %{_x}%" to console
  77. send "%{_rem}%" to console
  78.  
  79. remove {_rem} from {_x}
  80. send "After: %{_x}%" to console
  81.  
  82.  
  83. add {_yrem} to {_y}
  84.  
  85. set {_x} to "x: %{_x}%"
  86. set {_y} to "y: %{_y}%"
  87. set {_z} to "z: %{_z}%"
  88.  
  89. set {_loc} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
  90. send "%{_x}%, %{_y}%, %{_z}%, %{_world}%" to console
  91. send "&5%{_loc}%" to console
  92. return {_loc}
  93.  
  94.  
  95. function addDir(final: direction, rem: number, n: number) :: number:
  96. send "Before: %{_n}%" to console
  97. if {_final} is north:
  98. add {_rem} to {_n}
  99.  
  100. if {_final} is east:
  101. add {_rem} to {_n}
  102.  
  103. if {_final} is south:
  104. remove {_rem} from {_n}
  105.  
  106. if {_final} is west:
  107. remove {_rem} from {_n}
  108.  
  109. send "After: %{_n}%" to console
  110.  
  111. return {_n}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement