ProfesseurCraft

Untitled

Jun 7th, 2014
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. #Coloration des panneaux et mise en place des panneaux de téléportation
  2. #----------------------------------------------------------------------
  3. on sign change:
  4. replace every "&" with "§" in line 1
  5. replace every "&" with "§" in line 2
  6. replace every "&" with "§" in line 3
  7. replace every "&" with "§" in line 4
  8.  
  9. if line 2 contains "[runEdit]":
  10. set {_id} to line 3 parsed as number
  11. if {run::%{_id}%} is set:
  12. set line 2 to "§6§l[runStart]"
  13. set line 3 to "§b§l{_id}"
  14. set {_data::*} to {run::%{_id}%} split at "|"
  15. set line 1 to "§2§l{_data::1}"
  16. else:
  17. message "<red><bold>Cette id n'existe pas, action annulée..."
  18. wait 1 second
  19. delete block at event-location
  20.  
  21.  
  22. #Rejoindre une partie
  23. #------------------------
  24. on rightclick on sign:
  25. if line 2 contains "[runStart]":
  26. set {_id} to line 3 parsed as number
  27. set {_data::*} to {run::%{_id}%} split at "|"
  28. set {_coords::*} to {_runData::2} split at ","
  29. loop {_coords::*}:
  30. set {_coord_%loop-index%} to loop-value parsed as number
  31. message "<yellow><bold>Téléportation dans 3 secondes"
  32. wait 3 seconds
  33. execute console command "/tp %player% %{_coord_1}% %{_coord_2}% %{_coord_3}%"
  34.  
  35. #Créer un parcours
  36. #------------------------
  37. command /runCreate <text>:
  38. usage: §b /runCreate ou /rc <nom du parcours>
  39. aliases:/rc
  40. trigger:
  41. set {_coords} to player's location
  42. set {_x} to round x-coord of {_coords}
  43. set {_y} to round y-coord of {_coords}
  44. set {_z} to round z-coord of {_coords}
  45. add "%arg 1%|%{_x}%,%{_y}%,%{_z}%" to {run::*}
  46.  
  47. #Déterminer le point de spawn d'un parcours
  48. #------------------------
  49. command /runEdit <int> [<text>]:
  50. usage: §b /runEdit ou /re <id du parcours> [<nom du parcours>]
  51. aliases:/re
  52. trigger:
  53. set {_coords} to player's location
  54. set {_x} to round x-coord of {_coords}
  55. set {_y} to round y-coord of {_coords}
  56. set {_z} to round z-coord of {_coords}
  57. set {_data::*} to {run::%arg 1%} split at "|"
  58. if arg 2 is set:
  59. set {_data::1} to arg 2
  60. set {_data::2} to "%{_x}%,%{_y}%,%{_z}%"
  61. set {run::%arg 1%} to join {_data::*} with "|"
  62.  
  63. on rightclick on stone:
  64. add "13" to {list::*}
  65. add "31" to {list::*}
  66. add "28" to {list::*}
  67. add "56" to {list::*}
  68.  
  69. set {_count} to 0
  70. loop {list::*}:
  71. set {_count} to {_count} + 1
  72. set {_i} to 1
  73. set {_j} to 1
  74.  
  75. while {_i} is smaller than {_count}:
  76. set {_elemToInsert} to {list::%{_i}%}
  77. set {_i} to {_i} + 1
  78. while {_j} is smaller than {_i}:
  79.  
  80. set {_currentElem} to {list::%{_j}%}
  81. set {_j} to {_j} + 1
  82.  
  83. if {_elemToInsert} is smaller than {_currentElem}:
  84. set {list::%{_j}%} to {_elemToInsert}
  85. set {_elemToInsert} to {_currentElem}
  86.  
  87.  
  88.  
  89.  
  90. set {list::%{_i}%} to {_elemToInsert}
  91.  
  92. loop {list::*}:
  93. message "<yellow>%loop-index% : <white>%loop-value%"
  94.  
  95. clear {list::*}
Advertisement
Add Comment
Please, Sign In to add comment