Character.ai Enhancements

Enhance Character.ai with additional features.

  1. // ==UserScript==
  2. // @name Character.ai Enhancements
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Enhance Character.ai with additional features.
  6. // @author Your Name
  7. // @match https://character.ai/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Check if we're on character.ai
  15. if (window.location.hostname === 'character.ai') {
  16. // Create a draggable button
  17. let button = document.createElement('div');
  18. button.innerHTML = 'Enhancements';
  19. button.style.position = 'fixed';
  20. button.style.top = '10px';
  21. button.style.left = '10px';
  22. button.style.backgroundColor = 'red';
  23. button.style.color = 'white';
  24. button.style.padding = '10px';
  25. button.style.borderRadius = '5px';
  26. button.style.cursor = 'move';
  27. button.style.zIndex = '1000';
  28. document.body.appendChild(button);
  29.  
  30. // Make the button draggable
  31. button.onmousedown = function(event) {
  32. event.preventDefault();
  33. document.onmousemove = function(e) {
  34. button.style.top = (e.clientY - button.offsetHeight / 2) + 'px';
  35. button.style.left = (e.clientX - button.offsetWidth / 2) + 'px';
  36. };
  37. document.onmouseup = function() {
  38. document.onmousemove = null;
  39. document.onmouseup = null;
  40. };
  41. };
  42.  
  43. // Function to get user token (stub - implementation needed)
  44. function getUserToken() {
  45. // Implementation to get user token
  46. return 'user-token';
  47. }
  48.  
  49. // Add event listener to the button to show a menu
  50. button.addEventListener('click', function() {
  51. alert('User token: ' + getUserToken());
  52. // Show memory editor, save chat, download chat options, etc.
  53. // Add your additional functionalities here
  54. });
  55.  
  56. // Additional features (memory editor, save chat, download chat, etc.)
  57. function createFeatureButtons() {
  58. // Create and append buttons for various features
  59. // Example: Save Chat
  60. let saveChatButton = document.createElement('button');
  61. saveChatButton.innerHTML = 'Save Chat';
  62. saveChatButton.onclick = function() {
  63. // Implementation to save chat
  64. alert('Chat saved!');
  65. };
  66. document.body.appendChild(saveChatButton);
  67.  
  68. // Add more feature buttons as needed
  69. }
  70.  
  71. createFeatureButtons();
  72. }
  73. })();