this post was submitted on 21 Aug 2024
3 points (100.0% liked)

Perchance - Create a Random Text Generator

448 readers
14 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 1 year ago
MODERATORS
 

I just discovered Perchance this morning while looking for some options to consolidate and "oracle-ize" some pen-an-paper game tables from Ganesha games. I'm a retired and somewhat lazy software developer who figured there should be a way to accomplish this without reinventing the wheel, and Perchance seems to fit the bill well. One initial question - the example generator html files seem to have a single call to "update" when the button is clicked. Can a generator respond to multiple button messages? For example if I wanted to include two unrelated tables in a single generator file ? I have about 15 tables for one game, and would like to be able to have buttons for each table, plus a read-only scrolling text area that contains the output from each click, like a journal.

top 3 comments
sorted by: hot top controversial new old
[–] perchance 3 points 2 months ago (1 children)

Yep, if you have <div id="abc">[animal]</div> and you have <button onclick="update(abc)">randomize</button> then it'll only update that particular HTML element with id="abc". Examples:

BTW, there are quite a few examples on perchance.org/examples and Google has indexed them - e.g. I found these quickly by searching "multiple buttons perchance example" and "perchance history example". It can sometimes be hard to phrase Google searches when you're new to a subject, so should feel very welcome to ask questions like this here - just a heads up in case it's helpful next time you run into an issue like this.

[–] cwiggins999 2 points 2 months ago

Excellent - thanks! Each environment seems to have nuances, but I should have tried this google approach - glad to see it is well indexed. The history examples are perfect.

I looked at the DYI API also - can it handle a parameter for choosing a particular output, as in the multiple-independent-outputs-example? Like the individual buttons do, using "update(out1)", "update(out2)", etc.? I'm thinking of invoking this in Tabletop Simulator's ingame tablet, and it has an earlier version of chromium that doesn't look like it supports the generator URLs directly, so might use an API versus trying to transpile.

[–] wthit56 3 points 2 months ago

You can also just not use the update at all. (People can still call it on the other side, but you don't need to use that as the mechanism by which you change stuff.) You can just use regular JS and set it up to work however you want it to work.