familychicken

notation

Jun 14th, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. #[Function List]────────────
  2. #nn, nnconsole
  3. #[Command List]────────────
  4. #/notation <hybrid/scientific/standard>
  5.  
  6. options:
  7. c: &6[・]
  8. nnp: &7[-&eSetting&7-]
  9.  
  10. variables:
  11. {nt::0} = ""
  12. {nt::1} = "K"
  13. {nt::2} = "M"
  14. {nt::3} = "B"
  15. {nt::4} = "T"
  16. {nt::5} = "Qa"
  17. {nt::6} = "Qi"
  18. {nt::7} = "Sx"
  19. {nt::8} = "Sp"
  20. {nt::9} = "Oc"
  21. {nt::10} = "No"
  22. {nt::11} = "Dc"
  23. {%player%.notation} = 3
  24. {min} = 10000
  25.  
  26. command /notation [<text>]:
  27. trigger:
  28. if arg is "standard":
  29. set {%player%.notation} to 1
  30. message "{@nnp} &7数の表記を &aStandard &7に変更しました。"
  31. if arg is "scientific":
  32. set {%player%.notation} to 2
  33. message "{@nnp} &7数の表記を &aScientific &7に変更しました。"
  34. if arg is "hybrid":
  35. set {%player%.notation} to 3
  36. message "{@nnp} &7数の表記を &aHybrid &7に変更しました。"
  37. if arg is not set:
  38. message "{@nnp} &c使用可能表記: hybrid/standard/scientific"
  39.  
  40.  
  41.  
  42. function nn(n: number, player: player) :: string:
  43. if {%{_player}%.notation} is 2:
  44. if {_n} >= {min}:
  45. set {_e} to floor(log({_n}))
  46. set {_c} to "%{_n}/(10^{_e})%e%{_e}%"
  47. if {%{_player}%.notation} is 1:
  48. if {_n} >= {min}:
  49. set {_el} to floor(log({_n})/3)
  50. set {_c} to "%{_n}/(1000^{_el})%%{nt::%{_el}%}%"
  51. if {%{_player}%.notation} is 3:
  52. if {_n} >= {min}:
  53. set {_e} to floor(log({_n}))
  54. set {_el} to floor(log({_n})/3)
  55. if {_el} < 12:
  56. set {_c} to "%{_n}/(1000^{_el})%%{nt::%{_el}%}%"
  57. if {_el} >= 12:
  58. set {_c} to "%{_n}/(10^{_e})%e%{_e}%"
  59. if {_n} < {min}:
  60. set {_c} to "%{_n}%"
  61. return {_c}
  62.  
  63. function nnconsole(n: number, p: number) :: string:
  64. if {_p} is 2:
  65. if {_n} >= {min}:
  66. set {_e} to floor(log({_n}))
  67. set {_c} to "%{_n}/(10^{_e})%e%{_e}%"
  68. if {_p} is 1:
  69. if {_n} >= {min}:
  70. set {_el} to floor(log({_n})/3)
  71. set {_c} to "%{_n}/(1000^{_el})%%{nt::%{_el}%}%"
  72. if {_p} is 3:
  73. if {_n} >= {min}:
  74. set {_e} to floor(log({_n}))
  75. set {_el} to floor(log({_n})/3)
  76. if {_el} < 12:
  77. set {_c} to "%{_n}/(1000^{_el})%%{nt::%{_el}%}%"
  78. if {_el} >= 12:
  79. set {_c} to "%{_n}/(10^{_e})%e%{_e}%"
  80. if {_n} < {min}:
  81. set {_c} to "%{_n}%"
  82. return {_c}
  83.  
  84.  
  85. command /setmin <number>:
  86. permission: skript.admin
  87. trigger:
  88. set {min} to arg
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
Advertisement
Add Comment
Please, Sign In to add comment