-
Notifications
You must be signed in to change notification settings - Fork 0
API UO BookSetText en
ClassicUO / Basic IDE
Writes text starting at page one of the open editable book.
UO.BookSetText(Text:Any) -> Unit
-
Text— Text: Chr(10) separates lines; Chr(13) is removed. At most 10 lines per page and 53 characters per line. NUL is rejected.
Unit: no returned value. This requests a write; it is neither TRUE/FALSE nor server confirmation. The server may refuse editing.
- First open the intended book through a game action. These commands select the most recently opened book; they do not accept its ID. With several books, check which one is current. Get reads loaded data and does not request a missing page.
- The manager stores book content in the session, including without graphics. Closing and reopening the game view retains the book and draft. Closing the book itself removes it from open books; disconnecting clears server books.
- Only editable books accept writes. Invalid pages and excessive text are rejected. BookSetText validates every page before sending any, so an invalid later page causes no partial write.
- BookSetText uses Chr(12) for explicit page breaks, or groups every 10 lines into a page when there are no form feeds. Remaining old pages are unchanged; explicitly call BookClearText first for a complete replacement. Empty text replaces only page one.
The server sends header/page count and then page content. SessionBooks validates each entire packet, retains data and updates its view. Basic selects the last book through the bridge; SessionBook reads local lines or validates a write and sends the book packet. ModernBookGump displays the same data and preserves drafts when graphics detach.
First open the intended book through a game action. These commands select the most recently opened book; they do not accept its ID. With several books, check which one is current. Get reads loaded data and does not request a missing page.
The manager stores book content in the session, including without graphics. Closing and reopening the game view retains the book and draft. Closing the book itself removes it from open books; disconnecting clears server books.
Project source: src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs; function GetOpenBook.
Only editable books accept writes. Invalid pages and excessive text are rejected. BookSetText validates every page before sending any, so an invalid later page causes no partial write.
Unit: no returned value. This requests a write; it is neither TRUE/FALSE nor server confirmation. The server may refuse editing.
Project source: src/ClassicUO.Client/Game/Managers/SessionBooks.cs; function SessionBooks.ReceiveHeader/ReceivePages; SessionBook.Yoko*.
First open the intended book through a game action. These commands select the most recently opened book; they do not accept its ID. With several books, check which one is current. Get reads loaded data and does not request a missing page.
# Direct use
#
# Writes text starting at page one of the open editable book.
#
# Unit: no returned value. This requests a write; it is neither TRUE/FALSE nor server
# confirmation. The server may refuse editing.
SUB Main()
# All examples assume the intended book is open, required pages are loaded, and writes use an
# editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text
# are illustrative.
UO.BookSetText("Mining route" + Chr(10) + "Start at camp")
END SUBParameter and execution notes:
- All examples assume the intended book is open, required pages are loaded, and writes use an editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text are illustrative.
# Practical scenario
#
# Writes text starting at page one of the open editable book.
#
# Unit: no returned value. This requests a write; it is neither TRUE/FALSE nor server
# confirmation. The server may refuse editing.
SUB Main()
# All examples assume the intended book is open, required pages are loaded, and writes use an
# editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text
# are illustrative.
UO.BookSetText("Camp A" + Chr(12) + "Camp B" + Chr(12) + "Return home")
END SUBParameter and execution notes:
- All examples assume the intended book is open, required pages are loaded, and writes use an editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text are illustrative.
# Complete helper function
#
# Writes text starting at page one of the open editable book.
#
# Unit: no returned value. This requests a write; it is neither TRUE/FALSE nor server
# confirmation. The server may refuse editing.
SUB Main()
# All examples assume the intended book is open, required pages are loaded, and writes use an
# editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text
# are illustrative.
WriteRoute("Northern mine", "Bring bandages")
END SUB
SUB WriteRoute(destination, supplies)
VAR firstPage = "Destination" + Chr(10) + destination
VAR secondPage = "Supplies" + Chr(10) + supplies
UO.BookSetText(firstPage + Chr(12) + secondPage)
END SUBParameter and execution notes:
- All examples assume the intended book is open, required pages are loaded, and writes use an editable book. Numbers 1, 2 and 3 are page numbers; verify those pages exist. Names and text are illustrative.
Русский · English · Українська · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
ClassicUO
Bad Newbie & Basic IDE
Найти в справочнике
Клиент и скрипты
Каталоги значений
Разработка и помощь