SHARE
TWEET

a guest Jul 16th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Created By しそ#1459
  2. #/kabu
  3. #{money.%player%}
  4.  
  5. options:
  6.     buy_min: 300
  7.     buy_max: 1200
  8.     sell_min: 150
  9.     sell_max: 1000
  10.     kabu_change_time: 60 #(Minutes) 1 hour
  11.     kabu_rot: 1440 #(Minutes) 24 hours
  12.  
  13. command /kabu:
  14.     trigger:
  15.         open chest with 1 row named "&6&l株" to player
  16.         set slot 0 of player's current inventory to golden nugget named "&e%player%&6のお金" with lore "&6所持金&3:&e&l%{money.%player%}%" and "&6所持株&3:&a&l%{kabu.%player%}%"
  17.         set slot 2 of player's current inventory to name tag named "&5&l株を買う"
  18.         set slot 4 of player's current inventory to sunflower named "&6&l株を売る"
  19.         set slot 6 of player's current inventory to clock named "&d株価変動の履歴を見る"
  20.         set slot 8 of player's current inventory to paper named "&a&l現在の株価" with lore "&6買値&3:&e&l%{kabu.buy.price}%" and "&a売値&3:&e&l%{kabu.sell.price}%"
  21.         if {kabu.next.%player%} is set:
  22.             if floor(unix timestamp of now) >= {kabu.next.%player%}:
  23.                 delete {kabu.next.%player%}
  24.        
  25.  
  26. on inventory click:
  27.     if name of player's current inventory contain "株":
  28.         cancel event
  29.         if name of clicked item contain "株を買う":
  30.             close player's inventory
  31.             send "&6株を買う個数を指定して下さい。"
  32.             send "&3cancel&6と打つとキャンセルします。"
  33.             send "&3max&6と変えるだけの株を買います。"
  34.             set {kabu.chat.%player%} to true
  35.             execute player command "/jp off"
  36.             stop
  37.         if name of clicked item contain "株を売る":
  38.             close player's inventory
  39.             wait 1 tick
  40.             open chest with 1 row named "&5&l本当に株を売りますか?" to player
  41.             set slot 2 of player's current inventory to light green wool named "&a&l売却する"
  42.             set slot 4 of player's current inventory to nether star named "&6売却内容" with lore "&6株の売却数:&a&l%{kabu.%player%}%" and "&b現在の株価:&e&l%{kabu.sell.price}%"
  43.             set slot 6 of player's current inventory to red wool named "&c&lキャンセル"
  44.             stop
  45.         if name of clicked item contain "株価変動の履歴を見る":
  46.             cancel event
  47.             open chest with 6 row named "&6株価の変動履歴" to player
  48.             set slot 0 of player's current inventory to glowing gold block named "&a&l現在の株価" with lore "&6買値&3:&e&l%{kabu.buy.price}%" and "&a売値&3:&e&l%{kabu.sell.price}%"
  49.             set slot 53 of player's current inventory to barrier block named "&cメニューに戻る"
  50.             set {kabu.history.slot} to 0
  51.             loop {kabu.history::*}:
  52.                 add 1 to {kabu.history.slot}
  53.                 set slot {kabu.history.slot} of player's current inventory to loop-value
  54.         if name of player's current inventory contain "株価の変動履歴":
  55.             cancel event
  56.             name of clicked item contain "メニューに戻る"
  57.             close player's inventory
  58.             wait 1 tick
  59.             execute player command "/kabu"
  60.             stop
  61.     if name of player's current inventory contain "本当に株を売りますか?":
  62.         cancel event
  63.         if name of clicked item contain "売却する":
  64.             close player's inventory
  65.             if {kabu.next.%player%} is set:
  66.                 send "&c次の株価が変動するまで株を売れません!"
  67.                 stop
  68.             add {kabu.%player%} * {kabu.sell.price} to {money.%player%}
  69.             send "&a株を売りました!"
  70.             send "&6株の売却益 &3→ &e&l%{kabu.%player%} * {kabu.sell.price}%"
  71.             send "&6現在のお金 &3→ &e&l%{money.%player%}%"
  72.             send "&e%player%が株を売りました。 売却益&3→ &e&l%{kabu.%player%} * {kabu.sell.price}%" to ops
  73.             delete {kabu.timelimit.%player%}
  74.             set {kabu.%player%} to 0
  75.             stop
  76.         if name of clicked item contain "キャンセル":
  77.             close player's inventory
  78.             stop
  79.  
  80. on chat:
  81.     {kabu.chat.%player%} is true
  82.     cancel event
  83.     set {_msg} to message
  84.     if {_msg} is "cancel":
  85.         delete {kabu.chat.%player%}
  86.         send "&c株の購入をキャンセルしました。"
  87.         execute player command "/jp on"
  88.         stop
  89.     if {_msg} is "max":
  90.         while {money.%player%} >= {kabu.buy.price}:
  91.             add 1 to {_kabu.max.amount}
  92.             add 1 to {kabu.%player%}
  93.             remove {kabu.buy.price} from {money.%player%}
  94.         delete {kabu.chat.%player%}
  95.         send "&6株を&a%{_kabu.max.amount}%&6個買いました。"
  96.         send "&6現在の株数 &3→ &a%{kabu.%player%}%"
  97.         if {kabu.timelimit.%player%} is set:
  98.             execute player command "/jp on"
  99.         else:
  100.             set {kabu.timelimit.%player%} to floor(unix timestamp of now) + 1200
  101.         if {kabu.next.%player%} is set:
  102.             execute player command "/jp on"
  103.         else:
  104.             set {kabu.next.%player%} to floor(unix timestamp of now) + 60
  105.         execute player command "/jp on"
  106.         stop
  107.     if {_msg} parsed as number is not number:
  108.         send "&c数字以外は入力できません。"
  109.         stop
  110.     {_msg} parsed as number isn't 0
  111.     {_msg} parsed as number is integer
  112.     if {money.%player%} <= {kabu.buy.price} * {_msg} parsed as number:
  113.         send "&cお金が足りません。"
  114.         execute player command "/jp on"
  115.         stop
  116.     add {_msg} parsed as number to {kabu.%player%}
  117.     remove {kabu.buy.price} * {_msg} parsed as number from {money.%player%}
  118.     delete {kabu.chat.%player%}
  119.     send "&6株を&a%{_msg}%&6個買いました。"
  120.     send "&6現在の株数 &3→ &a%{kabu.%player%}%"
  121.     if {kabu.timelimit.%player%} is set:
  122.         execute player command "/jp on"
  123.     else:
  124.         set {kabu.timelimit.%player%} to floor(unix timestamp of now) + 60 * {@kabu_rot}
  125.     if {kabu.next.%player%} is set:
  126.         execute player command "/jp on"
  127.     else:
  128.         set {kabu.next.%player%} to floor(unix timestamp of now) + 60 * {@kabu_change_time}
  129.     execute player command "/jp on"
  130.     stop
  131.  
  132. every {@kabu_change_time} minutes:
  133.     set {_kabu.buy} to a random integer between {@buy_min} and {@buy_max}
  134.     set {kabu.buy.price} to {_kabu.buy}
  135.     set {_kabu.sell} to a random integer between {@sell_min} and {@sell_max}
  136.     set {kabu.sell.price} to {_kabu.sell}
  137.     set {_now} to "%now%"
  138.     set {_now2::*}  to {_now} split at "/19"
  139.     add paper named "&f&6%{_now2::1}% &3|&9%{_now2::2}%" with lore "&6買値&3:&e&l%{kabu.buy.price}%" and "&a売却額&3:&e&l%{kabu.sell.price}%" to {kabu.history::*}
  140.     broadcast "&5=====&3&l株価変動&5====="
  141.     broadcast "&6買値&3:&e&l%{kabu.buy.price}%"
  142.     broadcast "&a売値&3:&e&l%{kabu.sell.price}%"
  143.     loop all players:
  144.         if {kabu.timelimit.%loop-player%} is set:
  145.             if floor(unix timestamp of now) >= {kabu.timelimit.%loop-player%}:
  146.                 set {kabu.%loop-player%} to 0
  147.                 send "&c株が腐りました。" to loop-player
  148.                 delete {kabu.timelimit.%loop-player%}
  149.         if {kabu.next.%loop-player%} is set:
  150.             if floor(unix timestamp of now) >= {kabu.next.%loop-player%}:
  151.                 send "&c株を売れるようになりました。" to loop-player
  152.                 delete {kabu.next.%loop-player%}
  153.  
  154. on join:
  155.     if {kabu.%player%} is not set:
  156.         set {kabu.%player%} to 0
  157.         stop
  158.     if {kabu.timelimit.%player%} is set:
  159.         floor(unix timestamp of now) >= {kabu.timelimit.%player%}
  160.         set {kabu.%player%} to 0
  161.         send "&c株が腐りました。" to player
  162.         delete {kabu.timelimit.%player%}
  163.     if {kabu.next.%player%} is set:
  164.         floor(unix timestamp of now) >= {kabu.next.%player%}
  165.         send "&c株を売れるようになりました。"
  166.         delete {kabu.next.%player%}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top