Zeldaboy111

Skript #215 - test

Jul 16th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 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(world: String, final: direction, rem: number, yrem: number, l: location) :: location:
  37.  
  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.  
  53. if {_final} is north:
  54. send "Before: %{_z}%" to console
  55. send "%{_rem}%" to console
  56.  
  57. add {_rem} to {_z}
  58. send "After: %{_z}%" to console
  59.  
  60. if {_final} is east:
  61. send "Before: %{_x}%" to console
  62. send "%{_rem}%" to console
  63.  
  64. add {_rem} to {_x}
  65. send "After: %{_x}%" to console
  66.  
  67. if {_final} is south:
  68. send "Before: %{_z}%" to console
  69. send "%{_rem}%" to console
  70.  
  71. add {_rem} to {_z}
  72. send "After: %{_z}%" to console
  73.  
  74. if {_final} is west:
  75. send "Before: %{_x}%" to console
  76. send "%{_rem}%" to console
  77.  
  78. remove {_rem} from {_x}
  79. send "After: %{_x}%" to console
  80.  
  81.  
  82.  
  83.  
  84.  
  85. add {_yrem} to {_y}
  86. set {_loc} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
  87. send "%{_x}%, %{_y}%, %{_z}%, %{_world}%" to console
  88. send "&5%{_loc}%" to console
  89. return {_loc}
Add Comment
Please, Sign In to add comment