本の編集をskでやりたい

skで本の編集ができるPLとかありませんか
No description
17 Replies
KabiPan
KabiPan4mo ago
アドオンは分からんが マイクラの本のデーターって恐らくNBT管理されてるから それを上書きすれば編集はできるはず
KabiPan
KabiPan4mo ago
No description
KabiPan
KabiPan4mo ago
一番下のやつ
Laminas
Laminas4mo ago
めっちゃ前にフリー配布所に上げてる人いなかったっけ そこから読み解けばいけそう
Yeahn
Yeahn4mo ago
SkBee のGitHub wikiに本の場合の使い方載っていた気がします それかあまりに鯖が古いならSkellettの方のtext component を使うのもあり
KabiPan
KabiPan4mo ago
Skript Hub - Documentation
Book Pages (Expression) - SkBee
Allows you to set pages in a book to text components. You can also retrieve the pages. Based on testing, a book's author/title needs to be set AFTER setting the pages, why? I have no idea!
KabiPan
KabiPan4mo ago
アッタ あでも skript自体にも機能あって2.2以降取得と編集できるね
KabiPan
KabiPan4mo ago
Skript Hub - Documentation
Book Pages (Expression) - Skript
The pages of a book (Supports Skript's chat format) Note: In order to modify the pages of a new written book, you must have the title and author of the book set. Skript will do this for you, but if you want your own, please set those values.
KabiPan
KabiPan4mo ago
%pages of event-item%で全ページ取得 %page [数字] of event-item%で指定したページ取得 あと文字の編集で改行したいとき 例えば "panpan" and "kabikabi"みたいにand使うことが出来ない \n使っても出来ない だからやりたいときは"panpan %newline% kabikabi"ってやるとできる
Tsukineko(月雲)
%newline%はそのまますか
KabiPan
KabiPan4mo ago
Tsukineko(月雲)
%nl%の代わりに %newline%ってことすか
KabiPan
KabiPan4mo ago
あー nlでもいいはず
Tsukineko(月雲)
なる
何か
何か4mo ago
command /test:
trigger:
set {_t} to parse_book_text("test <tooltip:hello\>>&ab&cb&rc<akbbb:man,egg:test>ah\\no")
broadcast "%{_t}%"
add "{pages:[""%{_t}%""]}" to nbt of player's tool

function parse_book_text(str: string) :: string:
set {_str} to "%{_str}%<>"

while length of {_str} > 0:
set {_i::*} to parse_block({_str}, "<")
if {_i::1} is not -1:
set {_t} to size of {_items::*} + 1
set {_items::%{_t}%} to substr({_str}, 1, {_i::1} - 1)
loop {_attrs::*}:
set {_t2} to index of ":" in loop-value
set {_name} to substr(loop-value, 0, {_t2} - 1)
set {_value} to substr(loop-value, {_t2} + 1)
set {_items::%{_t}%::attrs::%{_name}%} to {_value}
set {_str} to substr({_str}, {_i::1})

set {_i::*} to parse_block({_str}, ">")
if {_i::1} is not -1:
set {_t} to slice({_i::2}, 2, -1)
delete {_attrs::*}
while length of {_t} > 0:
set {_i2::*} to parse_block({_t}, ",")
add {_i2::2} to {_attrs::*}
if {_i2::1} is -1:
stop loop
set {_t} to substr({_t}, {_i2::1} + 1)

set {_str} to substr({_str}, {_i::1} + 1)

else:
stop loop

loop {_items::*}:
delete {_nbt::*}
add "\""text\"":\""%loop-value%\""" to {_nbt::*}
loop {_items::%loop-index%::attrs::*}:
if loop-index-2 is "tooltip":
add "\""hoverEvent\"":{\""action\"":\""show_text\"",\""value\"":\""%loop-value-2%\""}" to {_nbt::*}

set {_data} to join {_nbt::*} with ","
add "{%{_data}%}" to {_components::*}

set {_data} to join {_components::*} with ","
return "[%{_data}%]"

function slice(str: string, start: number, end: number) :: string:
if {_start} < 0:
add length of {_str} + 1 to {_start}
if {_end} < 0:
add length of {_str} + 1 to {_end}
return substr({_str}, {_start}, {_end})
command /test:
trigger:
set {_t} to parse_book_text("test <tooltip:hello\>>&ab&cb&rc<akbbb:man,egg:test>ah\\no")
broadcast "%{_t}%"
add "{pages:[""%{_t}%""]}" to nbt of player's tool

function parse_book_text(str: string) :: string:
set {_str} to "%{_str}%<>"

while length of {_str} > 0:
set {_i::*} to parse_block({_str}, "<")
if {_i::1} is not -1:
set {_t} to size of {_items::*} + 1
set {_items::%{_t}%} to substr({_str}, 1, {_i::1} - 1)
loop {_attrs::*}:
set {_t2} to index of ":" in loop-value
set {_name} to substr(loop-value, 0, {_t2} - 1)
set {_value} to substr(loop-value, {_t2} + 1)
set {_items::%{_t}%::attrs::%{_name}%} to {_value}
set {_str} to substr({_str}, {_i::1})

set {_i::*} to parse_block({_str}, ">")
if {_i::1} is not -1:
set {_t} to slice({_i::2}, 2, -1)
delete {_attrs::*}
while length of {_t} > 0:
set {_i2::*} to parse_block({_t}, ",")
add {_i2::2} to {_attrs::*}
if {_i2::1} is -1:
stop loop
set {_t} to substr({_t}, {_i2::1} + 1)

set {_str} to substr({_str}, {_i::1} + 1)

else:
stop loop

loop {_items::*}:
delete {_nbt::*}
add "\""text\"":\""%loop-value%\""" to {_nbt::*}
loop {_items::%loop-index%::attrs::*}:
if loop-index-2 is "tooltip":
add "\""hoverEvent\"":{\""action\"":\""show_text\"",\""value\"":\""%loop-value-2%\""}" to {_nbt::*}

set {_data} to join {_nbt::*} with ","
add "{%{_data}%}" to {_components::*}

set {_data} to join {_components::*} with ","
return "[%{_data}%]"

function slice(str: string, start: number, end: number) :: string:
if {_start} < 0:
add length of {_str} + 1 to {_start}
if {_end} < 0:
add length of {_str} + 1 to {_end}
return substr({_str}, {_start}, {_end})
function substr(str: string, start: number, end: number=-1) :: string:
if {_end} is -1:
set {_end} to length of {_str}

if {_start} > length of {_str}:
return ""

return substring of {_str} from {_start} to {_end}

function parse_block(str: string, end: strings) :: objects:
set {_spl::*} to {_str} split at ""
set {_r} to -1
set {_text} to ""
set {_idx} to 1

while {_idx} < size of {_spl::*}:
set {_c} to {_spl::%{_idx}%}

set {_next} to {_idx} + 1
set {_next} to {_spl::%{_next}%}

if {_c} is "\":
add 1 to {_idx}
else if {_end::*} contains {_c}:
set {_r} to {_idx}
stop loop

set {_text} to "%{_text}%%{_spl::%{_idx}%}%"

add 1 to {_idx}

set {_r::1} to {_r}
set {_r::2} to {_text}
return {_r::*}
function substr(str: string, start: number, end: number=-1) :: string:
if {_end} is -1:
set {_end} to length of {_str}

if {_start} > length of {_str}:
return ""

return substring of {_str} from {_start} to {_end}

function parse_block(str: string, end: strings) :: objects:
set {_spl::*} to {_str} split at ""
set {_r} to -1
set {_text} to ""
set {_idx} to 1

while {_idx} < size of {_spl::*}:
set {_c} to {_spl::%{_idx}%}

set {_next} to {_idx} + 1
set {_next} to {_spl::%{_next}%}

if {_c} is "\":
add 1 to {_idx}
else if {_end::*} contains {_c}:
set {_r} to {_idx}
stop loop

set {_text} to "%{_text}%%{_spl::%{_idx}%}%"

add 1 to {_idx}

set {_r::1} to {_r}
set {_r::2} to {_text}
return {_r::*}
何か
何か4mo ago
No description
何か
何か4mo ago
command /test:
trigger:
set {_l::1} to "name"
set {_l::2} to " %player%"
set {_l::3} to "uuid"
set {_l::4} to " %uuid of player%"
set {_l::5} to "item"
set {_l::6} to " %player's tool%"
set {_l::7} to "location"
set {_l::8} to " %floor(x-pos of location of player)%"
set {_l::9} to " %floor(y-pos of location of player)%"
set {_l::10} to " %floor(z-pos of location of player)%"
set {_t} to parse_book_text(join {_l::*} with "\\n")
add "{pages:[""%{_t}%""]}" to nbt of player's tool
command /test:
trigger:
set {_l::1} to "name"
set {_l::2} to " %player%"
set {_l::3} to "uuid"
set {_l::4} to " %uuid of player%"
set {_l::5} to "item"
set {_l::6} to " %player's tool%"
set {_l::7} to "location"
set {_l::8} to " %floor(x-pos of location of player)%"
set {_l::9} to " %floor(y-pos of location of player)%"
set {_l::10} to " %floor(z-pos of location of player)%"
set {_t} to parse_book_text(join {_l::*} with "\\n")
add "{pages:[""%{_t}%""]}" to nbt of player's tool
こういう使い方ができてコードがきれいにまとめられる attributeは自分で追加
Want results from more Discord servers?
Add your server
More Posts
minecraftのスコアボードのスコア条件をskript内で作る方法minecraftのscoreboardコマンドで操作できる2つのスコア(A,Bとする)について AがBよりも大きければ〜のようなことができれば教えてもらいたいですskによるリソパ読み込みの動作不良```applescript on load: set {packURL} to "https://github.com/tsukineko0308/BadConditions/raw/maguiを開いた状態でのクリックの左右の検知がしたいon inventory right click:のようなことがしたいのですが方法が見当たらないので教えてもらいたいです...自作投げナイフにおける与ダメの数値設定の動作不良```appleScript on right click: cooldown of diamond sword of player <= 0 set {_k} to player's関数内でのlore設定に関する動作不良# 環境 PlayerRealms (1.12.2) - Skbee 1.10.2 - Skquery 4.1.3 - Skellet 1.9.11-pr - Skript 2.3.6 - SkRaエンティティを円を描くように特定の位置に移動させる方法画像のようにエンティティを円を描くような形で特定の位置に移動させたいです。 調べてみてもあまりいい方法が分からず、何か方法があればご教授していただきたいです。レシピを削除した状態でログインした際のエラー文のスパムについてSkBee の構文( https://skripthub.net/docs/?id=10537 )を用いて、バニラのレシピを全て削除しています。 ``` on load: remove allon chest close みたいなことがしたいチェストの開閉を検知したいです ひとしきり調べてみたのですが いい方法が思い浮かびませんでした なにとぞ知恵をお貸しください…アイテムがつるはしかどうか検知したいgui作ってるのですが、クリックしたアイテムがつるはしだったとき(木,石,轍,ダイヤなど関係なく)検知したいのですが、なにかいい方法あったりしますか? ``` if item is wood pickshow TEMP の挙動の相談sk 2.5.3 です `show crit with speed 1 at location at {_loc}` 上記構文でエフェクトを表示させると vector 1,1,1 方向にだけ飛ぶエフェ