# +-----------------------------------
# | Book Meta Tester
# +-----------------------------------
Book Meta Tester:
type: world
events:
on gettestbook command:
- scribe drop 'script:Example book script' location:<player.location>
- narrate 'Hey look, a book on the ground!'
- determine fulfilled
on testbook command:
- define item player.item_in_hand
- if '<pr:example book script checker>' {
- narrate 'This is the book!'
- narrate "This is the title<&co> <%item%.book.title>"
- narrate "It has <%item%.book.page_count> pages."
- narrate "It was written by <%item%.book.author>!"
}
else narrate 'The item in your hand is not the test book.'
- determine fulfilled
Example book script:
type: book
title: This is an example title.
author: aufdemrand
text:
- page 1 is pretty short.
- page 2 is kind of short, but longer than page 1.
- page 3 is super short.
# We'll use this in the if statement to test if the book has the title
# we are looking for.
# Want to use something like this in interact script requirements?
# Just add an entry like so: - valueof '<pr:Example book script checker>'
Example book script checker:
type: procedure
script:
- if <player.item_in_hand.book.title> == 'This is an example title.'
determine true
else determine false