Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. tfunction convert2text(string: text, len: number) :: text:
  2. set {_chars} to "PETOHMNILDCKAGYS"
  3. set {_charset::*} to {_chars} split at ""
  4. set {_hex::*} to {_string} split at ""
  5. set {_text} to ""
  6. set {_i} to 0
  7. loop {_hex::*}:
  8. set {_num} to convert hexa "%loop-value%" to num
  9. set {_char} to {_charset::%{_num}%}
  10. set {_text} to "%{_text}%%{_char}%"
  11.  
  12. add 1 to {_i}
  13. {_i} >= {_len}:
  14. stop loop
  15. return {_text}
  16.  
  17. function getNums(string: text) :: text:
  18. set {_hex::*} to {_string} split at ""
  19. set {_i} to 0
  20. set {_nums} to ""
  21. loop {_hex::*}:
  22. if {_i} is between 27 and 30:
  23. set {_num} to convert hexa "%loop-value%" to num
  24. if {_num} >= 10:
  25. subtract 10 from {_num}
  26. set {_nums} to "%{_nums}%%{_num}%"
  27. else if {_i} > 31:
  28. stop loop
  29. add 1 to {_i}
  30. #broadcast "%{_nums}%"
  31. return {_nums}
  32.  
  33. on piston extend:
  34. set {_loc} to location of block under block under event-block
  35. if block at {_loc} is a dropper:
  36. set {_item} to slot 0 of inventory of block at {_loc}
  37. #broadcast "%{hash.%{_loc}%}%"
  38. set {_colors::*} to {hash.%{_loc}%} split at ""
  39. set {_text} to ""
  40. loop {_colors::*}:
  41. set {_text} to "%{_text}%ยง%loop-value%."
  42. #broadcast "%{hash.%{_loc}%}%."
  43. if {hash.%{_loc}%} is set:
  44. set {_hex} to {hash.%{_loc}%}
  45. set {_part1} to convert2text({_hex}, 4)
  46. set {_part2} to getNums({_hex})
  47. set {_text} to "%{_part1}%%{_part2}%"
  48.  
  49. if {_item} is gold nugget:
  50. drop 1 prismarine crystal with lore "%{_text}%" at block under event-block
  51. subtract 1 of {_item} from slot 0 of inventory of block at {_loc}
  52.  
  53. if {_item} is iron nugget:
  54. drop 1 prismarine shard with lore "%{_text}%" at block under event-block
  55. subtract 1 of {_item} from slot 0 of inventory of block at {_loc}
  56.  
  57. if {_item} is rabbit foot:
  58. drop 1 magma cream with lore "%{_text}%" at block under event-block
  59. subtract 1 of {_item} from slot 0 of inventory of block at {_loc}
  60.  
  61. if {_item} is rabbit hide:
  62. drop 1 glistering melon with lore "%{_text}%" at block under event-block
  63. subtract 1 of {_item} from slot 0 of inventory of block at {_loc}
  64.  
  65.  
  66. on right click on dropper:
  67. player is holding white banner or orange banner or black banner or magenta banner or yellow banner or lime banner or light blue banner or pink banner or gray banner or light gray banner or cyan banner or purple banner or blue banner or brown banner or green banner or red banner:
  68. broadcast "vitun apen koodi saatana"
  69. cancel event
  70. {hash.%location of clicked block%} is not set
  71. set {_nbt} to "%nbt of tool of player%"
  72. set {_hash} to hashed "%{_nbt}%" using "MD5"
  73. set {hash.%location of clicked block%} to {_hash}
  74. set {nbt.%location of clicked block%} to tool of player
  75. subtract 1 banner from tool of player
  76.  
  77. on break of dropper:
  78. delete {hash.%location of event-block%}
  79. set {_item} to {nbt.%location of event-block%}
  80. drop 1 of {_item} at event-block
  81. #give player 1 of {_item}
  82. delete {nbt.%location of event-block%}
  83.  
  84. on death of rabbit:
  85. remove all rabbit hide from drops
  86. remove all rabbit foot from drops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement