SwissBook

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?

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    51678
  • Created
    Feb 7, 2013
  • Last Released File
    Apr 10, 2014
  • Total Downloads
    4,286
  • License

Categories

Members

Recent Files

Bukkit