SHARE
TWEET

#nofilter

a guest Apr 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* eslint-disable */
  2. // ==UserScript==
  3. // @name         New Userscript
  4. // @namespace    http://tampermonkey.net/
  5. // @version      0.1
  6. // @description  try to take over the world!
  7. // @author       You
  8. // @match        https://epicmafia.com/game/*
  9. // @exclude      https://epicmafia.com/game/new/*
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. //
  14. //
  15. //
  16.  
  17. // ==/UserScript==
  18.  
  19. (function() {
  20.     'use strict';
  21.  
  22.     var interval = setInterval(() => {
  23.         if(window.angular) {
  24.             if(!angular.element(document.getElementById('speak')).scope()) {
  25.                 angular.reloadWithDebugInfo()
  26.             }
  27.             clearInterval(interval);
  28.         }
  29.     }, 100);
  30.  
  31.     const speak = $('#speak');
  32.     const scope = angular.element('#speak').scope();
  33.     if(!scope) return;
  34.  
  35.     const send_msg = scope.send_msg;
  36.     const emotes = Object.keys(Object.assign({}, window.lobby_emotes, window._emotes));
  37.  
  38.     const new_send_msg = function(e) {
  39.         const words = $('#typebox').val().split(' ').map(word => {
  40.             if(word.match(/(.*)([a-zA-Z])(.*)*/g) && word[0] !== '@' && !emotes.includes(word)) {
  41.                 let first = true;
  42.                 for(let ii = 0; ii < word.length; ii++) {
  43.                     if(first && word[ii].match(/[a-zA-Z]/)) {
  44.                         first = false
  45.                         word = word.slice(0, ii+1) + '\u0000' + word.slice(ii+1)
  46.                     } else {
  47.                         first = true
  48.                     }
  49.                 }
  50.             }
  51.             return word;
  52.         });
  53.         $('#typebox').val(words.join(' '));
  54.         send_msg(e);
  55.     }
  56.  
  57.     scope.send_msg = new_send_msg;
  58.  
  59. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top