-
Notifications
You must be signed in to change notification settings - Fork 0
API UO BookGetPageText en
ClassicUO / Basic IDE
Reads one page of the most recently opened book.
UO.BookGetPageText(Page:Any) -> Any
-
Page— One-based page number, not a book serial. The server supplies the page count.
String: page lines separated by newlines, with trailing empty lines removed. Empty also means no open book, an unloaded page or an invalid number. It does not prove that a page exists or can be edited.
- 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.
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.
String: page lines separated by newlines, with trailing empty lines removed. Empty also means no open book, an unloaded page or an invalid number. It does not prove that a page exists or can be edited.
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
#
# Reads one page of the most recently opened book.
#
# String: page lines separated by newlines, with trailing empty lines removed. Empty also means
# no open book, an unloaded page or an invalid number. It does not prove that a page exists or
# can be edited.
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.
VAR text = UO.BookGetPageText(1)
IF text <> "" THEN
UO.Print(text)
END IF
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
#
# Reads one page of the most recently opened book.
#
# String: page lines separated by newlines, with trailing empty lines removed. Empty also means
# no open book, an unloaded page or an invalid number. It does not prove that a page exists or
# can be edited.
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.
VAR firstPage = UO.BookGetPageText(1)
IF firstPage <> "" THEN
UO.BookSetPageText(3, firstPage)
END IF
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
#
# Reads one page of the most recently opened book.
#
# String: page lines separated by newlines, with trailing empty lines removed. Empty also means
# no open book, an unloaded page or an invalid number. It does not prove that a page exists or
# can be edited.
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.
ReplaceCampNote(2)
END SUB
SUB ReplaceCampNote(page)
VAR text = UO.BookGetPageText(page)
IF text = "Camp A" THEN
UO.BookSetPageText(page, "Camp B")
END IF
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
Найти в справочнике
Клиент и скрипты
Каталоги значений
Разработка и помощь