this post was submitted on 04 Jan 2025
2 points (100.0% liked)

Perchance - Create a Random Text Generator

500 readers
13 users here now

โš„๏ธŽ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS
 

Is there anything that i can use to output the ai-character-chat content into a nice formatted layout that will allow for an easy printout? (im sending to .pdf) It drops out content and ive been using cut/copy/paste into a word document to try and clean up later.. but it's a headache. Thank you for any advice ๐Ÿ™‚ ๐Ÿ‘

top 6 comments
sorted by: hot top controversial new old
[โ€“] VioneT 2 points 5 days ago* (last edited 5 days ago) (2 children)

What part of messages are you wanting to print out? Just the messages + who sent it?

I've coded this one that recreates most of the messages + images in the chat, although you might need to add the character avatars to the code, and automatically selects all of it so you can right click and print selection.

You need to copy and paste that to the custom code section, then send a /print message to open the window. You can then double check, then click the 'Select All' button at the top and you can then right click the selection to print.

[โ€“] therandomcoypu 1 points 3 days ago (1 children)

Hey there, so i tried adding in the print out code, into the ai-character-chat session i had going as a test.. no luck so far, it flagged up a parse error related to this line : let images = [...content.matchAll(/(.+?)</image>/gm)] I had a quick look on StackOverflow, and saw one potential solution mentioned to add in a line which tells it what paser to use: E.G "parser": "@babel/eslint-parser" ~ that had no effect, and of course that will be entirely dependant on what is actually being used, or is available to use, which i do not currently know. Is your print code from an earlier time, where the parse error was not flagged up ? E.G Did they update the core code to depreciate older methods of coding?

As i say, please forgive any ignorance on my part, i was dropping the code into the base of area 1, a bit like adding a new function into a pre-exisiting file in php for example. (Please see attached image for reference of where i was adding code ~ should i have been using a different area?) Or am i misunderstanding the code you have written and should be making an offset generator (although i am unsure if i could import that into the ai-character-chat generator?)

Thank you for your help, it is very much appreciated, once i get my bearings i should be fine lol.. hopefully :D

[โ€“] VioneT 2 points 3 days ago (2 children)

Sorry, I assumed that you already know where to put the custom code is. Here is a visual walkthrough on how to add the custom code to your character.

[โ€“] therandomcoypu 1 points 2 days ago

That code works fine now.. thank you for your help with that. That said, i cant get a print preview and my printer wont respond if i select all and try to print the selection, but that is not the code, so much as my browser/printer setup i think.

[โ€“] therandomcoypu 1 points 2 days ago

Ahh sorry for the confusion, i thought it was like a drop in to the main core code, not at a specific character level. I will try again. Thank you for the link to the guide.

[โ€“] therandomcoypu 1 points 4 days ago

Very cool! Thank you, i will give this a go ๐Ÿ‘