Create a journal of thoughts ... an experiment

This commit is contained in:
Howard Abrams 2025-07-31 22:26:33 -07:00
parent 6870c9008e
commit 92f7ef565b
2 changed files with 276 additions and 33 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
import random from datetime import datetime
from random import choice
from evennia import Command, CmdSet from evennia import Command, CmdSet
from evennia.utils import logger from evennia.utils import logger
@ -205,10 +206,25 @@ class WriteableBook(Book):
def do_write_end(self, writer): def do_write_end(self, writer):
writer.announce_action( writer.announce_action(
self.db.pre_write_msg or self.db.post_write_msg or
"$You() $conj(put) down the quill, and $conj(stop) writing.") "$You() $conj(put) down the quill, and $conj(stop) writing.")
class Journal(WriteableBook):
"""
A special writeable book, that stores the contents
in a different file based on the date.
"""
def do_write(self, writer, message):
"""
Change the self.db.inside to a date.
"""
today = datetime.now()
self.db.inside = 'file:/home/howard/howardabrams/thoughts/' + \
today.strftime("%Y%m%d")
super().do_write(writer, message)
class Books(Object): class Books(Object):
book_prototype = { book_prototype = {
"typeclass": "typeclasses.readables.Book", "typeclass": "typeclasses.readables.Book",
@ -223,7 +239,7 @@ class Books(Object):
self.cmdset.add_default(CmdSetShelf, persistent=True) self.cmdset.add_default(CmdSetShelf, persistent=True)
def new_book_details(self): def new_book_details(self):
title = random.choice(list(BOOKS.keys())) title = choice(list(BOOKS.keys()))
return ( return (
title, title,
routput("""a <<worn ^ barely read ^ pristine copy of a ^ >> routput("""a <<worn ^ barely read ^ pristine copy of a ^ >>
@ -234,8 +250,8 @@ class Books(Object):
You <<open ^ open up ^ crack open>> your book, entitled, |w{0}|n, and read the {1} {2} of {3}. You <<open ^ open up ^ crack open>> your book, entitled, |w{0}|n, and read the {1} {2} of {3}.
""", """,
title, title,
random.choice(BOOK_EMOTIONS), choice(BOOK_EMOTIONS),
random.choice(BOOK_TYPES), choice(BOOK_TYPES),
BOOKS[title] BOOKS[title]
) )
) )

View file

@ -109,7 +109,7 @@ py timed_script = evennia.create_script(key="Create Sticks",
attributes=[("destination", here)] ) attributes=[("destination", here)] )
# Sticks:1 ends here # Sticks:1 ends here
# Guest Book # Guest Book
# Players can leave messages in this book. Well see how long I want to leave this. # Players can leave messages in this book. Well see how long I want to leave this.
@ -118,7 +118,7 @@ py timed_script = evennia.create_script(key="Create Sticks",
# #
@set guest book/inside = "file:world/guest-book.md" @set guest book/inside = "file:world/guest-book.md"
# #
@set guest book/prefix = "You open the leather-bound book, and begin to read from page one..."" @set guest book/prefix = "You open the leather-bound book, and begin to read from page one..."
# Guest Book:1 ends here # Guest Book:1 ends here
@ -127,7 +127,7 @@ py timed_script = evennia.create_script(key="Create Sticks",
# [[file:../../../projects/mud.org::*Guest Book][Guest Book:2]] # [[file:../../../projects/mud.org::*Guest Book][Guest Book:2]]
@desc guest book = The root from one of the collosal trees has erupted from the ground, forming a dry alcove that harbors a colony of mushroom caps. Jauntily perched on the largest of these, a leather-bound book, sports the title, |wGuest Book|n. Next to it, a feather quill and an ink well invite you to read the register, and leave a note for other travelers. @desc guest book = The root from one of the colossal trees has erupted from the ground, forming a dry alcove that harbors a colony of mushroom caps. Jauntily perched on the largest of these, a leather-bound book, sports the title, |wGuest Book|n. Next to it, a feather quill and an ink well invite you to read the register, and leave a note for other travelers.
# Guest Book:2 ends here # Guest Book:2 ends here
@ -848,9 +848,11 @@ py timed_script = evennia.create_script(key="Create Sticks",
# [[file:../../../projects/mud.org::*Beast][Beast:20]] # [[file:../../../projects/mud.org::*Beast][Beast:20]]
@set beast/pet_sleeping_response = "Petting a sleeping beast of that size isn't your best idea."
#
@set beast/pet_scared_response = "$You() can't get near the wild beast to pet it. It seems scared." @set beast/pet_scared_response = "$You() can't get near the wild beast to pet it. It seems scared."
# #
@set beast/pet_concerned_response = "$You can't get near the big, hairy beast to pet it. It seems concerned." @set beast/pet_concerned_response = "$You() can't get near the big, hairy beast to pet it. It seems concerned."
# #
@set beast/pet_interested_response = "The big hairy beastie keeps its distance, but seems curious about $you()." @set beast/pet_interested_response = "The big hairy beastie keeps its distance, but seems curious about $you()."
# #
@ -2368,6 +2370,194 @@ pose gnome/default = smoking his pipe
@give pipe = gnome @give pipe = gnome
# Pipe:2 ends here # Pipe:2 ends here
# Journal
# The pipe is little more than messages to the smoker and everyone else in the room.
# [[file:../../../projects/mud.org::*Journal][Journal:1]]
@create large book;journal: typeclasses.readables.Journal
# Journal:1 ends here
# Writing descriptions:
# [[file:../../../projects/mud.org::*Journal][Journal:2]]
@set journal/pre_write_msg = "With a small octarine spark, a quill appears in the air. $You() $conj(grab) the quill and begin to write in $pron(your) large book."
#
@set journal/post_write_msg = "The quill disappears in a small puff of smoke, as $you() $conj(close) $pron(your) book."
# Journal:2 ends here
# And a description:
# [[file:../../../projects/mud.org::*Journal][Journal:3]]
@desc journal = Leather-bound book worns with ages.
#
@give journal = gnome
# Journal:3 ends here
# And its description:
# [[file:../../../projects/mud.org::*Stoat][Stoat:2]]
@desc stoat = A charming creature with a slender, elongated body covered in soft, white fur that glistens like freshly fallen snow. When open, its large, round eyes are a striking shade of lavender, and its bushy tail, tipped with a hint of violet.
# Stoat:2 ends here
# Cant get this guy:
# [[file:../../../projects/mud.org::*Stoat][Stoat:3]]
@lock stoat = get:false()
#
@set stoat/get_err_msg = "Each time you try to pick it up, it serpentines it way back to the chair."
# Stoat:3 ends here
# Lets get a bit more interaction with this pet:
# [[file:../../../projects/mud.org::*Stoat][Stoat:4]]
@set stoat/active_amount = 15
# Stoat:4 ends here
# Its level doesnt change much. :-D It is always less interested, just like a cat.
# [[file:../../../projects/mud.org::*Stoat][Stoat:5]]
@set stoat/scared_msg = "Currently, coiled like a sleeping snake on one of the chairs."
# Stoat:5 ends here
# And petting it when someone first comes in?
# [[file:../../../projects/mud.org::*Stoat][Stoat:6]]
@set stoat/pet_scared_response = "While it doesn't stop $you() << from petting it ^ >>, the beastie flashes its long teeth."
# Stoat:6 ends here
# [[file:../../../projects/mud.org::*Stoat][Stoat:7]]
@set stoat/scared_actions = "The wee beastie << asleep on the chair ^ >> let's out a yawn brandishing its large canines. ;;
The wee beastie << asleep on the chair ^ >> uncoils itself, stretches, and recoils again. ;;
You hear a deep throated rumbling from the wee beastie << asleep on the chair ^ >> . ;;
The wee beastie twitches in its sleep, as if chasing down imaginary prey."
# Stoat:7 ends here
# Concerned level:
# [[file:../../../projects/mud.org::*Stoat][Stoat:8]]
@set stoat/concerned_msg = "Currently, curled into a ball on one of the chairs."
# Stoat:8 ends here
# Pets?
# [[file:../../../projects/mud.org::*Stoat][Stoat:9]]
@set stoat/pet_concerned_response = "$You() get little response from << your pets of ^ >> << the wee beastie ^ the beastie >>. "
# Stoat:9 ends here
# And actions at this level are more cute than sinister:
# [[file:../../../projects/mud.org::*Stoat][Stoat:10]]
@set stoat/concerned_actions = "The wee beastie << asleep on the chair ^ >> let's out an adorable yawn. ;;
The wee beastie << asleep on the chair ^ >> uncurls itself, stretches, and recurls again. ;;
You hear a deep purring sounds from the wee beastie << asleep on the chair ^ >>. ;;
The wee beastie twitches in its sleep, as if playing with dream toys."
# Stoat:10 ends here
# Interested level:
# [[file:../../../projects/mud.org::*Stoat][Stoat:11]]
@set stoat/interested_msg = "<< Currently ^ It is >> curled into a ball on {1} lap."
# Stoat:11 ends here
# Pets
# [[file:../../../projects/mud.org::*Stoat][Stoat:12]]
@set stoat/pet_interested_response = "The << wee ^ >> beastie adorably moves its head into $your() pets."
# Stoat:12 ends here
# And actions at this level are about as cute as a cat can be:
# [[file:../../../projects/mud.org::*Stoat][Stoat:13]]
@set stoat/interested_actions = "The << sleepy ^ wee >> beastie << on {1} lap ^ >> let's out an adorable yawn. ;;
The << sleepy ^ wee >> beastie << on {1} lap ^ >> uncurls itself, stretches, and recurls again. ;;
{0} pets the << sleepy ^ wee >> beastie << on |p lap ^ >> as it snuggles << close ^ >>. ;;
You hear a deep purring sounds from the << sleepy ^ wee >> beastie << on {1} lap ^ >>. ;;
The << sleepy ^ wee >> beastie twitches in its sleep, as if playing with dream toys."
# Stoat:13 ends here
# Friendly level:
# [[file:../../../projects/mud.org::*Stoat][Stoat:14]]
@set stoat/friendly_msg = "<< Currently ^ It is >> curled up and purring on {1} lap."
# Stoat:14 ends here
# Pets
# [[file:../../../projects/mud.org::*Stoat][Stoat:15]]
@set stoat/pet_friendly_response = "The << wee ^ >> beastie adorably moves its head into $your() pets. ;;
$You() << rub ^ pet >> the stubby but soft ears of the << wee ^ >> beastie, as it lets out a little purr. ;;
The << wee ^ >> beastie rolls onto its back while $you() rub its tummy. It lets out a little purr. ;;
$You() << scratch ^ massage >> the soft << back ^ rump >> of the << wee ^ >> beastie. It wriggles around trying to get the most of this attention."
# Stoat:15 ends here
# And actions at this level are about as cute as a cat can be:
# [[file:../../../projects/mud.org::*Stoat][Stoat:16]]
@set stoat/friendly_actions = "The << sleepy ^ wee >> beastie << on {1} lap ^ >> let's out an adorable yawn. ;;
The << sleepy ^ wee >> beastie << on {1} lap ^ >> uncurls itself, stretches, and recurls again. ;;
{0} pets the << sleepy ^ wee >> beastie << on |p lap ^ >> as it snuggles << close ^ >>. ;;
You hear a deep purring sounds from the << sleepy ^ wee >> beastie << on {1} lap ^ >>. ;;
The << sleepy ^ wee >> beastie twitches in its sleep, as if playing with dream toys."
# Stoat:16 ends here
# An this pet loves his gnome.
# [[file:../../../projects/mud.org::*Stoat][Stoat:17]]
@set gnome/wee_beastie_friendly_level=500
# Stoat:17 ends here
# Kitchen # Kitchen
# Better place to put the tea and scones. # Better place to put the tea and scones.
@ -2601,12 +2791,13 @@ py here.search("cabinet").do_bake()
# Pulling Sconce:2 ends here # Pulling Sconce:2 ends here
# Inside the Secret Room # Inside the Secret Room
# Time to create the secret lab, the *Secret Room*.
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:1]] # [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:1]]
@teleport mp12 @teleport mp12
# #
@desc here = A curious little room containing a stool next to a table covered with alchemical equipment--a testament to the arcane arts--cluttered yet meticulously organized. Oh, and a few empty bottles. @desc here = A curious little room containing a |Ystool|n next to a |Ytable|n covered with alchemical |Yequipment|n--a testament to the arcane arts--cluttered yet meticulously organized.
# Inside the Secret Room:1 ends here # Inside the Secret Room:1 ends here
@ -2626,42 +2817,63 @@ py here.search("cabinet").do_bake()
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:3]] # [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:3]]
@detail equipment;alchemical = A mortar and pestle, vials, crystal phials, jars, and tools all surround a black cauldron. @detail equipment;alchemical = A |Ymortar|n and |Ypestle|n, |Yvials|n, crystal |Yphials|n, |Yjars|n, and |Ytools|n all surround a black |Ycauldron|n.
# Inside the Secret Room:3 ends here # Inside the Secret Room:3 ends here
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:4]] # [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:4]]
@detail mortar;pestle = An obsidian mortar, its surface smooth and cool to the touch. Beside it, a pestle carved from a single piece of ancient bone, adorned with carvings of arcane symbols. @detail mortar;pestle;mortar and pestle = An obsidian mortar, its surface smooth and cool to the touch. Beside it, a pestle carved from a single piece of ancient bone, adorned with carvings of arcane symbols.
# Inside the Secret Room:4 ends here # Inside the Secret Room:4 ends here
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:5]] # [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:5]]
@detail = phials = Delicate crystal phials, each shaped like a teardrop, hang from a wrought iron rack. These phials may store volatile ingredients, which require special containment to prevent their magical properties from dissipating. @detail vials = Scattered across a small shelf, an array of empty glass vials. Perhaps you could fill these with potions yet to be created?
# Inside the Secret Room:5 ends here # Inside the Secret Room:5 ends here
# # such as powdered unicorn horn or phoenix feathers,
# Should the jars and vials be objects that could be picked up?
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:6]] # [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:6]]
@detail jars = Hrm. Newt eyes, bat wings... interesting contents. @detail phials = Delicate crystal phials, each shaped like a teardrop, attach to a wrought iron rack. Each contain vibrant liquids that swirl with colors not found in nature. Magically sealed, these phials may store volatile substances, which require special containment to prevent their magical properties from dissipating.
@detail vials = Scattered across the table are an array of glass vials, each containing vibrant liquids that swirl with colors not found in nature. Some are stoppered with cork, while others are sealed with wax.
# Inside the Secret Room:6 ends here # Inside the Secret Room:6 ends here
# Can jars be a producer that returns a random jar with a “content”?
# 1. Glimmering Dust A jar filled with fine, shimmering powder that sparkles like a thousand stars.
# 2. Dragon Blood A deep red liquid that swirls with hints of gold, resembling liquid rubies.
# 3. Mandrake Root A twisted, gnarled root with a faintly green hue, nestled in a jar of dark soil.
# 4. Moonstone Crystals Iridescent stones that glow softly in the dark, casting a gentle light.
# 5. Bottled Lightning A swirling blue liquid that crackles with energy, contained within a glass jar.
# 6. Enchanted Honey Thick, golden honey that glimmers with tiny flecks of light, like captured sunlight.
# 7. Dragon Scale Powder A fine, metallic powder that shifts colors with the light, reminiscent of dragon scales.
# 8. Mermaid Tears Tiny, glistening droplets that resemble diamonds, each one capturing a moment of sorrow.
# 9. Essence of Shadow A dark, swirling liquid that seems to absorb light, creating an eerie atmosphere.
# 10. Eye of Newt Filled with many small eyeballs.
# 11. Cursed Bone Shards Jagged pieces of bone, each one etched with strange symbols and glowing faintly.
# 12. Starflower Petals Delicate, translucent petals that shimmer like the night sky, layered in a glass jar.
# 13. Whispering Seeds Tiny, dark seeds that seem to rustle softly when the jar is moved, as if alive.
# 14. Golden Sand A jar filled with fine, shimmering sand that glows warmly, reminiscent of a sunset.
# 15. Wisp of Smoke A swirling, grayish substance that drifts lazily within the confines of its jar.
# 16. Nightshade Berries Dark, glossy berries that glisten ominously, nestled in a jar of dark liquid.
# 17. Phoenix Ashes A fine, gray powder that sparkles faintly, as if containing remnants of a fiery rebirth.
# 18. Silver Thread A spool of shimmering thread that glows softly, appearing almost ethereal in nature.
# 19. Timekeeper Sand A jar filled with golden sand that flows slowly, as if measuring the passage of time.
# 20. Elven Wine A deep green liquid that sparkles with tiny bubbles.
# 21. Ghostly Essence A pale, translucent ichor that swirls with a soft glow.
# 22. Celestial Oil A shimmering oil that glows with a soft light.
# 23. Cat Shadow a swirling, inky blackness that pulses and shifts.
# 24. Toadstool Caps Vibrant mushroom caps of red, orange, and yellow, and adorned with delicate white speckles that catch the light.
# This would be funny, but I dont want a player to litter around the world with jars of crap … unless we make a janitor that sweeps the places once a day. Of course, the Jar /dropped/ here, would be deleted.
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:7]]
@detail jars = Hrm. Newt eyes, bat wings... interesting contents.
# Inside the Secret Room:7 ends here
# Labels, written in elegant script, indicate their contents: "Essence of Nightshade," "Elixir of Clarity," and "Dragon's Blood."? # Labels, written in elegant script, indicate their contents: "Essence of Nightshade," "Elixir of Clarity," and "Dragon's Blood."?
# Bottles same as vials? # Bottles same as vials?
# [[file:../../../projects/mud.org::*Inside the Secret Room][Inside the Secret Room:7]]
@detail bottles = Four bottles contain clear liquids and are labeled: DA, KI, ON, and SU
# Inside the Secret Room:7 ends here
# And tools that definitely need to /stay here/: # And tools that definitely need to /stay here/:
@ -2863,7 +3075,7 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
# Imp:5 ends here # Imp:5 ends here
# [[file:../../../projects/mud.org::*Imp][Imp:7]] # [[file:../../../projects/mud.org::*Imp][Imp:7]]
@set imp/arrive = "5 ;; emote stares at you quizically. ;; 240 ;; emote yawns." @set imp/arrive = "5 ;; tag_all alchemist ;; 240 ;; emote yawns."lsy
# Imp:7 ends here # Imp:7 ends here
@ -2899,6 +3111,9 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
@set mushrooms/make_amount = 1 @set mushrooms/make_amount = 1
# #
@set mushrooms/make_spell_msgs = "10 ;; $You() $conj(<< giggle ^ chuckle ^ chortle >>) out loud." @set mushrooms/make_spell_msgs = "10 ;; $You() $conj(<< giggle ^ chuckle ^ chortle >>) out loud."
#
# And we can't see them until we are an alchemist:
@lock mushrooms = view:tag(alchemist)
# Laughing Potion:1 ends here # Laughing Potion:1 ends here
@ -2922,6 +3137,9 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
@set tickleweed/make_desc = "This grass vibrates as if giggling." @set tickleweed/make_desc = "This grass vibrates as if giggling."
# #
@set tickleweed/make_amount = 1 @set tickleweed/make_amount = 1
#
# And we can't see them until we are an alchemist:
@lock tickleweed = view:tag(alchemist)
# Laughing Potion:2 ends here # Laughing Potion:2 ends here
@ -2969,6 +3187,9 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
@set pixie dust/make_desc = "Small bag of the good, shiny stuff." @set pixie dust/make_desc = "Small bag of the good, shiny stuff."
# #
@set pixie dust/make_amount = 1 @set pixie dust/make_amount = 1
#
# And we can't see them until we are an alchemist:
@lock pixie dust = view:tag(alchemist)
# Trippy Potion:1 ends here # Trippy Potion:1 ends here
@ -2986,8 +3207,8 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
@set stream/get_err_msg = "Seriously? You can't get that. Perhaps a bottle, or at least a cup, could hold the fresh water." @set stream/get_err_msg = "Seriously? You can't get that. Perhaps a bottle, or at least a cup, could hold the fresh water."
# #
@desc stream = A small stream, almost hidden behind the ferns and brambleberry bushes, drops down a lush hill, creating a lush, relaxing feeling. The water looks fresh and pure. @desc stream = A small stream, almost hidden behind the ferns and brambleberry bushes, drops down a lush hill, creating a lush, relaxing feeling. The water looks fresh and pure.
# #
@set stream/fill_name = "still water" @set stream/fill_name = "still water"
# #
@set stream/fill_desc = "fresh spring water." @set stream/fill_desc = "fresh spring water."
# #
@ -3017,6 +3238,9 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
@set mushrooms/make_amount = 1 @set mushrooms/make_amount = 1
# #
@set mushrooms/make_spell_msgs = "10 ;; $You() $conj(nod) off, as $pron(your) head bobbles and bounces. ;; 5 ;; $You() $conj(awaken) with a start." @set mushrooms/make_spell_msgs = "10 ;; $You() $conj(nod) off, as $pron(your) head bobbles and bounces. ;; 5 ;; $You() $conj(awaken) with a start."
#
# And we can't see them until we are an alchemist:
@lock mushrooms = view:tag(alchemist)
# Trippy Potion:3 ends here # Trippy Potion:3 ends here
@ -3043,7 +3267,10 @@ py bt = self.search('imp'); bt.db.pose = 'sitting on an ornate perch'
# #
@set moonberries/make_eat_msg = "Slightly bitter. Not very good." @set moonberries/make_eat_msg = "Slightly bitter. Not very good."
# #
@set mushrooms/make_spell_msgs = "10 ;; $You() $conj(nod) off, as $pron(your) head bobbles and bounces. ;; 5 ;; $You() $conj(awaken) with a start." @set moonberries/make_spell_msgs = "10 ;; $You() $conj(stare) off into space, lost in thought. ;; $You() $conj(study) $pron(your) hands, utterly captivated. ;; 5 ;; $You() $conj(awaken) from a daydream with a start."
#
# And we can't see them until we are an alchemist:
@lock moonberries = view:tag(alchemist)
# Trippy Potion:4 ends here # Trippy Potion:4 ends here
# Other # Other