Doing Perchance.org things…

Links

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

help-circle
  • On how you have your data, you can probably just add a url property for each instance of the source e.g.:

       {
          name: "original",
          label: "Original",
          placeholder: "Click the button below to generate an original quote.",
          data: [
            {
              quote: "Happiness beckons you once you forget you were looking for it.",
              source: "Eleanor Trent, 'Where's Joy?'",
              url: "link here"
            },
            {
              quote: "Memory is just the past asking for a permanent residence permit.",
              source: "Dr. Selim Farouk, 'The Mind's Archive'",
              url: "another link here"
            },
            {
              quote: "No one knows how Sentience is born, but we sure know how to kill it.",
              source: "Dr. Marcus Webb, 'The Philosophy of Consciousness'",
              url: "link here"
            },
            ...
    

    Then you can access it with .url (quoteEntry.url) and set it as the href of the quoteSourceEl.




  • There should be no problem with linking the defaultCommentOptions on JavaScript, it would be on this part of your code on the HTML:

        ...
        let othersChatDiv = document.createElement('div');
        othersChatDiv.id = 'others-chat-container';
        othersChatDiv.style.display = 'none'; // Hide others chat by default
        
        let mainChatOptions = defaultCommentOptions.createClone;
        mainChatOptions.channel = "qine-main-chat";
        mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
        mainChatOptions.onComment = function (comment) {
          // Handle new comments in Main Chat
          console.log("New comment in Main Chat:", comment);
        }
        let mainChatPlugin = commentsPlugin(mainChatOptions);
        ...
    

    The problem is bannedUsersList is not in the generator, so it gives errors. Removing that from the defaultCommentOptions makes it work.




  • Best way I would think is use the default comment options that you have on the Perchance lists:

    defaultCommentOptions // for comments plugin: https://perchance.org/comments-plugin
      width = 100%
      height = 350
      commentPlaceholderText = Leave friendly comments..
      submitButtonText = submit comment
      bannedUsers = [bannedUsersList]
      customEmojis = {import:huge-emoji-list}
      adminFlair = 👑 Creator
      adminPasswordHash = 4b7a8a671d949baf24756f731091d13018de5c2ab4dd2cc1c1612a6643986933
    

    As the base options like so:

    let mainChatOptions = defaultCommentOptions.createClone;
    mainChatOptions.channel = "qine-main-chat";
    mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
    mainChatOptions.onComment = function (comment) {
      // Handle new comments in Main Chat
      console.log("New comment in Main Chat:", comment);
    }
    let mainChatPlugin = commentsPlugin(mainChatOptions);
    




  • So, on your:

    <div class="flex">[output]</div>
    

    You need to enclose the [output] in a div for the Update Rows to work since it looks for the number of div on the .flex container like so:

    <div class="flex"><div>[output]</div></div>
    

    Also, you changed the start of the ‘for loop’ on the update rows with let i = numRows - 1 which would mean it can only update one row since the loop terminates if it exceeds the numRows. Just use the let i = 0.

    If you want to only update the ‘last’ row, you can do:

    function updateLast() {
      let lastRow = [...document.querySelector(".flex").querySelectorAll('div')].at(-1)
      lastRow.innerHTML = output
    }
    

  • So, on the .flex container, every time you add the output on the innerHTML, it would essentially re-run the ‘evaluation’ of the square brackets, which would also update the container - which updates the previous images. Best way is to not alter the InnerHTML by concatenating and use .appendChild instead. Ex:

      function addImageRow() {
        let con = document.createElement('div');
        con.innerHTML = output
        document.querySelector(".flex").appendChild(con);
      }
    

    But since this wouldn’t have any square brackets, you cannot use the regular update() function to reload them. Here’s a function to update them:

    function updateRows() {
        let numRows = document.querySelector(".flex").querySelectorAll('div').length
        document.querySelector(".flex").innerHTML = ''
        for (let i = 0; i < numRows; i++) {
          let con = document.createElement('div');
          con.innerHTML = output
          document.querySelector(".flex").appendChild(con);
        }
      }
    








  • I haven’t misunderstood your post, and I’m just giving my ideas on how to implement some of them by utilizing the custom code feature. Having those natively implemented would be the best, but in case it isn’t, there are still ways to ‘implement’ it ourselves. We can even create our own fork of the page and implement them natively although there might be a lot of finicking around the current code (some of examples of forks are: TPS Group Chat that allows other characters to auto reply and Petrafied ACC further fork of the TPS Group Chat and gives approximate number of tokens that your Role Instruction would add to the context length, for multiple characters).

    I can’t speak for the Dev (so I’ll ping them) on how hard these would be to implement natively, but I would think that this would be implemented on the ‘thread’ level of the chat (at least if I would create a custom code, it would be stored there). The statuses (away from/with character, avatar/portrait states) would be stored on the thread and there would be triggers (maybe through keywords) that would replace those statuses and also automatically set if the character would auto-reply to the messages or the narrator. There would still be a lot of ‘micro-managing’ with the increase of additional factors. You would have to ‘set up’ the unknown character(s), how you would meet the new character, how frequent would the character be sending the ‘how are you’ messages, how the story progresses outside of the user’s view, etc.

    Just to clarify, ‘model’ refers to the AI model that we use that generates the responses. ‘ACC’ or ‘AI Character Chat’ is the user interface or page that use the ‘model’. Using custom codes usually modifies the ‘ACC’ and not the ‘model’, so essentially, we’re ‘modding’ the user interface.

    A new ‘model’ would make the AI smarter, as long as the ‘context length’ would be increased (since the AI would have more context for its next response/replies) but the longer the chat goes, the more it also takes up the ‘context length’ and will degrade over time.