エンチャント本のエンチャント名とレベルを個別に取得したい

エンチャント本のエンチャント名とレベルを個別にリスト型で取得しようとしたのですがサイト等を探しても見当たらなかったので方法があるなら教えていただきたいです string型に変換しsplitを使用して強引に分解できるかも試しましたがそもそもエンチャント名ごとの空白の数が違ったのでできませんでした 数字などの値を検知して分解できるのかもできれば教えていただきたいです
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
No description
Solution:
行けました おそらくloop enchantments of player's tool:のループのところでloop stored enchants of player's tool:に変えないといけないのだと思われます...
Jump to solution
9 Replies
こすも
こすもOP14mo ago
色々試した時stored enchantsのほうでしかエンチャントが取れなかったんですよね
こすも
こすもOP14mo ago
わかりました このエンチャント本を持った状態で試したこと書いてきます
No description
こすも
こすもOP14mo ago
1 stored enchants 後のコードを消した場合
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
エラーはなし send "%{_enchant}% %{_level}%" to playerによるメッセージは送られませんでした
こすも
こすもOP14mo ago
2 loop enchantments of player's tool:のループの中身のコードを消した場合
command /getench:
trigger:
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
command /getench:
trigger:
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
エラーはなし エンチャント名 レベルのかたまりで改行しながらメッセージが送られました
No description
こすも
こすもOP14mo ago
3 そのまま 2と同じようにメッセージが送られました エラーはありません
No description
こすも
こすもOP14mo ago
一応そちらの入れてるアドオン確認したいのですが平気ですか もう1回やってみます 動きませんね... 何か間違ったところがあったんですかね
こすも
こすもOP14mo ago
できました
No description
Solution
こすも
こすも14mo ago
行けました おそらくloop enchantments of player's tool:のループのところでloop stored enchants of player's tool:に変えないといけないのだと思われます
こすも
こすもOP14mo ago
ありがとうございました 動いた後にloop stored enchants of player's tool:で型の問題かを確認しました 言い忘れてました すみません 了解です

Did you find this page helpful?