this post was submitted on 08 Dec 2025
3 points (100.0% liked)

Perchance - Create a Random Text Generator

1338 readers
4 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
 

We have a powerful scratchpad that can assign variable like

CHARA = prompt.....
CHARB = prompt.....

We can also import list type gen like the demo {import:noun} not in code but direct in prompt area.

But that's way too simple and scattered around all places. How do we custom a more complicated list gen like I can do in scratchpad and import it directly in prompt textarea? Even still use custom variable like [CHARA], [CHARB], DESCRIPTION = ? using selectone.? output? $output? ??? I have absolutely no idea.

After checking the tutorial and it's still too hard for me...

top 7 comments
sorted by: hot top controversial new old
[–] perchance@lemmy.world 2 points 1 week ago (1 children)

Can you share a minimal example of what you're trying to achieve?

How do we custom a more complicated list gen like I can do in scratchpad and import it directly in prompt textarea

To try to answer this question directly, if you have a generator like this called perchance.org/my-animal-list:

$output
  mouse
  chicken
  frog

then you should just be able to write:

ANIMAL = {import:my-animal-list}

in your generator that you want to 'use' that animal list in. And then just write [ANIMAL] wherever you want to use it.

You can get a lot more complex than that, but that's the general gist of it. Let me know if there's a specific part you're struggling with or if I misunderstood.

[–] ccufcc@lemmy.world 1 points 1 week ago* (last edited 1 week ago) (1 children)

For example currently we are able to do this in scratchpad:

RAT = an anthro [COLOR1] rat warrior
CAT = an anthro [COLOR2] feline mage
COLOR1 = {red|pink|yellow}
COLOR2 = {blue|cyan|cerulean}

I can use in prompt like [RAT] is eating [COLOR2] ice cream.

But if using ANIMAL = {import:my-animal-list} method, I will have to make 4 gens, and do RAT = {import:rat} ; COLOR1 = {import:color1} ; COLOR2 = {import:color2}.... which is way more inconvenient. I am looking for a way that make the scratchpad structure can be imported, shared, like a portable scratchpad. All variable/list in only one gen.

[–] perchance@lemmy.world 2 points 1 week ago* (last edited 1 week ago) (1 children)

So if you have perchance.org/my-lists like this:

$output
  animal
    mouse
    chicken
    frog
  color
    red
    green
    blue

then in the other generator you have:

lists = {import:my-lists}

then you can write [lists.animal] and [lists.color] to access them. If you want them to be available as [ANIMAL] and [COLOR]¹, then you could put this at the top of your HTML panel:

[ANIMAL=lists.animal, COLOR=lists.color, ""]

You need to make sure that line is above any code that tries to use [ANIMAL] and [COLOR], since the square blocks in the HTML editor are executed in top-to-bottom (and left-to-right for square blocks on the same line) order.

Let me know if I still misunderstand.


¹ Since IIRC, the t2i-framework-plugin-v2 requires use of all-caps variable names? That was mainly to avoid collision with built-in browser global variables (again, IIRC)

[–] ccufcc@lemmy.world 1 points 1 week ago* (last edited 1 week ago) (1 children)

Test result is not only unsuccessfully, actually:

  1. The noun gen can work ONLY in ai-furry-generator but cannot even be found in the main image gen.
  2. None of the 100% unedited copy fork gen can even work on ai-furry-generator. Which leads it to a deeper rabbit hole...

[–] perchance@lemmy.world 1 points 1 week ago* (last edited 1 week ago) (1 children)

Sorry I should have been more clear that the [ANIMAL=lists.animal, COLOR=lists.color, ""] should go in the HTML of the generator that you want to use the lists in, not in the furchancetxt generator. When you import a generator like furchancetxt, only the lists are imported - the HTML of furchancetxt will be completely ignored.

And regarding the "cannot find generator" but it somehow works for noun gemeratpr: I think that's because you're importing noun already (possibly indirectly - i.e. importing a generator that imports noun)? The {import:furchancetxt} would only work if you have already imported it somewhere else. So you should either pre-import the things you want to use "dynamically", or use dynamic imports if there are too many things to pre-import (that may not be used very often):

Also, I'm not sure if list = {import:furchancetxt} will work at all in scratchpad. IIRC it only parses all-caps variables, but maybe you have changed that part, idk.

I think the TL;DR here is that you'll want to just put list = {import:furchancetxt} in your ai-furry-generator on a new line in the perchance lists editor, and then put [ANIMAL=lists.animal, COLOR=lists.color, ""] at the top of the the HTML editor of ai-furry-generator. Then you can use [ANIMAL] and [COLOR] in the scratchpad.

[–] ccufcc@lemmy.world 1 points 1 week ago (1 children)

thank for the reply!!! However this is far from the goal that we can build list and sharing around like USB driver or SD card. If it involves with editing the code directly it's too hard for regular users.

[–] perchance@lemmy.world 2 points 1 week ago* (last edited 1 week ago)

Oh, maybe you mean that you want to allow users to write ANIMAL = {import:my-animal-list} directly in their scratchpad (without it being pre-imported by your generator's code)? If so you could maybe use regex to replace ANIMAL = {import:my-animal-list} with something like ANIMAL = [dynamicImport("my-animal-list")], assuming you have imported https://perchance.org/dynamic-import-plugin already. You may want to check that the parseVariables code in the t2i framework will be adjusted to support that, if it doesn't already. I think it should already support it, so only the regex transformation should be required (though I could be wrong).