Doing Perchance.org things…

Links

  • 2 Posts
  • 52 Comments
Joined 2 years ago
cake
Cake day: June 21st, 2023

help-circle



  • Btw, it seems to load/hang a little bit each time the button to randomize is clicked, so I’ve made an adjustment with the code, so it loads and selects an item faster, so just change the following lines:

    getTxtList(url) =>
      if (!url.endsWith('.txt')) return;
      let fileName = url.split('/file/')[1].replace('.txt', '');
      if (!root[fileName]) {
        const request = new XMLHttpRequest();
        request.open("GET", url, false);
        request.send(null);
        let list = request.responseText
        list = list.split(/[\n\r]/).filter(a => a)
        // changes
        root[fileName] = {}
        let maxPerSubset = 5000
        for(i = 0; i < Math.ceil(list.length / maxPerSubset); i++) {
          root[fileName][i] = [... list.slice((0 + i) * maxPerSubset, (1 + i) * maxPerSubset)]
        }
      }
      return root[fileName][Object.keys(root[fileName]).selectOne] // change
    




  • By creating a backup, I mean something like the version control on perchance in which every save creates a version of the previous generator without the changes. If you are editing with the collab link, and you aren’t the owner/creator of the page, there is no ‘backup’ icon on the top right, meaning the changes aren’t saved in a version although the changes are saved on the generator, thus I think it requires the owner to manually save to create a backup version, unless I’m mistaken.

    As for the edit password, I’ve attached an image on my previous comment of the example prompt that shows up when I click the “Collab Link” on another generator that I don’t own. For example, on this one, I clicked the “Collab Link” on /beautiful-people and it shows this prompt:

    Also, when I previously created a collab link, it asked me for an edit password, but now I don’t see it, which is why I provided the Password: hello previously since I’ve set it to that, and checking with you if there should be an edit password if you don’t have the collab link.