リストにしたい

command /Locker:
trigger:
set {Locker.%player%} to chest inventory with 3 row named "&b&lロッカー"
set {n_} to 0
loop 27 times:
set slot {n_} of {Locker.%player%} to {Locker.slot%{n_}%.%player%}
add 1 to {n_}
open {Locker.%player%} to player
on inventory close:
if event-inventory is {Locker.%player%}:
set {n_} to 0
loop 27 times:
set {Locker.slot%{n_}%.%player%} to slot {n_} of {Locker.%player%}
add 1 to {n_}
command /Locker:
trigger:
set {Locker.%player%} to chest inventory with 3 row named "&b&lロッカー"
set {n_} to 0
loop 27 times:
set slot {n_} of {Locker.%player%} to {Locker.slot%{n_}%.%player%}
add 1 to {n_}
open {Locker.%player%} to player
on inventory close:
if event-inventory is {Locker.%player%}:
set {n_} to 0
loop 27 times:
set {Locker.slot%{n_}%.%player%} to slot {n_} of {Locker.%player%}
add 1 to {n_}
47 Replies
RackMC
RackMCOP5mo ago
これ欲を言えばリストがいいんですけど できる方お願いします::
月猫ch
月猫ch5mo ago
エンダーチェストみたいなことがしたいのかね
RackMC
RackMCOP5mo ago
そうですね
月猫ch
月猫ch5mo ago
{Locker.%player%} まずこの命名に遺憾の意 {Locker::%player%}
RackMC
RackMCOP5mo ago
こうすればいいんですか?
月猫ch
月猫ch5mo ago
リストにしたいってのがよくわからん どの変数をリストにしたいんや
RackMC
RackMCOP5mo ago
いや今変数で保管してるので リストで保管できないかなって 容量はどちらも変わらないんですか?
月猫ch
月猫ch5mo ago
基本複数のものを保存するならリスト んでこのskは自作?
RackMC
RackMCOP5mo ago
はい
月猫ch
月猫ch5mo ago
{Locker.%player%} これは、後々ロッカーを閉じたタイミングで中身を保存するために インベントリ自体を比較したいから、変数に保存してるってこと?
RackMC
RackMCOP5mo ago
そうですね 保存目的です
月猫ch
月猫ch5mo ago
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 4 row named {_invName}
# 開いたインベントリにロッカーの中身を呼び出す処理(中略)

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理(中略)
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 4 row named {_invName}
# 開いたインベントリにロッカーの中身を呼び出す処理(中略)

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理(中略)
こんな感じで名前識別でいいと思う
RackMC
RackMCOP5mo ago
やってみます 4行目エラー出ました
月猫ch
月猫ch5mo ago
to playerがないからね そういう細かいerrorは自力で直してくれ
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 4 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%{_index}%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%{_index}%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 4 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%{_index}%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%{_index}%} to {_item}
まあ挙動チェックしてないけど 今さらっと思いついたシステムだとこんな感じ?
RackMC
RackMCOP5mo ago
なんか開けたたびにアイテムが右に移動しますね
月猫ch
月猫ch5mo ago
indexの位置ずれやろなぁ
RackMC
RackMCOP5mo ago
indexって何ですか
月猫ch
月猫ch5mo ago
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
たぶんこれで行けると思う まずindexでgoogle検索かけた後に プログラミング indexでgoogle検索かけると 何をしたいのかがわかると思う
RackMC
RackMCOP5mo ago
まだ右に移動しますね 索引!
月猫ch
月猫ch5mo ago
ちょっと自鯖でいじってくるわー
RackMC
RackMCOP5mo ago
OKっす すみませんわざわざ
月猫ch
月猫ch5mo ago
もっかいコピペして試してみて
RackMC
RackMCOP5mo ago
まだずれますね
月猫ch
月猫ch5mo ago
リロードできてないとか コピペで新しいやつをはりつけられてないとかじゃない? こっちではずれないんだよね
RackMC
RackMCOP5mo ago
skript2.6.3です PR.skript 2.6.3 addon skbee skquery
月猫ch
月猫ch5mo ago
月猫ch
月猫ch5mo ago
PRだからなのか…?
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
これでどう
RackMC
RackMCOP5mo ago
動きますね.. そしてなんか一番端26番目についたものは 次開いたときに消えます
月猫ch
月猫ch5mo ago
まあそりゃずれてるなら消えるよね…
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num -1%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num -1%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
これでどう
RackMC
RackMCOP5mo ago
なんか2マスずつずれてます
月猫ch
月猫ch5mo ago
wwww
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num+1%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num+1%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
じゃあこうか 本来あり得ないと思う挙動だけど これで動くならこれしかない
RackMC
RackMCOP5mo ago
o 動かない... 成功してますね
月猫ch
月猫ch5mo ago
なんでだよきっしょ
RackMC
RackMCOP5mo ago
() -1を+1にしたら 治ったんですか?
月猫ch
月猫ch5mo ago
うちの環境だと1マスずつ左にずれる やっぱなんかその環境おかしくね???
RackMC
RackMCOP5mo ago
PRだとずれない..w 普通にPRですね
月猫ch
月猫ch5mo ago
というか、考えられるのは slotのindexが0,1,2,…じゃなくて1,2,3…とかなんだよな いやきしょすぎです
RackMC
RackMCOP5mo ago
でもguiは0,1,2カウントですね
月猫ch
月猫ch5mo ago
???なんもわからん 教えてPRに詳しい人
RackMC
RackMCOP5mo ago
さすがにきしょすぎる verが違ったら別の動きするってこともあんまないですよね
月猫ch
月猫ch5mo ago
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
play sound "block.chest.open" at player's head
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
play sound "block.chest.close" at player's head
loop 27 times:
delete {_item}
set {_index} to loop-num
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
command /Locker:
trigger:
set {_invName} to "&b&lロッカー:%name of player%"
open chest inventory with 3 row named {_invName} to player
# 開いたインベントリにロッカーの中身を呼び出す処理
set {_items::*} to {locker::%player%::*}
play sound "block.chest.open" at player's head
loop 27 times:
delete {_item}
set {_index} to loop-num -1
set {_item} to {_items::%loop-num%}
set slot {_index} of player's current inventory to {_item}

on inventory close:
set {_invName} to name of event-inventory
{_invName} is "&b&lロッカー:%name of player%"
# 閉じたインベントリの中身をロッカーに保存する処理
play sound "block.chest.close" at player's head
loop 27 times:
delete {_item}
set {_index} to loop-num
set {_item} to slot {_index} of event-inventory
set {locker::%player%::%loop-num%} to {_item}
これ試してみて
RackMC
RackMCOP5mo ago
おとなりました 動かないです でもなんか左上のマス目にあるの、消えます
月猫ch
月猫ch5mo ago
?????????
RackMC
RackMCOP5mo ago
ひとつ前のはちゃんと動いてます()
月猫ch
月猫ch5mo ago
じゃあひとつ前のでつかってもろて… 消えた原因はなんとなくわかるけど 意味わかんねえなこれ
RackMC
RackMCOP5mo ago
ありがとうございました
月猫ch
月猫ch5mo ago
うい
Want results from more Discord servers?
Add your server