Guest User

калогенератор

a guest
Feb 4th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Генератор хуйни (Форк от Быдло-куна!)
  3. // @namespace Генератор_хуйни
  4. // @version 1.3
  5. // @description Создай хуйню!
  6. // @author Анонимус (доработано Быдло-куном!)
  7. // @include *://2ch.*
  8. // @icon https://i.imgur.com/XK5x1Zr.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. for (const area of document.querySelectorAll('.postarea')) {
  16. const button = document.createElement('div');
  17. button.innerHTML = `<a style='user-select: none;'><strong>Насрать хуйни</strong></a>`;
  18. area.parentNode.insertBefore(button, area.nextSibling.nextSibling.nextSibling);
  19. button.onclick = () => {
  20. for (const field of document.querySelectorAll('#shampoo')) field.value += paragraph();
  21. };
  22. }
  23. })();
  24. function choice(chances) {
  25. const roll = Math.random();
  26. return chances.find(i => roll <= i[1])[0]
  27. }
  28. const punctuationChances = [
  29. ['. ', 0.5],
  30. ['! ', 0.70],
  31. ['? ', 0.80],
  32. ['... ', 0.95]
  33. ];
  34. var Lc = [/*вставь нужные слова*/]
  35. var hz = ['. ', '! ', '? ', '... ']
  36. function word() { return Lc[Math.round(Math.random() * Lc.length)] }
  37. function sentence() { return Array.apply(null, Array(5 + Math.round(Math.random() * 7))).map(word).join(' ') }
  38. function paragraph() {
  39. let replies = document.querySelectorAll('.js-post-reply-btn')
  40. console.log(replies)
  41. let output = ''
  42. for(let i = 0; i < 5 + Math.round(Math.random() * 10); i++){
  43. let s = sentence()
  44. output += s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()+choice(punctuationChances)
  45. if (Math.random() > 0.75){
  46. output += '\n'
  47. if (output.charAt(0) != '>'){
  48. output = '>' + output
  49. }
  50. }
  51. }
  52. if(Math.random() < 0.5){
  53. return output
  54. }
  55. return '>>'+replies[Math.round(Math.random() * replies.length)].text+'\n'+output
  56. }
Advertisement
Add Comment
Please, Sign In to add comment