リスト変数からの削除

座標が複数入ってるリスト変数から特定の座標だけを消す方法が知りたいです。
28 Replies
ふぁたおくん
if clicked item is oak log:
set {_itemname} to uncolored name of clicked item
remove {_itemname} from {BugPoint::loc::yama::*}
if clicked item is oak log:
set {_itemname} to uncolored name of clicked item
remove {_itemname} from {BugPoint::loc::yama::*}
名前に座標が設定されたオークの原木が出てくるGUIがあって、それをクリックしたらその原木の名前の座標が{BugPoint::loc::yama::*}から消えるってことをしたいんですが、できません。 おしえてください(´_ゝ`)
chinatukano
chinatukano10mo ago
remove location at {_itemname} in world “world” from {list} nameはstring型になってるから多分locationにすればできないかな? リスト変数にどういう状態で保存してるのか知りたい それか座標とアイテムを変数で紐付ければ簡単になると思う
Yeahn
Yeahn10mo ago
if type of clicked item is oak log:
set {_itemname} to uncolored name of clicked item
remove {BugPoint::loc::yama::*} where ["%input%" is {_itemname}] from {BugPoint::loc::yama::*}
if type of clicked item is oak log:
set {_itemname} to uncolored name of clicked item
remove {BugPoint::loc::yama::*} where ["%input%" is {_itemname}] from {BugPoint::loc::yama::*}
何か
何か10mo ago
add removeの組み合わせは探索処理が入って処理速度にかなり影響するので 普通set deleteでインデックスを指定して使います みらげに騙されてはいけません
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
俺がいつ騙したんだ
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
3年以上前じゃねえか
ふぁたおくん
indexがよくわかってないけど
loop 10 times:
set {_index} to loop-number
if {a::%{_index}%} is set:
send "%{a::%{_index}%}%"
loop 10 times:
set {_index} to loop-number
if {a::%{_index}%} is set:
send "%{a::%{_index}%}%"
みたいにしたら{a::*}の中身10個まで見れますよってこと?
何か
何か10mo ago
1から10までのインデックスが設定されてるならそうなる インデックスに数字以外の文字が使われてたら それだと見れない インデックスはそのまま言葉通りの意味で日常でもファイルや本に挟む付箋と同じ機能
ふぁたおくん
インデックスは数字も文字も設定できる、変数の紐づけみたいな さむしんぐか
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
indexは全て文字列として扱われる
ふぁたおくん
お目汚しして申し訳ないですが、一応これが今書いてる全文です。汚いです。
ふぁたおくん
湧き場所の管理GUIで、オークの原木クリックしたら、その原木の名前に座標が書いてあるので、その座標を{BugPoint::loc::yama::*}から消す~というのを作ったんですが、原木をクリックした時にその後ろにあるすべての原木も消えてしまうんですが、なんでだろう;
何か
何か10mo ago
インデックスに直接座標おいてるんだったら delete {_::_::%location%}で 直接指定したほうがいいよ これだったらdelete {BugPoint::loc::yama::%{_itemname}%}
ふぁたおくん
loop {BugPoint::loc::%{_t}%::*}:
add 1 to {_num}
set {_index} to loop-value
if {BugPoint::loc::%{_t}%::%{_index}%} is set:
set {_locicon} to a oak log named "&8&l%{BugPoint::loc::%{_t}%::%{_index}%}%"
add "" and "&eクリックして&c削除" to lore of {_locicon}
set slot 8 + {_num} of {_inv} to {_locicon}
else:
exit loop
loop {BugPoint::loc::%{_t}%::*}:
add 1 to {_num}
set {_index} to loop-value
if {BugPoint::loc::%{_t}%::%{_index}%} is set:
set {_locicon} to a oak log named "&8&l%{BugPoint::loc::%{_t}%::%{_index}%}%"
add "" and "&eクリックして&c削除" to lore of {_locicon}
set slot 8 + {_num} of {_inv} to {_locicon}
else:
exit loop
迷走してきた 座標一覧GUIを表示するやつ
loop 36 times:
set {_index} to 45 * ({_page} - 1) + loop-number
if {BugPoint::loc::%{_t}%::%{_index}%} is set:
set {_locicon} to a oak log named "&8&l%{BugPoint::loc::%{_t}%::%{_index}%}%"
add "" and "&eクリックして&c削除" to lore of {_locicon}
set slot 8 + loop-number of {_inv} to {_locicon}
else:
continue
loop 36 times:
set {_index} to 45 * ({_page} - 1) + loop-number
if {BugPoint::loc::%{_t}%::%{_index}%} is set:
set {_locicon} to a oak log named "&8&l%{BugPoint::loc::%{_t}%::%{_index}%}%"
add "" and "&eクリックして&c削除" to lore of {_locicon}
set slot 8 + loop-number of {_inv} to {_locicon}
else:
continue
削除するやつ
if clicked item is oak log:
send "%{BugPoint::loc::yama::*}%"
set {_itemname} to uncolored name of clicked item
send "%{_itemname}%"
remove {BugPoint::loc::yama::*} where ["%input%" is {_itemname}] from {BugPoint::loc::yama::*}
if clicked item is oak log:
send "%{BugPoint::loc::yama::*}%"
set {_itemname} to uncolored name of clicked item
send "%{_itemname}%"
remove {BugPoint::loc::yama::*} where ["%input%" is {_itemname}] from {BugPoint::loc::yama::*}
ふぁたおくん
クリック前
No description
ふぁたおくん
2個目クリック後
No description
ふぁたおくん
って言う具合にクリックした奴から後ろのやつが消えちゃう 色々試したけど、後ろのやつ消えるか、なにも消えないかしかならんかったので ちょっとご指導願いたいです
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
・クリックした原木より後ろの原木が3個以上あった時の挙動 ・removeする対象の一覧 ・removeする前の変数の中身 ・removeした後の変数の中身 を確認してほしい removeする対象は set {_a::*} to {省略::*} where [省略] してsendなりbroadcastなりして確認できる ちなみにこのitemnameのsendはなんて出力された?
ふぁたおくん
-491 24 940のはずだけど、x: -490.5, y: 25.5, z: 940.5って出力されました あと寝て起きて確認リストの最初のやつやってみたら
ふぁたおくん
No description
ふぁたおくん
あと
No description
ふぁたおくん
なんかきえませんでした これに関してはどうでもよさそう removeする対象の一覧ってなに?
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
whereでデータをフィルターにかけて消す条件に当てはまるデータを絞ると思うんだけど、そのフィルターにかかったデータ てかなんで直ったんだ
ふぁたおくん
set {_a::*} to {BugPoint::loc::yama::*} where ["%input%" is {_itemname}]
send "&e%{_a::*}%"
set {_a::*} to {BugPoint::loc::yama::*} where ["%input%" is {_itemname}]
send "&e%{_a::*}%"
こういうこと? 空白開いても困るから詰めたい
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
そういうこと 詰めたいならindexをもう一度割り振りましょう
ふぁたおくん
動きました!細かくありがとうございました>< index周りとかコード鬼汚いのでブラッシュアップしていきます😁
Want results from more Discord servers?
Add your server
More Posts
Mapの中心を設定プレイヤーが手持ちにマップを持っていた時に常にマップを更新してプレイヤーの位置がマップの中央に来るようにしたい マップの更新をする方法を教えてほしいです。height of %?%のアドオン名以下のアドオンの中で該当する構文を含んでいる物って何ですか https://gyazo.com/b63909cd21d78441f9f1685912651ed6変数でオプションの変数を指定したい変数でオプションの変数を指定したい options: text1: 出したい文章 text2: 文章2 text3: 文章3 function testFunction(p:発光前提: マイクラバージョン1.20.1(最新版) アドオンを使って特定のプレイヤーにしか 表示されない発光を作りたいです 使い方はミニゲームでチームメンバーだけを発光させたり観戦者が状況を掴みやすくブロックが火だった場合に置き換えたい``` loop all blocks in radius 7 around player: if block above loチャットに入力された数字だけを取得したいチャットに数字しか打てなくする、またはチャットに含まれる数字以外の文字を検知することはできますか?譲渡コマンドの脆弱性を解決したい```skript command /gift <player> <number>: trigger: if {gold::%player's uuid%} >= arg-2:クラフトしたあとにloreを編集できない``` on craft: item is sword or axe set the 1st line of item's lore to "&6aaa" ``` クラフトしたときに武同じイベントの優先順位SkbeeとSkript本体で全く同じ名前のイベントがある時は どっちのイベントが優先されて呼び出されますか?morkazSKのglow with colorが使えない```make player glow with color "NONE" for all players``` で、docsにはglowが消えると書いてありましたが、消えませんでした エラーはありま