이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.12.2 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 스크립트 2.4.1 |
스크립트 애드온 | 모름 |
options:
g: &6[ &f주식 &6]&f
e: &6[ &cERRER &f]&c
variables:
{hour} = 0
{minute} = 0
{second} = 0
command /주씩 [<text>] [<text>] [<integer>] [<integer>] [<integer>]:
trigger:
if player is op:
if arg 1 is not set:
send " &6&m-----&6[&e오피 명령어&e]&6&m-----"
send " {@g} &7/주씩 생성 [주식이름] [상한가] [하한가] &7◆ 주식을 생성 및 상한가와 하한가를 정한다. "
send " {@g} &7/주씩 제거 [주식이름] &7◆ 주식을 제거합니다. "
send " {@g} &7/주씩 시간 [확인/변경] [시] [분] [초] &7◆ 주식의 변동시간을 확인 및 편집합니다. "
send " &8&m--------------"
send " &6&m-----&6[&e플레이어 명령어&e]&6&m-----"
send " {@g} &7/주씩 목록 [주식이름] &7◆ 주식목록을 확인합니다. "
if arg 1 is "생성":
if arg 2 is not set:
send "{@e} 주식 이름을 설정해주세요."
else:
if arg 3 is not set:
send "{@e} 상한가를 정하세요."
else:
if arg 4 is not set:
send "{@e} 하한가를 정하세요."
else:
add arg 2 to {stock::list::*}
set {stock.%arg 2%::상한가} to arg 3
set {stock.%arg 2%::하한가} to arg 4
set {stock.%arg 2%::현재가} to (arg 3 + arg 4)/2
set {count.%arg 2%} to 1
send "&6&m-----&6[&e주식&e]&6&m-----"
send "&f주식명 : %arg 2%"
send "&f현재가격 : %{stock.%arg 2%::현재가}%"
send "&f상한가 : %{stock.%arg 2%::상한가}%"
send "&f하한가 : %{stock.%arg 2%::하한가}%"
send " &8&m--------------"
if arg 1 is "제거":
if arg 2 is not set:
send "{@e} 주식 이름을 설정해 주세요."
else:
loop {stock::list::*}:
if loop-value is not arg 2:
send "{@e} 존재하지 않는 주식명입니다."
else:
remove arg 2 from {stock::list::*}
delete {stock.%arg 2%::*}
send "%arg 2% 주식이 제거됬습니다."
if arg 1 is "시간":
if arg 2 is not set:
send "{@e} 올바른 명령어를 입력해주세요."
else:
if arg 2 is "확인":
send " {@e} %{hour}%시간 %{minute}%분 %{second}%초 후에 변경됩니다."
if arg 2 is "변경":
if arg 3 is not set:
send "{@e} 시를 설정하세요."
else:
if arg 4 is not set:
send "{@e} 분를 설정하세요."
else:
if arg 5 is not set:
send "{@e} 초를 설정하세요."
else:
set {hour.stock} and {hour} to arg 3
set {minute.stock} and {minute} to arg 4
set {second.stock} and {second} to arg 5
send " {@g} %{hour}%시간 %{minute}%분 %{second}%초 로 변경됩니다."
if arg 1 is "목록":
open chest with 6 rows named "{@g}" to player
set {_a} to 36
loop 9 times:
set slot {_a} of player's current inventory to glass pane named "&8[ &f구분선 &8]"
add 1 to {_a}
set slot 45 of current inventory of player to clock named "&a[ &f남은 변동 시간 &a]" with lore "&cㄴ &f%{hour}%&e시 &f%{minute}%&e분 &f%{second}%&e초"
set slot 49 of current inventory of player to sign named "&c[ &f도움말 &c]" with lore "&eㄴ &f좌클릭 시 &e주식&f을 &c구매&f합니다." and "&eㄴ &f우클릭 시 &e주식&f을 &c판매&f합니다."
set slot 53 of current inventory of player to emerald named "&e[ &f돈 &e]" with lore "&cㄴ &f%{%player%.돈}% &c원"
set {_slot} to 1
loop 36 times:
if {stock::list::%{_slot}%} is set:
set slot ({_slot}-1) of player's current inventory to paper named "{@g} 주식명 : &6[ &f%{stock::list::%{_slot}%}% &6]" with lore "&f현재가격 : &6[ &f%{stock.%{stock::list::%{_slot}%}%::현재가}% &6]" and "&f변화률 : %{변화률.%{stock::list::%{_slot}%}%}%"
add 1 to {_slot}
else:
set slot {_slot}-1 of player's current inventory to air
add 1 to {_slot}
else:
if arg 1 is "목록":
open chest with 6 rows named "{@g}" to player
set {_a} to 36
loop 9 times:
set slot {_a} of player's current inventory to glass pane named "&8[ &f구분선 &8]"
add 1 to {_a}
set slot 45 of current inventory of player to clock named "&a[ &f남은 변동 시간 &a]" with lore "&cㄴ &f%{hour}%&e시 &f%{minute}%&e분 &f%{second}%&e초"
set slot 49 of current inventory of player to sign named "&c[ &f도움말 &c]" with lore "&eㄴ &f좌클릭 시 &e주식&f을 &c구매&f합니다." and "&eㄴ &f우클릭 시 &e주식&f을 &c판매&f합니다."
set slot 53 of current inventory of player to emerald named "&e[ &f돈 &e]" with lore "&cㄴ &f%{%player%.돈}% &c원"
set {_slot} to 1
loop 36 times:
if {stock::list::%{_slot}%} is set:
set slot ({_slot}-1) of player's current inventory to paper named "{@g} 주식명 : &6[ &f%{stock::list::%{_slot}%}% &6]" with lore "&f현재가격 : &6[ &f%{stock.%{stock::list::%{_slot}%}%::현재가}% &6]" and "&f변화률 : %{변화률.%{stock::list::%{_slot}%}%}%"
add 1 to {_slot}
else:
set slot {_slot}-1 of player's current inventory to air
add 1 to {_slot}
every 1 second:
if {hour} > 0:
if {minute} > 0:
if {second} > 0:
remove 1 from {second}
if {second} = 0:
subtract 1 from {minute}
add 60 to {second}
if {minute} = 0:
if {second} > 0:
remove 1 from {second}
if {second} = 0:
subtract 1 from {hour}
add 60 to {minute}
if {hour} = 0:
if {minute} > 0:
if {second} > 0:
remove 1 from {second}
if {second} = 0:
subtract 1 from {minute}
add 60 to {second}
if {minute} = 0:
if {second} > 0:
remove 1 from {second}
if {second} = 0:
set {hour} to {hour.stock}
set {minute} to {minute.stock}
set {second} to {second.stock}
broadcast ""
broadcast " {@g} &f주식의 &e가격&f이 &c변동&f되었습니다."
broadcast ""
set {_b} to 1
loop 36 times:
set {_주식가격 .%{_b}%} to {stock.%{stock::list::%{_b}%}%::현재가}/10
set {_퍼센트} to random number between 0 and {_주식가격 .%{_b}%}
set {_퍼센트} to round {_퍼센트}
set {_확률} to random number between 0 and 1
if {_확률} < 0.5:
remove {_퍼센트} from {stock.%{stock::list::%{_b}%}%::현재가}
set {변화률.%{stock::list::%{_b}%}%} to "&c▽ &f%{_퍼센트}% &c원"
if {_확률} >= 0.5:
add {_퍼센트} to {stock.%{stock::list::%{_b}%}%::현재가}
set {변화률.%{stock::list::%{_b}%}%} to "&a△ &f%{_퍼센트}% &c원"
if {stock.%{stock::list::%{_b}%}%::현재가} <= {stock.%{stock::list::%{_b}%}%::하한가}:
if {count.%{stock::list::%{_b}%}%} = 0:
broadcast " {@g} 주식 %{stock::list::%{_b}%}%}이 상장 폐지 까지 %{count.%{stock::list::%{_b}%}%}%번 남았습니다."
subtract 1 from {count.%{stock::list::%{_b}%}%}
if {count.%{stock::list::%{_b}%}%} = 0:
broadcast " {@g} 주식 %{stock::list::%{_b}%}%}이 상장 폐지되었습니다."
remove {stock::list::%{_b}%} from {stock::list::*}
add 1 to {_b}
every 0.1 second:
loop all players:
if inventory name of current inventory of loop-player contains "{@g}":
set slot 45 of current inventory of loop-player to clock named "&a[ &f남은 변동 시간 &a]" with lore "&cㄴ &f%{hour}%&e시 &f%{minute}%&e분 &f%{second}%&e초"
set {_slot} to 1
loop 36 times:
if {stock::list::%{_slot}%} is set:
set slot ({_slot}-1) of loop-player's current inventory to paper named "{@g} 주식명 : &6[ &f%{stock::list::%{_slot}%}% &6]" with lore "&f현재가격 : &6[ &f%{stock.%{stock::list::%{_slot}%}%::현재가}% &6]" and "&f변화률 : %{변화률.%{stock::list::%{_slot}%}%}%"
add 1 to {_slot}
else:
set slot {_slot}-1 of loop-player's current inventory to air
add 1 to {_slot}
every 1 seconds:
set {_a::*} to {stock::list::*}
set {stock::list::*} to {_a::*}
on inventory click:
if inventory name of current inventory of player contains "{@g}":
cancel event
if clicked slot < 36: 이 구문까지 썼는데 마지막 구문인 if clicked slot < 36:에서 can't test a slot for being 'smaller than ' and integer 오류가 계속 뜨네요.. 혹시 다르게 어떻게 바꿔야 하는지 고수님들에게 물어봅니다 ㅠㅠ
세찐찐
2023.12.24오류 메세지를 해석하자면 지금 if문에 if clicked slot < 36: 와 같이 ~보다 낮다를 실현할수 없다거 합니다 if clicked slot is 36: 이나 if clicked slot is 36 or 40: 과 같이 변경해주세요
룩브
2023.12.24감사합니다 해결했습니다 ㅜㅜ 아무리 바꿔봐도 안됬는데 진짜 감사합니다