Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Генератор хуйни (Форк от Быдло-куна!)
- // @namespace Генератор_хуйни
- // @version 1.3
- // @description Создай хуйню!
- // @author Анонимус (доработано Быдло-куном!)
- // @include *://2ch.*
- // @icon https://i.imgur.com/XK5x1Zr.png
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- for (const area of document.querySelectorAll('.postarea')) {
- const button = document.createElement('div');
- button.innerHTML = `<a style='user-select: none;'><strong>Насрать хуйни</strong></a>`;
- area.parentNode.insertBefore(button, area.nextSibling.nextSibling.nextSibling);
- button.onclick = () => {
- for (const field of document.querySelectorAll('#shampoo')) field.value += paragraph();
- };
- }
- })();
- function choice(chances) {
- const roll = Math.random();
- return chances.find(i => roll <= i[1])[0]
- }
- const punctuationChances = [
- ['. ', 0.5],
- ['! ', 0.70],
- ['? ', 0.80],
- ['... ', 0.95]
- ];
- var Lc = [/*вставь нужные слова*/]
- var hz = ['. ', '! ', '? ', '... ']
- function word() { return Lc[Math.round(Math.random() * Lc.length)] }
- function sentence() { return Array.apply(null, Array(5 + Math.round(Math.random() * 7))).map(word).join(' ') }
- function paragraph() {
- let replies = document.querySelectorAll('.js-post-reply-btn')
- console.log(replies)
- let output = ''
- for(let i = 0; i < 5 + Math.round(Math.random() * 10); i++){
- let s = sentence()
- output += s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()+choice(punctuationChances)
- if (Math.random() > 0.75){
- output += '\n'
- if (output.charAt(0) != '>'){
- output = '>' + output
- }
- }
- }
- if(Math.random() < 0.5){
- return output
- }
- return '>>'+replies[Math.round(Math.random() * replies.length)].text+'\n'+output
- }
Advertisement
Add Comment
Please, Sign In to add comment