SwissBook 是一款插件,可让你轻松修正书籍中的错别字,并维护/更新服务器手册或其他书籍(已签名或未签名),无需费力删除半页内容或进行复制/粘贴操作。
SwissBook 提供了更新和维护书籍所需的所有功能。
文本编辑功能起初可能看起来有些复杂,但实际上非常简单。
功能:
文本
基于文本的操作:
- 获取书中指定文本片段的打印输出,并附带字符索引标记。
- 在指定文本后插入文本行(使用 "
|" 表示空格,使用 "~" 表示换行/断行)
- 将指定文本替换为其他指定文本(使用 "
|" 表示空格,使用 "~" 表示换行/断行)
- 删除文本
基于索引的操作:
- 获取书中指定文本片段的打印输出,并附带字符索引标记。
- 在指定的页码和索引处插入文本行(使用 "
|" 表示空格,使用 "~" 表示换行/断行)
- 将指定页码和索引处的文本替换为文本行(使用 "
|" 表示空格,使用 "~" 表示换行/断行)
- 将指定页码和索引处的文本复制到另一个指定的页码和索引处
- 将指定页码和索引处的文本覆盖到另一个指定的页码和索引处的文本上
- 删除指定页码和索引处的文本
页面
- 最多添加 500 页
- 插入页面
- 移动页面
- 删除页面
服务器手册
- 在玩家首次加入时给予每本预定义的书籍
- 当玩家使用 /manual 命令时给予他们一本预定义的书籍
其他
使用方法:
基于文本的操作:
该插件基于文本的命令最显著的用途是轻松地插入、删除或在由文本指定的位置替换文本。
请注意,你需要手持想要修改的书籍。
尝试使用 "/sb get 1 256 1"
这将打印出第 1 页从位置 1 到 256 的文本,它还会每隔 10 个位置插入一个蓝色数字,但这在默认模式下并不重要。
此命令在默认模式下仍然有用,因为它节省了每次打开书籍并搜索页面的时间,它还允许你在查看书籍内容的同时输入命令。
现在尝试 "/sb insert test 1 TextSomewhereOnPage1OfYourBook preview"
上一行中的文本 "TextSomewhereOnPage1OfYourBook" 应替换为你正在修改的书籍第 1 页上的任何文本,即通过 "get" 命令获取的那部分文本。
SwissBook 现在会向你展示如果执行插入命令,文本将如何显示。你会看到单词 "test" 已插入到你指定的第 1 页文本之后。
现在从聊天记录中检索该命令并移除单词 preview。
SwissBook 现在将在实际书籍中插入单词 " test"。
尝试 "/sb replace test foo 1 preview"
SwissBook 现在会向你展示如果执行替换命令,文本将如何显示。你会看到单词 "test" 已被单词 "foo" 替换。
与之前一样,你可以从聊天记录中检索该命令,并在确认 "test" 确实被 "foo" 替换后移除 "preview"。
你还可以使用 "replaceall" 来替换页面上所有出现的单词 test。
尝试 "/sb delete foo 1 preview"
SwissBook 现在会向你展示如果执行删除命令,文本将如何显示。你会看到单词 "foo" 已被删除。
与之前一样,你可以从聊天记录中检索该命令,并在确认 "foo" 确实被移除后移除 "preview"。
这些命令始终会影响页面上方文本的第一个实例。如果需要影响其他实例,请使用高级模式或使你的命令更具体。
你可以使用 "|" 作为空格,使用 "~" 作为换行符。这意味着如果你想将完整的句子甚至多行文本放入书籍中,只需将空格替换为 |,将回车/换行替换为 ~。
例如:"hello|world,~how|are|you?"
最终在书籍中显示为:
hello world,
how are you?
基于索引的操作:
该插件基于索引的命令最显著的用途是在特定位置插入、复制和/或替换文本。
为此,我们首先必须确定你想要使用的字符/位置的索引。
你可以手动计算页面上的每个字符,但 "/sb get" 使这变得容易得多。
请注意,你需要手持想要修改的书籍。
尝试使用 "/sb get 1 256 1"
这将打印出第 1 页从位置 1 到 256 的文本,它还会每隔 10 个位置插入一个蓝色数字,因此你可以轻松获得你想要使用的位置的索引。
现在尝试 "/sb insert 5 1 test preview"
SwissBook 现在会向你展示如果执行插入命令,文本将如何显示。你会看到单词 "test" 已插入到第 1 页的第 5 个索引处。
现在从聊天记录中检索该命令并移除单词 preview。
SwissBook 现在将在实际书籍中插入单词 " test"。
尝试 "/sb replace 5 8 1 foo preview"
SwissBook 现在会向你展示如果执行替换命令,文本将如何显示。你会看到单词 "test" 已被单词 "foo" 替换
与之前一样,你可以从聊天历史中获取命令,并在确认 “test” 确实已被替换为 “foo” 后移除 “preview”。
尝试执行 "/sb delete 5 7 1 preview"
Swissbook 现在会展示如果执行删除命令后文本的外观。你会看到单词 “foo” 已被删除。
与之前一样,你可以从聊天历史中获取该命令,并在确认 “foo” 确实被移除后移除 “preview”。
经过以上介绍,请随意尝试其他命令。
命令:
- /swissbook
- 命令前缀,别名 /sb,无实际功能。
文本编辑
基于文本的:
- /sb get [起始索引] [结束索引] [页码] <间隔>
- 打印“页码”上从“起始索引”到“结束索引”的文本,并可选设置索引标记的间隔(默认为 10)。
- /sb insert [新文本] [页码] [要追加到的文本]
- 在“页码”上第一个出现的“要追加到的文本”之后插入“新文本”。你可以使用 "
|" 表示空格,使用 "~" 表示换行。
- /sb replace [要替换的文本] [替换后的文本] [页码]
- 将“页码”上第一个出现的“要替换的文本”替换为“替换后的文本”。你可以使用 "
|" 表示空格,使用 "~" 表示换行。
- /sb replaceall [要替换的文本] [替换后的文本] [页码]
- 将“页码”上所有出现的“要替换的文本”替换为“替换后的文本”。你可以使用 "
|" 表示空格,使用 "~" 表示换行。
- /sb delete [要删除的文本] [页码]
- 删除“页码”上第一个出现的“要删除的文本”。
基于索引的:
- /sb get [起始索引] [结束索引] [页码] <间隔>
- 打印“页码”上从“起始索引”到“结束索引”的文本,并可选设置索引标记的间隔(默认为 10)。
- /sb insert [索引] [页码] [文本]
- 在“页码”的“索引”位置插入文本。你可以使用 "
|" 表示空格,使用 "~" 表示换行。
- /sb replace [起始索引] [结束索引] [页码] [文本]
- 将“页码”上从“起始索引”到“结束索引”的文本替换为“文本”。你可以使用 "
|" 表示空格,使用 "~" 表示换行。
- /sb copy [起始索引] [结束索引] [页码1] [索引] [页码2]
- 将“页码1”上从“起始索引”到“结束索引”的文本复制到“页码2”的“索引”位置。
- /sb copyr [起始索引1] [结束索引1] [页码1] [起始索引2] [结束索引2] [页码2]
- 将“页码1”上从“起始索引1”到“结束索引1”的文本复制,并替换“页码2”上从“起始索引2”到“结束索引2”的文本。
- /sb delete [起始索引] [结束索引] [页码]
- 删除“页码”上从“起始索引”到“结束索引”的文本。
页面相关
- /sb addp <数量>
- 添加页面,“数量”为可选参数,默认为 1。
- /sb deletep [页码1][页码2]
- 删除从“页码1”到“页码2”的所有页面。
- /sb insertp [页码] <数量>
- 在“页码”之前插入新页面,“数量”为可选参数,默认为 1。
- /sb movep [页码1] [页码2]
- 将“页码1”移动到“页码2”之前。
服务器手册
- /sb setm
- 将你手中持有的书设置为服务器手册,玩家首次加入时将收到一份手册副本。
- /manual [玩家]
- 如果已设置手册,则给指定玩家一份手册副本;如果不指定玩家,则给自己发放一份手册。
其他
- /sb unsign
- 取消签名一本书,将其变为“书与笔”,并移除作者和标题。
- /sb sign [文本]
- 将“文本”设置为作者。
- /sb title [文本]
- 将“文本”设置为标题。
- /sb more <数量>
- 增加你物品栏中该书的堆叠数量,“数量”为可选参数,默认为 1。
权限:
只有当对应的权限节点附加了 ".signed" 时,命令才能用于已签名的书。
例如:拥有 "swissbook.page.move" 权限的玩家只能在未签名的书(即“书与笔”)中移动页面;若要移动已签名书中的页面,则需要 "swissbook.page.move.signed"。
取消签名书籍的情况类似:拥有 "swissbook.unsign" 权限的玩家只能取消自己签名的书的签名;如果你希望玩家能够取消其他玩家所签名的书的签名,请赋予他们 "swissbook.unsign.other" 权限。
如果你不希望玩家更改其他玩家的书籍,也不要给予他们 "swissbook.sign" 权限,因为他们可以利用该命令将书据为己有,随后仍可取消签名并修改该书。
推荐的玩家权限节点:
- swissbook.page.move
- swissbook.page.insert
- swissbook.page.delete
- swissbook.page.add
- swissbook.delete
- swissbook.insert
- swissbook.get
- swissbook.replace
- swissbook.copy
- swissbook.copyr
- swissbook.unsign
- swissbook.manual
推荐的管理员权限节点:
- swissbook.page.move.signed
- swissbook.page.insert.signed
- swissbook.page.delete.signed
- swissbook.page.add.signed
- swissbook.delete.signed
- swissbook.insert.signed
- swissbook.get.signed
- swissbook.replace.signed
- swissbook.copy.signed
- swissbook.copyr.signed
- swissbook.title
- swissbook.sign
- swissbook.unsign.other
- swissbook.setmanual
- swissbook.manual.other
- swissbook.more
安装:
将 jar 文件放入你的 plugins 文件夹并启动服务器即可。
默认情况下,只有操作员(ops)才能访问这些命令;如果你希望为普通成员启用此插件,则需要一个权限管理插件。
即将推出的功能:
- 在 get 和 preview 中实现文本换行与格式调整,以尽可能还原书中的排版效果。
- 添加用于表示章节符号(颜色代码符号)的占位符
- 支持转义字符
- 可配置的占位符
- 欢迎提出建议?
SwissBook is a plugin that will enable you to fix typos in books and maintaining/updating server manuals or other books(signed or unsigned) without the hassle of deleting half your page or copy/pasting.
SwissBook offers every function needed to update and maintain your books.
the text editing might seem a bit complicated at first, but its simple, really.
functions:
text
- preview changes
- honors character and line limits
text-based:
- get a printout of a specified piece of text in a book with character index notations.
- insert lines of text after the specified text (use "
|" as spaces and "~" as enter/line-break)
- replace specified text with other specified text (use "
|" as spaces and "~" as enter/line-break)
- delete text
index-based:
- get a printout of a specified piece of text in a book with character index notations.
- insert lines of text at the specified page and index (use "
|" as spaces and "~" as enter/line-break)
- replace text at specified page and index with lines of text (use "
|" as spaces and "~" as enter/line-break)
- copy text at specified page and index to another specified page and index
- copy text at specified page and index over text at another specified page and index
- delete text at a specified page and index
pages
- add up to 500 pages
- insert pages
- move pages
- delete pages
server manual
- give every player a predefined book on first join
- give players a predefined book when they use /manual
miscellaneous
- change author
- change title
- copy books
- unsign books
Usage:
text-based:
the most notable use for this plugins text-based commands is to easily insert, delete or replace text at a location specified by text.
note that you need to be holding the book you want to modify.
try using "/sb get 1 256 1"
this will print out the text from location 1 to 256 on page 1, it will also insert a blue number every 10 locations, but thats not really important in default mode
this command is still usefull in default mode because it saves you from opening your book and searching the page everytime, it also allows you to type your command while you can still see what is in the book.
now try "/sb insert test 1 TextSomewhereOnPage1OfYourBook preview"
the text "TextSomewhereOnPage1OfYourBook" in the line above shuld be replace by any text oon page 1 of the book your modifying, a piece of the text that was retrieved by the "get" command.
swissbook now shows you how the text would look if the insert command would be executed. you'll see that the word "test" has been inserted at after the text you specified on the 1st page
now retrieve the command from your chat history and remove the word preview.
swissbook will now insert the word " test" in the accual book.
try "/sb replace test foo 1 preview"
swissbook now shows you how the text would look if the replace command would be executed. you'll see that the word "test" has been replaced with the word "foo"
as before you can retrieve the command from your chat history and remove "preview" if you confirmed "test" was indeed replaced with "foo"
you can also use "replaceall" to replace all instances of the word test on the page.
try "/sb delete foo 1 preview"
swissbook now shows you how the text would look if the delete command would be executed. you'll see that the word "foo" has been deleted.
as before you can retrieve the command from your chat history and remove "preview" if you confirmed "foo" was indeed removed.
these commands will always effect the first instance of the text from the top of the page, if you need it to effect another instance, use advanced mode or make your command more specifick
you can use "|" as spaces and "~" as line breaks. this means that if you want to put a complete sentence or even multiple lines in your book, you just replace spaces with | end enters/linebreaks with ~.
i.e: "hello|world,~how|are|you?"
would end up in the book as:
hello world,
how are you?
index-based:
the most notable use for this plugins index-based commands is to insert, copy and/or replace text at a specifick location.
to do this we must first figure out the index of the characters/location you want to use.
you could go about by counting every character on the page, but "/sb get" makes this alot easier.
note that you need to be holding the book you want to modify.
try using "/sb get 1 256 1"
this will print out the text from location 1 to 256 on page 1, it will also insert a blue number every 10 locations, so you can easily get the index of the location you want to use.
now try "/sb insert 5 1 test preview"
swissbook now shows you how the text would look if the insert command would be executed. you'll see that the word "test" has been inserted at the 5th index on the 1st page
now retrieve the command from your chat history and remove the word preview.
swissbook will now insert the word " test" in the accual book.
try "/sb replace 5 8 1 foo preview"
swissbook now shows you how the text would look if the replace command would be executed. you'll see that the word "test" has been replaced with the word "foo"
as before you can retrieve the command from your chat history and remove "preview" if you confirmed "test" was indeed replaced with "foo"
try "/sb delete 5 7 1 preview"
swissbook now shows you how the text would look if the delete command would be executed. you'll see that the word "foo" has been deleted.
as before you can retrieve the command from your chat history and remove "preview" if you confirmed "foo" was indeed removed
after this introduction, feel free to experiment with other commands
Commands:
- /swissbook
- command prefix, alias /sb, no function.
Text editing
text-based:
- /sb get [begin index] [end index] [page] <interval>
- print text from "begin index" , to "end index", on "page", with interval as optional index notation interval(defaults to 10).
- /sb insert [new Text] [page] [text to append]
- inserts "new Text" , on "page" after the first instance of "text to append". you can use "
|" as spaces and "~" as line breaks.
- /sb replace [text to replace] [text to replace with] [page]
- replaces the first instance of "text to replace", on "page" with "text to replace with". you can use "
|" as spaces and "~" as line breaks.
- /sb replaceall [text to replace] [text to replace with] [page]
- replaces every instance of "text to replace", on "page" with "text to replace with". you can use "
|" as spaces and "~" as line breaks.
- /sb delete [text to delete] [page]
- deletes the first instance of "text to delete" on "page"
index-based:
- /sb get [begin index] [end index] [page] <interval>
- print text from "begin index" , to "end index", on "page", with interval as optional index notation interval(defaults to 10).
- /sb insert [index] [page] [text]
- inserts text at "index" , on "page". you can use "
|" as spaces and "~" as line breaks.
- /sb replace [begin index] [end index] [page] [text]
- replaces text at "begin index" , to "end index", on "page" with "text". you can use "
|" as spaces and "~" as line breaks.
- /sb copy [begin index] [end index] [page1] [index] [page2]
- copies text from "begin index" to "end index" on "page1" to "index" on "page2"
- /sb copyr [begin index1] [end index1] [page1] [begin index2] [end index2] [page2]
- copies text from "begin index1" to "end index1" on "page1", and replaces "begin index2" to "end index2" on "page2"
- /sb delete [begin index] [end index] [page]
- deletes text at "begin index" to "end index" on "page"
Page related
- /sb addp <amount>
- add pages, "amount" is optional, defaults to 1
- /sb deletep [page1][page2]
- deletes all pages from "page1" to "page2"
- /sb insertp [page] <amount>
- inserts new page infront of "page", "amount" is optional, default is 1
- /sb movep [page1] [page2]
- moves "page1" in front of "page2"
server manual
- /sb setm
- sets the book you are holding in your hand as server manual, players will get a copy of the manual on their first join
- /manual [player]
- gives a player a copy of the manual if its set if no player is specified you will give yourself a manual
miscellaneous
- /sb unsign
- unsign a book, changes written book into book and quill, removes author and title
- /sb sign [text]
- sets "text" as author
- /sb title [text]
- sets "text" as title
- /sb more <amount>
- increases the number of books in your stack by "amount", "amount" is optional, defaults to 1
Permissions:
commands can only be used on written books if the correlating node is appended with ".signed".
i.e.: a player with "swissbook.page.move" can only move pages in unsigned books(book and quill), to move pages in a written book he would need "swissbook,page.move.signed".
unsigning books is similar, a player with "swissbook.unsign" can only unsign books they signed themselves, if you want players to be able to unsign other players books, give them "swissbook.unsign.other".
if you don't want players to be able to change other players books you also can't give them "swissbook.sign" as they would be able to use that command to make the book "their own" after which they would still be able to unsign and modify a book
recommended player nodes:
- swissbook.page.move
- swissbook.page.insert
- swissbook.page.delete
- swissbook.page.add
- swissbook.delete
- swissbook.insert
- swissbook.get
- swissbook.replace
- swissbook.copy
- swissbook.copyr
- swissbook.unsign
- swissbook.manual
recommended admin nodes:
- swissbook.page.move.signed
- swissbook.page.insert.signed
- swissbook.page.delete.signed
- swissbook.page.add.signed
- swissbook.delete.signed
- swissbook.insert.signed
- swissbook.get.signed
- swissbook.replace.signed
- swissbook.copy.signed
- swissbook.copyr.signed
- swissbook.title
- swissbook.sign
- swissbook.unsign.other
- swissbook.setmanual
- swissbook.manual.other
- swissbook.more
Installation:
drop the jar in your plugins folder and start your server.
by default only ops have access to commands, if you want to enable this plugin for normal members you will need a permissions plugin.
upcoming features:
- wordwrapping and formatting on get and preview to resemble to lay-out in the book.
- placeholder for the section sign (colorcode symbol)
- escape character
- configurable placeholders
- suggestions?
评论 0
登录后参与评分
还没有评论,来抢沙发吧