Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-disable */
- // ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://epicmafia.com/game/*
- // @exclude https://epicmafia.com/game/new/*
- // @grant none
- // ==/UserScript==
- //
- //
- //
- // ==/UserScript==
- (function() {
- 'use strict';
- var interval = setInterval(() => {
- if(window.angular) {
- if(!angular.element(document.getElementById('speak')).scope()) {
- angular.reloadWithDebugInfo()
- }
- clearInterval(interval);
- }
- }, 100);
- const speak = $('#speak');
- const scope = angular.element('#speak').scope();
- if(!scope) return;
- const send_msg = scope.send_msg;
- const emotes = Object.keys(Object.assign({}, window.lobby_emotes, window._emotes));
- const new_send_msg = function(e) {
- const words = $('#typebox').val().split(' ').map(word => {
- if(word.match(/(.*)([a-zA-Z])(.*)*/g) && word[0] !== '@' && !emotes.includes(word)) {
- let first = true;
- for(let ii = 0; ii < word.length; ii++) {
- if(first && word[ii].match(/[a-zA-Z]/)) {
- first = false
- word = word.slice(0, ii+1) + '\u0000' + word.slice(ii+1)
- } else {
- first = true
- }
- }
- }
- return word;
- });
- $('#typebox').val(words.join(' '));
- send_msg(e);
- }
- scope.send_msg = new_send_msg;
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement