@VioneT@lemmy.world
@VioneT@lemmy.world avatar

VioneT

@VioneT@lemmy.world

Doing Perchance.org things…

Links

This profile is from a federated server and may be incomplete. Browse more on the original instance.

A quick example demonstrating how you can get rid of the error message (without using a "private" function in the engine) (perchance.org)

I’ve just found another pretty cool way to get rid of the error box in a generator without using the __clearPerchanceErrors() function that you can run on the testing panel to get a similar effect (as mentioned by @perchance that it’s probably a “private function” as well along with other alike properties in the...

VioneT,
@VioneT@lemmy.world avatar

If you want to run some code but ignore any Perchance errors that occur during it, then use this: window.ignorePerchanceErrors(() => { putYourCodeHere }). The return value of this function is the return value of the callback code that you provide. Useful when evaluating user-provided Perchance syntax which may have bugs. You can also run window.clearPerchanceErrors() to clear all existing error logs.

From the Advance Perchance Tutorial

VioneT,
@VioneT@lemmy.world avatar

On your output, you could check if the selected items includes the ‘None’, if it has, then you output ‘None’, otherwise, you output all the selections:


<span style="color:#323232;">output
</span><span style="color:#323232;">  Fruit</b>: [fruit = fruit.consumableList,("")][x = fruit.selectMany(1,3).map(a => a.evaluateItem), x.includes('None') ? 'None' : x.joinItems(", ")]
</span>

Since .selectMany() returns an Array of Objects, .map(a => a.evaluateItem) just makes sure that the array has ‘strings’ and not ‘objects’ (Perchance List). .includes() is a JavaScript Array Method to check if the Array includes the passed item. Also, the condition ? if true : if false syntax is a ternary operation, but you can use normal if else there like: [x = fruit.selectMany(1,3).map(a=>a.evaluateItem); if (x.includes(‘None’)) { ‘None’ } else { x.joinItems(“,”) }].
References:

VioneT,
@VioneT@lemmy.world avatar

Check out the changes I’ve made on this two generators:

The problem I think with it is you are calling the $output.getRandom() or $output.getItem(), but on your current $output on the main generator, there isn’t any function like that.

I would also recommend using this to refer to the current parent element.

VioneT,
@VioneT@lemmy.world avatar

Here is a video demo of it

If you just want to add images, that is the way. You don’t really alter the code, but you just sent the image as a message to the thread.

VioneT,
@VioneT@lemmy.world avatar

Just remember that if you have autoreply enabled. It would reply based on what it gathered from the text you have inputted and not the image that is displayed. From the video, I added an URL and it assumed that it was for a video game lmao.

VioneT,
@VioneT@lemmy.world avatar

Some update to this:

  • I’ve updated converter URL: to /seventh-sanctum-converter.
  • The // SEED based conversion seems to be working, though there are manual checks to make sure the generators are working properly.
  • The Data Archives might not be updated, though some of the gens in the Data Archives are no longer available in the site as well.
  • I’ve compiled my conversions at /7th-sanctum-conversions-vionet20.
VioneT,
@VioneT@lemmy.world avatar

I’ve taken a look at it and made this one for the //vocab generator files:
perchance.org/x93yy70u2i

There is still one I haven’t parsed in which it has a conditional (I think) where the vocab is Alchemical,1:magic,spiritualt in which there is a category above which might be used to toggle which are available to be generated.

The //seed or SEED generators seems to be following an ‘object’ property method, in which <*LIST> seems to initialize / select one from the list, then the proceeding are property access to it. For example:


<span style="color:#323232;">// actionfilmdat.txt
</span><span style="color:#323232;">...
</span><span style="color:#323232;">ROUTECAST
</span><span style="color:#323232;">  <*GETPERSON><GENPERSONREF> <GENPERSON> <ROUTESINGLEGOAL>
</span><span style="color:#323232;">...
</span><span style="color:#323232;">GETPERSON
</span><span style="color:#323232;">  <*>
</span><span style="color:#323232;">    GENPERSON,true
</span><span style="color:#323232;">      acrobat
</span><span style="color:#323232;">    GENPERSONPL,true
</span><span style="color:#323232;">      acrobats
</span><span style="color:#323232;">    GENPERSONREF,true
</span><span style="color:#323232;">      an
</span><span style="color:#323232;">  <*>
</span><span style="color:#323232;">    GENPERSON,true
</span><span style="color:#323232;">      actor
</span><span style="color:#323232;">    GENPERSONPL,true
</span><span style="color:#323232;">      actors
</span><span style="color:#323232;">    GENPERSONREF,true
</span><span style="color:#323232;">      an
</span><span style="color:#323232;">...
</span>

It can be converted to


<span style="color:#323232;">routecast
</span><span style="color:#323232;">  [x = getperson.selectOne, x.getpersonref] [x.getperson] [routesinglegoal]
</span><span style="color:#323232;">
</span><span style="color:#323232;">getperson
</span><span style="color:#323232;">  *
</span><span style="color:#323232;">    getperson = acrobat
</span><span style="color:#323232;">    getpersonnpl = acrobats
</span><span style="color:#323232;">    getpersonref = an
</span>

Other might just be references in which we can convert < to [.

Those with the conf on the file name e.g. advnameconfdat.txt seems to be imports(?) or for a dropdown(?) to select which generator is used.

`color:light-dark(blue,lightblue)` is now available in all modern browsers - switch text/background/etc. colors automatically depending on whether the user's device is in light mode or dark mode

It basically allows you to specify to different colors - one for if the user’s device is in light mode, and the other if they’re in dark mode. Here’s an example gen showing how to use it:...

AI bots in your comments, and more: `c = commentsPlugin(options), c.submit("hello world!")` (perchance.org)

(To be clear, since I realized just now that to non-devs the title might be misleading: This feature does not add AI bots to your comments plugin by default! The comments plugin and the AI plugins are completely distinct. But plugins can of course interact with one another, and this new feature of the comments plugin allows for...

VioneT, (edited )
@VioneT@lemmy.world avatar

Also there seems to be the ‘delete’ comment on replies (not sure if intended but clicking on it works to delete the reply and the mentioned comment):
https://lemmy.world/pictrs/image/0c8066d3-ff65-4525-8a5d-3db85da629cc.png

VioneT,
@VioneT@lemmy.world avatar

With the addition of the being able to send messages, would it be possible to also get the reply, block and delete events.

VioneT,
@VioneT@lemmy.world avatar
VioneT,
@VioneT@lemmy.world avatar

Actually, it’s a reference to the list. Not sure how you use the reference since it isn’t displayed on the provided code, so I’m not sure how it became a string.

Linking your generator will greatly help in finding the solution.

Super Fetch Plugin does not work with `user-uploads.perchance.org`

So, after a bit of testing with the example from the super-fetch-plugin, I’ve tried different kinds of websites and it worked, including a URL from comments-plugin.perchance.org, which I got from inspecting a comments plugin iframe from the DevTools. But in this case, not from user-uploads.perchance.org, it kept having the...

VioneT,
@VioneT@lemmy.world avatar

I’m also on Edge and no CORS issue … weeeeiirdd. I’ve also tried it in a profile without extensions (to see if any of my extensions messes with it) but it also goes through no problem. Same with Google Chrome, Firefox, Opera GX, and Opera Normal.

VioneT,
@VioneT@lemmy.world avatar

I was able to fetch it with the super fetch here: perchance.org/4cozwe59pi

I also didn’t have any CORS problems.

VioneT,
@VioneT@lemmy.world avatar

You can probably do something like this;


<span style="color:#323232;"><script>
</span><span style="color:#323232;">  let checkForCurrentErrors = setInterval(() => {
</span><span style="color:#323232;">   if(__currentPerchanceErrorCount > 0) {
</span><span style="color:#323232;">     clearInterval(checkForCurrentErrors)
</span><span style="color:#323232;">     errorPage.style.display = 'block';
</span><span style="color:#323232;">   }
</span><span style="color:#323232;">  }, 10)
</span><span style="color:#323232;"></script>
</span><span style="color:#323232;"><div id="errorPage" style="position: absolute; z-index: 999; display: none; width: 100dvw; height: 100dvh; background: blue;">
</span><span style="color:#323232;">  Testing Error Page <br>
</span><span style="color:#323232;">  Please Reload the Page
</span><span style="color:#323232;"></div>
</span>

It is an interval that checks if there was a perchance error happened. You could also probably have a timeout in which if the page doesn’t load for more than 30 seconds, then it would show the error page.

However, these solutions only happen when the page has already been working, meaning, if they just opened up the page, it would still take the Perchance server to send the data first before it loads (where the loading issues might happen), in which case, it needs a server-side code to fire to report that the generator isn’t loading.

Depending on the error you want to handle, there might be solutions that we can code and not need the server to provide it for us.

VioneT,
@VioneT@lemmy.world avatar

There are some characters made by users at the Community Made Guide for the AI Character Chat. I would recommend checking out the GPT Roleplay Realm characters.

VioneT,
@VioneT@lemmy.world avatar

@perchance pinging dev

VioneT, (edited )
@VioneT@lemmy.world avatar

I think that is a nice idea. I think, if the generator is not updated recently, maybe create an alert() to alert the generator owner that it might give bugs if they update their generator,? also to let them know that a change has been made and it ‘might’ break their generator if they update.

EDIT: I think that it wouldn’t break much since with the current create-instance-plugin they wouldn’t actually be able to use lists in deeper instances since it would automatically return undefined, which would mean the users that tried to do what I did, didn’t do it since it throws undefined in their code. So, I would hope that it wouldn’t break generators much.

VioneT, (edited )
@VioneT@lemmy.world avatar

Okay, might be too crazy now but, if the list has a list propValue.getLength > 0, we can do a .selectOne to it, then re-apply the previous properties to it. Meaning, it would have one ‘list’ value, but it would still have the previous properties.

You can check the code here: perchance.org/hxoknecflu

But if that might break more generators, then probably a new instance plugin might be good XDDDDD.

Edit: it might still be breaking generators, since if the item that was .selectOneed is a list, then it would still randomize and not be fixed: See the [p.child.testing] in this generator: perchance.org/vnm320e3k6#edit

VioneT,
@VioneT@lemmy.world avatar

Thanks for the fix!

VioneT, (edited )
@VioneT@lemmy.world avatar

Edit: It has updated, but not sure if will happen again.
Pinging again @perchance, it seems to still be broken ( I think), you can check the ‘Hub’ events tab on the /hub, and the actual hub events at /hub-events and the changes seems to not be updating again.

VioneT,
@VioneT@lemmy.world avatar

@perchance pinging dev!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines