229 skills found · Page 7 of 8
yoneyy / StrdmGenerate random string for NodeJs or Web
drewbrokke / Chance Token ReplacerA simple utility to replace tokens in a string with generations from the chance random generator helper
rishabhyadavv / React Native EncryptionThis is a Encryption library written in native i.e swift & kotlin for React Native, including usage examples for AES, RSA, Hashing, HMAC, Random String, and Base64 utilities.
Kourva / UagentUagent allows you to retrieve a random user-agent string each time it is executed. It can be used for various web scraping and testing purposes.
Leandropesao / Descrasa// Generated by CoffeeScript 1.6.2 (function() { var Command, RoomHelper, User, addCommand, afkCheck, afksCommand, allAfksCommand, announceCurate, antispam, apiHooks, avgVoteRatioCommand, chatCommandDispatcher, chatUniversals, cmds, data, dieCommand, disconnectLookupCommand, fans, handleNewSong, handleUserJoin, handleUserLeave, handleVote, hook, initEnvironment, initHooks, initialize, lockCommand, lockskipCommand, msToStr, newSongsCommand, newsCommand, populateUserData, channelCommand, pupOnline, reloadCommand, removeCommand, roomHelpCommand, rulesCommand, settings, skipCommand, staffCommand, statusCommand, themeCommand, undoHooks, unhook, unlockCommand, updateVotes, versionCommand, voteRatioCommand, ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref2, _ref20, _ref21, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (_hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; settings = (function() { function settings() { this.implode = __bind(this.implode, this); this.intervalMessages = __bind(this.intervalMessages, this); this.startAfkInterval = __bind(this.startAfkInterval, this); this.setInternalWaitlist = __bind(this.setInternalWaitlist, this); this.userJoin = __bind(this.userJoin, this); this.getRoomUrlPath = __bind(this.getRoomUrlPath, this); this.startup = __bind(this.startup, this); } settings.prototype.currentsong = {}; settings.prototype.users = {}; settings.prototype.djs = []; settings.prototype.mods = []; settings.prototype.host = []; settings.prototype.hasWarned = false; settings.prototype.currentwoots = 0; settings.prototype.currentmehs = 0; settings.prototype.currentcurates = 0; settings.prototype.roomUrlPath = null; settings.prototype.internalWaitlist = []; settings.prototype.userDisconnectLog = []; settings.prototype.voteLog = {}; settings.prototype.seshOn = false; settings.prototype.forceSkip = false; settings.prototype.seshMembers = []; settings.prototype.launchTime = null; settings.prototype.totalVotingData = { woots: 0, mehs: 0, curates: 0 }; settings.prototype.pupScriptUrl = 'https://dl.dropbox.com/u/21023321/TastycatBot.js'; settings.prototype.afkTime = 666 * 60 * 1000; settings.prototype.songIntervalMessages = [ { interval: 7, offset: 0, msg: "Entrem na nossa pagina: http://www.facebook.com/EspecialistasDasZoeiras?ref=hl" }, { interval: 5, offset: 0, msg: "Mantenha-se ativo no bate-papo e Votando. Ser não sera Retirado da Lista de DJ e da Cabine!" } ]; settings.prototype.songCount = 0; settings.prototype.startup = function() { this.launchTime = new Date(); return this.roomUrlPath = this.getRoomUrlPath(); }; settings.prototype.getRoomUrlPath = function() { return window.location.pathname.replace(/\//g, ''); }; settings.prototype.newSong = function() { this.totalVotingData.woots += this.currentwoots; this.totalVotingData.mehs += this.currentmehs; this.totalVotingData.curates += this.currentcurates; this.setInternalWaitlist(); this.currentsong = API.getMedia(); if (this.currentsong !== null) { return this.currentsong; } else { return false; } }; settings.prototype.userJoin = function(u) { var userIds, _ref; userIds = Object.keys(this.users); if (_ref = u.id, __indexOf.call(userIds, _ref) >= 0) { return this.users[u.id].inRoom(true); } else { this.users[u.id] = new User(u); return this.voteLog[u.id] = {}; } }; settings.prototype.setInternalWaitlist = function() { var boothWaitlist, fullWaitList, lineWaitList; boothWaitlist = API.getDJs().slice(1); lineWaitList = API.getWaitList(); fullWaitList = boothWaitlist.concat(lineWaitList); return this.internalWaitlist = fullWaitList; }; settings.prototype.activity = function(obj) { if (obj.type === 'message') { return this.users[obj.fromID].updateActivity(); } }; settings.prototype.startAfkInterval = function() { return this.afkInterval = setInterval(afkCheck, 2000); }; settings.prototype.intervalMessages = function() { var msg, _i, _len, _ref, _results; this.songCount++; _ref = this.songIntervalMessages; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { msg = _ref[_i]; if (((this.songCount + msg['offset']) % msg['interval']) === 0) { _results.push(API.sendChat(msg['msg'])); } else { _results.push(void 0); } } return _results; }; settings.prototype.implode = function() { var item, val; for (item in this) { val = this[item]; if (typeof this[item] === 'object') { delete this[item]; } } return clearInterval(this.afkInterval); }; settings.prototype.lockBooth = function(callback) { if (callback == null) { callback = null; } return $.ajax({ url: "http://plug.dj/_/gateway/room.update_options", type: 'POST', data: JSON.stringify({ service: "room.update_options", body: [ this.roomUrlPath, { "boothLocked": true, "waitListEnabled": true, "maxPlays": 1, "maxDJs": 5 } ] }), async: this.async, dataType: 'json', contentType: 'application/json' }).done(function() { if (callback != null) { return callback(); } }); }; settings.prototype.unlockBooth = function(callback) { if (callback == null) { callback = null; } return $.ajax({ url: "http://plug.dj/_/gateway/room.update_options", type: 'POST', data: JSON.stringify({ service: "room.update_options", body: [ this.roomUrlPath, { "boothLocked": false, "waitListEnabled": true, "maxPlays": 1, "maxDJs": 5 } ] }), async: this.async, dataType: 'json', contentType: 'application/json' }).done(function() { if (callback != null) { return callback(); } }); }; return settings; })(); data = new settings(); User = (function() { User.prototype.afkWarningCount = 0; User.prototype.lastWarning = null; User.prototype["protected"] = false; User.prototype.isInRoom = true; function User(user) { this.user = user; this.updateVote = __bind(this.updateVote, this); this.inRoom = __bind(this.inRoom, this); this.notDj = __bind(this.notDj, this); this.warn = __bind(this.warn, this); this.getIsDj = __bind(this.getIsDj, this); this.getWarningCount = __bind(this.getWarningCount, this); this.getUser = __bind(this.getUser, this); this.getLastWarning = __bind(this.getLastWarning, this); this.getLastActivity = __bind(this.getLastActivity, this); this.getLastDrinkTime = __bind(this.getLastDrinkTime, this); this.updateDrinkTime = __bind(this.updateDrinkTime, this); this.updateActivity = __bind(this.updateActivity, this); this.init = __bind(this.init, this); this.init(); } User.prototype.init = function() { this.lastActivity = new Date(); return this.drinkTime = new Date(); }; User.prototype.updateActivity = function() { this.lastActivity = new Date(); this.afkWarningCount = 0; return this.lastWarning = null; }; User.prototype.updateDrinkTime = function() { return this.drinkTime = new Date(); }; User.prototype.getLastDrinkTime = function() { return this.drinkTime; }; User.prototype.getLastActivity = function() { return this.lastActivity; }; User.prototype.getLastWarning = function() { if (this.lastWarning === null) { return false; } else { return this.lastWarning; } }; User.prototype.getUser = function() { return this.user; }; User.prototype.getWarningCount = function() { return this.afkWarningCount; }; User.prototype.getIsDj = function() { var DJs, dj, _i, _len; DJs = API.getDJs(); for (_i = 0, _len = DJs.length; _i < _len; _i++) { dj = DJs[_i]; if (this.user.id === dj.id) { return true; } } return false; }; User.prototype.warn = function() { this.afkWarningCount++; return this.lastWarning = new Date(); }; User.prototype.notDj = function() { this.afkWarningCount = 0; return this.lastWarning = null; }; User.prototype.inRoom = function(online) { return this.isInRoom = online; }; User.prototype.updateVote = function(v) { if (this.isInRoom) { return data.voteLog[this.user.id][data.currentsong.id] = v; } }; return User; })(); RoomHelper = (function() { function RoomHelper() {} RoomHelper.prototype.lookupUser = function(username) { var id, u, _ref; _ref = data.users; for (id in _ref) { u = _ref[id]; if (u.getUser().username === username) { return u.getUser(); } } return false; }; RoomHelper.prototype.userVoteRatio = function(user) { var songId, songVotes, vote, votes; songVotes = data.voteLog[user.id]; votes = { 'woot': 0, 'meh': 0 }; for (songId in songVotes) { vote = songVotes[songId]; if (vote === 1) { votes['woot']++; } else if (vote === -1) { votes['meh']++; } } votes['positiveRatio'] = (votes['woot'] / (votes['woot'] + votes['meh'])).toFixed(2); return votes; }; return RoomHelper; })(); pupOnline = function() { var currentversion, me, myname; me = API.getSelf(); myname = me.username; currentversion = "1.0.0"; log("BOT editado pelo Rafal Moraes versão " + currentversion + " Chupa Jô"); return API.sendChat("/me on"); }; populateUserData = function() { var u, users, _i, _len; users = API.getUsers(); for (_i = 0, _len = users.length; _i < _len; _i++) { u = users[_i]; data.users[u.id] = new User(u); data.voteLog[u.id] = {}; } }; initEnvironment = function() { document.getElementById("button-vote-positive").click(); document.getElementById("button-sound").click(); Playback.streamDisabled = true; return Playback.stop(); }; initialize = function() { pupOnline(); populateUserData(); initEnvironment(); initHooks(); data.startup(); data.newSong(); return data.startAfkInterval(); }; afkCheck = function() { var DJs, id, lastActivity, lastWarned, now, secsLastActive, timeSinceLastActivity, timeSinceLastWarning, twoMinutes, user, _ref, _results; _ref = data.users; _results = []; for (id in _ref) { user = _ref[id]; now = new Date(); lastActivity = user.getLastActivity(); timeSinceLastActivity = now.getTime() - lastActivity.getTime(); if (timeSinceLastActivity > data.afkTime) { if (user.getIsDj()) { secsLastActive = timeSinceLastActivity / 1000; if (user.getWarningCount() === 0) { user.warn(); _results.push(API.sendChat("@" + user.getUser().username + ", Você não falou no chat nos ultimos 30 minutos, por favor fale alguma coisa em 4 minutos ou será kickado da line de dj.")); } else if (user.getWarningCount() === 1) { lastWarned = user.getLastWarning(); timeSinceLastWarning = now.getTime() - lastWarned.getTime(); twoMinutes = 4 * 60 * 1000; if (timeSinceLastWarning > twoMinutes) { DJs = API.getDJs(); if (DJs.length > 0 && DJs[0].id !== user.getUser().id) { API.sendChat("@" + user.getUser().username + ", você foi avisado, fique ativo enquanto está na line."); API.moderateRemoveDJ(id); _results.push(user.warn()); } else { _results.push(void 0); } } else { _results.push(void 0); } } else { _results.push(void 0); } } else { _results.push(user.notDj()); } } else { _results.push(void 0); } } return _results; }; msToStr = function(msTime) { var ms, msg, timeAway; msg = ''; timeAway = { 'days': 0, 'hours': 0, 'minutes': 0, 'seconds': 0 }; ms = { 'day': 24 * 60 * 60 * 1000, 'hour': 60 * 60 * 1000, 'minute': 60 * 1000, 'second': 1000 }; if (msTime > ms['day']) { timeAway['days'] = Math.floor(msTime / ms['day']); msTime = msTime % ms['day']; } if (msTime > ms['hour']) { timeAway['hours'] = Math.floor(msTime / ms['hour']); msTime = msTime % ms['hour']; } if (msTime > ms['minute']) { timeAway['minutes'] = Math.floor(msTime / ms['minute']); msTime = msTime % ms['minute']; } if (msTime > ms['second']) { timeAway['seconds'] = Math.floor(msTime / ms['second']); } if (timeAway['days'] !== 0) { msg += timeAway['days'].toString() + 'd'; } if (timeAway['hours'] !== 0) { msg += timeAway['hours'].toString() + 'h'; } if (timeAway['minutes'] !== 0) { msg += timeAway['minutes'].toString() + 'm'; } if (timeAway['seconds'] !== 0) { msg += timeAway['seconds'].toString() + 's'; } if (msg !== '') { return msg; } else { return false; } }; Command = (function() { function Command(msgData) { this.msgData = msgData; this.init(); } Command.prototype.init = function() { this.parseType = null; this.command = null; return this.rankPrivelege = null; }; Command.prototype.functionality = function(data) {}; Command.prototype.hasPrivelege = function() { var user; user = data.users[this.msgData.fromID].getUser(); switch (this.rankPrivelege) { case 'host': return user.permission >= 5; case 'cohost': return user.permission >= 4; case 'mod': return user.permission >= 3; case 'manager': return user.permission >= 3; case 'bouncer': return user.permission >= 2; case 'featured': return user.permission >= 1; default: return true; } }; Command.prototype.commandMatch = function() { var command, msg, _i, _len, _ref; msg = this.msgData.message; if (typeof this.command === 'string') { if (this.parseType === 'exact') { if (msg === this.command) { return true; } else { return false; } } else if (this.parseType === 'startsWith') { if (msg.substr(0, this.command.length) === this.command) { return true; } else { return false; } } else if (this.parseType === 'contains') { if (msg.indexOf(this.command) !== -1) { return true; } else { return false; } } } else if (typeof this.command === 'object') { _ref = this.command; for (_i = 0, _len = _ref.length; _i < _len; _i++) { command = _ref[_i]; if (this.parseType === 'exact') { if (msg === command) { return true; } } else if (this.parseType === 'startsWith') { if (msg.substr(0, command.length) === command) { return true; } } else if (this.parseType === 'contains') { if (msg.indexOf(command) !== -1) { return true; } } } return false; } }; Command.prototype.evalMsg = function() { if (this.commandMatch() && this.hasPrivelege()) { this.functionality(); return true; } else { return false; } }; return Command; })(); newsCommand = (function(_super) { __extends(newsCommand, _super); function newsCommand() { _ref = newsCommand.__super__.constructor.apply(this, arguments); return _ref; } newsCommand.prototype.init = function() { this.command = '!cotas'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; newsCommand.prototype.functionality = function() { var msg; msg = "/me Acaba de Ativar modo Cota e roubou sua vaga na Faculdade e sua vez na Cabine de DJ!"; return API.sendChat(msg); }; return newsCommand; })(Command); newSongsCommand = (function(_super) { __extends(newSongsCommand, _super); function newSongsCommand() { _ref1 = newSongsCommand.__super__.constructor.apply(this, arguments); return _ref1; } newSongsCommand.prototype.init = function() { this.command = '!musicanovas'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; newSongsCommand.prototype.functionality = function() { var arts, cMedia, chans, chooseRandom, mChans, msg, selections, u, _ref2; mChans = this.memberChannels.slice(0); chans = this.channels.slice(0); arts = this.artists.slice(0); chooseRandom = function(list) { var l, r; l = list.length; r = Math.floor(Math.random() * l); return list.splice(r, 1); }; selections = { channels: [], artist: '' }; u = data.users[this.msgData.fromID].getUser().username; if (u.indexOf("MistaDubstep") !== -1) { selections['channels'].push('MistaDubstep'); } else if (u.indexOf("Underground Promotions") !== -1) { selections['channels'].push('UndergroundDubstep'); } else { selections['channels'].push(chooseRandom(mChans)); } selections['channels'].push(chooseRandom(chans)); selections['channels'].push(chooseRandom(chans)); cMedia = API.getMedia(); if (_ref2 = cMedia.author, __indexOf.call(arts, _ref2) >= 0) { selections['artist'] = cMedia.author; } else { selections['artist'] = chooseRandom(arts); } msg = "Querem musica de Dubstep do " + selections['artist'] + " entre! Tem musicas nova sempre em http://youtube.com/" + selections['channels'][0] + " http://youtube.com/" + selections['channels'][1] + " ou http://youtube.com/" + selections['channels'][2]; return API.sendChat(msg); }; newSongsCommand.prototype.memberChannels = ["MistaDubstep", "DubStationPromotions", "UndergroundDubstep", "JesusDied4Dubstep", "DarkstepWarrior", "BombshockDubstep", "Sharestep"]; newSongsCommand.prototype.channels = ["BassRape", "MonstercatMedia", "UKFdubstep", "DropThatBassline", "VitalDubstep", "AirwaveDubstepTV", "InspectorDubplate", "TehDubstepChannel", "UNITEDubstep", "LuminantNetwork", "TheSoundIsle", "PandoraMuslc", "MrSuicideSheep", "HearTheSensation", "bassoutletpromos", "MistaDubstep", "DubStationPromotions", "UndergroundDubstep", "JesusDied4Dubstep", "DarkstepWarrior", "BombshockDubstep", "Sharestep"]; newSongsCommand.prototype.artists = ["Doctor P", "Excision", "Flux Pavilion", "Knife Party", "Rusko", "Bassnectar", "Nero", "Deadmau5", "Borgore", "Zomboy"]; return newSongsCommand; })(Command); themeCommand = (function(_super) { __extends(themeCommand, _super); function themeCommand() { _ref2 = themeCommand.__super__.constructor.apply(this, arguments); return _ref2; } themeCommand.prototype.init = function() { this.command = '!tema'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; themeCommand.prototype.functionality = function() { var msg; msg = "Temas permitidos aqui na sala. electro, techno, "; msg += "dubstep."; return API.sendChat(msg); }; return themeCommand; })(Command); rulesCommand = (function(_super) { __extends(rulesCommand, _super); function rulesCommand() { _ref3 = rulesCommand.__super__.constructor.apply(this, arguments); return _ref3; } rulesCommand.prototype.init = function() { this.command = '!regras'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; rulesCommand.prototype.functionality = function() { var msg1, msg2; msg1 = " 1) Video no Maximo 6 minutos. "; msg1 += " 2) Sem Flood! "; msg1 += " 3) Nao escrever em colorido "; msg1 += " 4) Respeitar os Adms e Mods;s "; msg1 += " 5) Nao Fiquem Pedindo Cargos "; msg2 = "Curta: http://www.facebook.com/EspecialistasDasZoeiras?ref=hl"; msg2 += ""; API.sendChat(msg1); return setTimeout((function() { return API.sendChat(msg2); }), 750); }; return rulesCommand; })(Command); roomHelpCommand = (function(_super) { __extends(roomHelpCommand, _super); function roomHelpCommand() { _ref4 = roomHelpCommand.__super__.constructor.apply(this, arguments); return _ref4; } roomHelpCommand.prototype.init = function() { this.command = '!ajuda'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; roomHelpCommand.prototype.functionality = function() { var msg1, msg2; msg1 = "Bem vindo a Sala! Para ser o DJ, Criar uma lista de reprodução e coloque Musica do Youtube ou soundcloud. "; msg1 += "Se é novo procure pelo seu nome na sua tela (do lado da cabine de dj e clique) e depois mude o nome."; msg2 = "Para Ganhar Pontos é só clica em Bacana. "; msg2 += "Digite !regras pare ler as porra das regras."; API.sendChat(msg1); return setTimeout((function() { return API.sendChat(msg2); }), 750); }; return roomHelpCommand; })(Command); afksCommand = (function(_super) { __extends(afksCommand, _super); function afksCommand() { _ref5 = afksCommand.__super__.constructor.apply(this, arguments); return _ref5; } afksCommand.prototype.init = function() { this.command = '!afks'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; afksCommand.prototype.functionality = function() { var dj, djAfk, djs, msg, now, _i, _len; msg = ''; djs = API.getDJs(); for (_i = 0, _len = djs.length; _i < _len; _i++) { dj = djs[_i]; now = new Date(); djAfk = now.getTime() - data.users[dj.id].getLastActivity().getTime(); if (djAfk > (5 * 60 * 1000)) { if (msToStr(djAfk) !== false) { msg += dj.username + ' - ' + msToStr(djAfk); msg += '. '; } } } if (msg === '') { return API.sendChat("Se fudeu não tem ninguém AFK."); } else { return API.sendChat('AFKs: ' + msg); } }; return afksCommand; })(Command); allAfksCommand = (function(_super) { __extends(allAfksCommand, _super); function allAfksCommand() { _ref6 = allAfksCommand.__super__.constructor.apply(this, arguments); return _ref6; } allAfksCommand.prototype.init = function() { this.command = '!todosafks'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; allAfksCommand.prototype.functionality = function() { var msg, now, u, uAfk, usrs, _i, _len; msg = ''; usrs = API.getUsers(); for (_i = 0, _len = usrs.length; _i < _len; _i++) { u = usrs[_i]; now = new Date(); uAfk = now.getTime() - data.users[u.id].getLastActivity().getTime(); if (uAfk > (10 * 60 * 1000)) { if (msToStr(uAfk) !== false) { msg += u.username + ' - ' + msToStr(uAfk); msg += '. '; } } } if (msg === '') { return API.sendChat("Se fudeu não tem ninguém AFK."); } else { return API.sendChat('AFKs: ' + msg); } }; return allAfksCommand; })(Command); statusCommand = (function(_super) { __extends(statusCommand, _super); function statusCommand() { _ref7 = statusCommand.__super__.constructor.apply(this, arguments); return _ref7; } statusCommand.prototype.init = function() { this.command = '!status'; this.parseType = 'exact'; return this.rankPrivelege = 'featured'; }; statusCommand.prototype.functionality = function() { var day, hour, launch, lt, meridian, min, month, msg, t, totals; lt = data.launchTime; month = lt.getMonth() + 1; day = lt.getDate(); hour = lt.getHours(); meridian = hour % 12 === hour ? 'AM' : 'PM'; min = lt.getMinutes(); min = min < 10 ? '0' + min : min; t = data.totalVotingData; t['songs'] = data.songCount; launch = 'Iniciada em ' + month + '/' + day + ' ' + hour + ':' + min + ' ' + meridian + '. '; totals = '' + t.songs + ' Teve: :+1: ' + t.woots + ',:-1: ' + t.mehs + ',:heart: ' + t.curates + '.' msg = launch + totals; return API.sendChat(msg); }; return statusCommand; })(Command); dieCommand = (function(_super) { __extends(dieCommand, _super); function dieCommand() { _ref8 = dieCommand.__super__.constructor.apply(this, arguments); return _ref8; } dieCommand.prototype.init = function() { this.command = '!adeus'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; dieCommand.prototype.functionality = function() { API.sendChat("Acho que fui envenenado!"); undoHooks(); API.sendChat("Vish,"); data.implode(); return API.sendChat("Morri! x_x"); }; return dieCommand; })(Command); reloadCommand = (function(_super) { __extends(reloadCommand, _super); function reloadCommand() { _ref9 = reloadCommand.__super__.constructor.apply(this, arguments); return _ref9; } reloadCommand.prototype.init = function() { this.command = '!reload'; this.parseType = 'exact'; return this.rankPrivelege = 'Host'; }; reloadCommand.prototype.functionality = function() { var pupSrc; API.sendChat('/me Não se Preocupe o Papai Chegou'); undoHooks(); pupSrc = data.pupScriptUrl; data.implode(); return $.getScript(pupSrc); }; return reloadCommand; })(Command); lockCommand = (function(_super) { __extends(lockCommand, _super); function lockCommand() { _ref10 = lockCommand.__super__.constructor.apply(this, arguments); return _ref10; } lockCommand.prototype.init = function() { this.command = '!trava'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; lockCommand.prototype.functionality = function() { return data.lockBooth(); }; return lockCommand; })(Command); unlockCommand = (function(_super) { __extends(unlockCommand, _super); function unlockCommand() { _ref11 = unlockCommand.__super__.constructor.apply(this, arguments); return _ref11; } unlockCommand.prototype.init = function() { this.command = '!destrava'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; unlockCommand.prototype.functionality = function() { return data.unlockBooth(); }; return unlockCommand; })(Command); removeCommand = (function(_super) { __extends(removeCommand, _super); function removeCommand() { _ref12 = removeCommand.__super__.constructor.apply(this, arguments); return _ref12; } removeCommand.prototype.init = function() { this.command = '!remove'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; removeCommand.prototype.functionality = function() { var djs, popDj; djs = API.getDJs(); popDj = djs[djs.length - 1]; return API.moderateRemoveDJ(popDj.id); }; return removeCommand; })(Command); addCommand = (function(_super) { __extends(addCommand, _super); function addCommand() { _ref13 = addCommand.__super__.constructor.apply(this, arguments); return _ref13; } addCommand.prototype.init = function() { this.command = '!add'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; addCommand.prototype.functionality = function() { var msg, name, r, user; msg = this.msgData.message; if (msg.length > this.command.length + 2) { name = msg.substr(this.command.length + 2); r = new RoomHelper(); user = r.lookupUser(name); if (user !== false) { API.moderateAddDJ(user.id); return setTimeout((function() { return data.unlockBooth(); }), 5000); } } }; return addCommand; })(Command); skipCommand = (function(_super) { __extends(skipCommand, _super); function skipCommand() { _ref14 = skipCommand.__super__.constructor.apply(this, arguments); return _ref14; } skipCommand.prototype.init = function() { this.command = '!pula'; this.parseType = 'exact'; this.rankPrivelege = 'bouncer'; return window.lastSkipTime; }; skipCommand.prototype.functionality = function() { var currentTime, millisecondsPassed; currentTime = new Date(); if (!window.lastSkipTime) { API.moderateForceSkip(); return window.lastSkipTime = currentTime; } else { millisecondsPassed = Math.round(currentTime.getTime() - window.lastSkipTime.getTime()); if (millisecondsPassed > 10000) { window.lastSkipTime = currentTime; return API.moderateForceSkip(); } } }; return skipCommand; })(Command); disconnectLookupCommand = (function(_super) { __extends(disconnectLookupCommand, _super); function disconnectLookupCommand() { _ref15 = disconnectLookupCommand.__super__.constructor.apply(this, arguments); return _ref15; } disconnectLookupCommand.prototype.init = function() { this.command = '!dcmembros'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; disconnectLookupCommand.prototype.functionality = function() { var cmd, dcHour, dcLookupId, dcMeridian, dcMins, dcSongsAgo, dcTimeStr, dcUser, disconnectInstances, givenName, id, recentDisconnect, resp, u, _i, _len, _ref16, _ref17; cmd = this.msgData.message; if (cmd.length > 11) { givenName = cmd.slice(11); _ref16 = data.users; for (id in _ref16) { u = _ref16[id]; if (u.getUser().username === givenName) { dcLookupId = id; disconnectInstances = []; _ref17 = data.userDisconnectLog; for (_i = 0, _len = _ref17.length; _i < _len; _i++) { dcUser = _ref17[_i]; if (dcUser.id === dcLookupId) { disconnectInstances.push(dcUser); } } if (disconnectInstances.length > 0) { resp = u.getUser().username + ' disconectou ' + disconnectInstances.length.toString() + ' '; if (disconnectInstances.length === 1) { resp += '. '; } else { resp += 's. '; } recentDisconnect = disconnectInstances.pop(); dcHour = recentDisconnect.time.getHours(); dcMins = recentDisconnect.time.getMinutes(); if (dcMins < 10) { dcMins = '0' + dcMins.toString(); } dcMeridian = dcHour % 12 === dcHour ? 'AM' : 'PM'; dcTimeStr = '' + dcHour + ':' + dcMins + ' ' + dcMeridian; dcSongsAgo = data.songCount - recentDisconnect.songCount; resp += 'O seu disconect mais recente foi á ' + dcTimeStr + ' (' + dcSongsAgo + ' músicas atras). '; if (recentDisconnect.waitlistPosition !== void 0) { resp += 'Ele estava ' + recentDisconnect.waitlistPosition + ' música'; if (recentDisconnect.waitlistPosition > 1) { resp += 's'; } resp += ' atras da cabine de dj.'; } else { resp += 'Ele não estava na cabine de dj.'; } API.sendChat(resp); return; } else { API.sendChat(" " + u.getUser().username + " não disconectou."); return; } } } return API.sendChat("Eu não vejo essa pessoa na sala '" + givenName + "'."); } }; return disconnectLookupCommand; })(Command); voteRatioCommand = (function(_super) { __extends(voteRatioCommand, _super); function voteRatioCommand() { _ref16 = voteRatioCommand.__super__.constructor.apply(this, arguments); return _ref16; } voteRatioCommand.prototype.init = function() { this.command = '!voteratio'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; voteRatioCommand.prototype.functionality = function() { var msg, name, r, u, votes; r = new RoomHelper(); msg = this.msgData.message; if (msg.length > 12) { name = msg.substr(12); u = r.lookupUser(name); if (u !== false) { votes = r.userVoteRatio(u); msg = u.username + " :+1: " + votes['woot'].toString() + " vez"; if (votes['woot'] === 1) { msg += ', '; } else { msg += 'es, '; } msg += "e :-1: " + votes['meh'].toString() + " veze"; if (votes['meh'] === 1) { msg += '. '; } else { msg += 'es. '; } msg += "O seu vote ratio é: " + votes['positiveRatio'].toString() + "."; return API.sendChat(msg); } else { return API.sendChat("Não parece ter alguém com esse nome de'" + name + "'"); } } else { return API.sendChat("Você quer alguma coisa? Ou você está apenas tentando me irritar."); } }; return voteRatioCommand; })(Command); avgVoteRatioCommand = (function(_super) { __extends(avgVoteRatioCommand, _super); function avgVoteRatioCommand() { _ref17 = avgVoteRatioCommand.__super__.constructor.apply(this, arguments); return _ref17; } avgVoteRatioCommand.prototype.init = function() { this.command = '!avgvoteratio'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; avgVoteRatioCommand.prototype.functionality = function() { var averageRatio, msg, r, ratio, roomRatios, uid, user, userRatio, votes, _i, _len, _ref18; roomRatios = []; r = new RoomHelper(); _ref18 = data.voteLog; for (uid in _ref18) { votes = _ref18[uid]; user = data.users[uid].getUser(); userRatio = r.userVoteRatio(user); roomRatios.push(userRatio['positiveRatio']); } averageRatio = 0.0; for (_i = 0, _len = roomRatios.length; _i < _len; _i++) { ratio = roomRatios[_i]; averageRatio += ratio; } averageRatio = averageRatio / roomRatios.length; msg = "Accounting for " + roomRatios.length.toString() + " user ratios, the average room ratio is " + averageRatio.toFixed(2).toString() + "."; return API.sendChat(msg); }; return avgVoteRatioCommand; })(Command); staffCommand = (function(_super) { __extends(staffCommand, _super); function staffCommand() { _ref18 = staffCommand.__super__.constructor.apply(this, arguments); return _ref18; } staffCommand.prototype.init = function() { this.command = '!staff'; this.parseType = 'exact'; this.rankPrivelege = 'user'; return window.lastActiveStaffTime; }; staffCommand.prototype.staff = function() { var now, staff, staffAfk, stringstaff, user, _i, _len; staff = API.getStaff(); now = new Date(); stringstaff = ""; for (_i = 0, _len = staff.length; _i < _len; _i++) { user = staff[_i]; if (user.permission > 1) { staffAfk = now.getTime() - data.users[user.id].getLastActivity().getTime(); if (staffAfk < (60 * 60 * 1000)) { stringstaff += "@" + user.username + " "; } } } if (stringstaff.length === 0) { stringstaff = "Aff pqp não tem staff ativo :'("; } return stringstaff; }; staffCommand.prototype.functionality = function() { var currentTime, millisecondsPassed, thestaff; thestaff = this.staff(); currentTime = new Date(); if (!window.lastActiveStaffTime) { API.sendChat(thestaff); return window.lastActiveStaffTime = currentTime; } else { millisecondsPassed = currentTime.getTime() - window.lastActiveStaffTime.getTime(); if (millisecondsPassed > 10000) { window.lastActiveStaffTime = currentTime; return API.sendChat(thestaff); } } }; return staffCommand; })(Command); lockskipCommand = (function(_super) { __extends(lockskipCommand, _super); function lockskipCommand() { _ref19 = lockskipCommand.__super__.constructor.apply(this, arguments); return _ref19; } lockskipCommand.prototype.init = function() { this.command = '!repetida'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; lockskipCommand.prototype.functionality = function() { return data.lockBooth(function() { return setTimeout(function() {}, API.moderateForceSkip(), setTimeout(function() { return data.unlockBooth(); }, 5000), 5000); }); }; return lockskipCommand; })(Command); channelCommand = (function(_super) { __extends(channelCommand, _super); function channelCommand() { _ref20 = channelCommand.__super__.constructor.apply(this, arguments); return _ref20; } channelCommand.prototype.init = function() { this.command = '!comandos'; this.parseType = 'startsWith'; return this.rankPrivelege = 'user'; }; channelCommand.prototype.functionality = function() { return API.sendChat("/em: Lista de comandos: https://www.google.com.br/ _|_"); }; return channelCommand; })(Command); versionCommand = (function(_super) { __extends(versionCommand, _super); function versionCommand() { _ref21 = versionCommand.__super__.constructor.apply(this, arguments); return _ref21; } versionCommand.prototype.init = function() { this.command = '!version'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; versionCommand.prototype.functionality = function() { return API.sendChat("/me BOT editado 1.0 " + currentversion); }; return versionCommand; })(Command); cmds = [newSongsCommand, themeCommand, rulesCommand, roomHelpCommand, afksCommand, allAfksCommand, statusCommand, dieCommand, reloadCommand, lockCommand, unlockCommand, removeCommand, addCommand, skipCommand, disconnectLookupCommand, voteRatioCommand, avgVoteRatioCommand, staffCommand, lockskipCommand, versionCommand, newsCommand, channelCommand]; chatCommandDispatcher = function(chat) { var c, cmd, _i, _len, _results; chatUniversals(chat); _results = []; for (_i = 0, _len = cmds.length; _i < _len; _i++) { cmd = cmds[_i]; c = new cmd(chat); if (c.evalMsg()) { break; } else { _results.push(void 0); } } return _results; }; updateVotes = function(obj) { data.currentwoots = obj.positive; data.currentmehs = obj.negative; return data.currentcurates = obj.curates; }; announceCurate = function(obj) { return APIsendChat("/em: " + obj.user.username + " Gostou dessa Musica!"); }; handleUserJoin = function(user) { data.userJoin(user); return data.users[user.id].updateActivity(); }; handleNewSong = function(obj) { var songId; data.intervalMessages(); if (data.currentsong === null) { data.newSong(); } else { API.sendChat("/em: " + data.currentsong.title + " por " + data.currentsong.author + ". :+1: " + data.currentwoots + ", :-1: " + data.currentmehs + ", :heart: " + data.currentcurates + "."); data.newSong(); document.getElementById("button-vote-positive").click(); } if (data.forceSkip) { songId = obj.media.id; return setTimeout(function() { var cMedia; cMedia = API.getMedia(); if (cMedia.id === songId) { return API.moderateForceSkip(); } }, obj.media.duration * 1000); } }; handleVote = function(obj) { return data.users[obj.user.id].updateVote(obj.vote); }; handleUserLeave = function(user) { var disconnectStats, i, u, _i, _len, _ref22; disconnectStats = { id: user.id, time: new Date(), songCount: data.songCount }; i = 0; _ref22 = data.internalWaitlist; for (_i = 0, _len = _ref22.length; _i < _len; _i++) { u = _ref22[_i]; if (u.id === user.id) { disconnectStats['waitlistPosition'] = i - 1; data.setInternalWaitlist(); break; } else { i++; } } data.userDisconnectLog.push(disconnectStats); return data.users[user.id].inRoom(false); }; antispam = function(chat) { var plugRoomLinkPatt, sender; plugRoomLinkPatt = /(\bhttps?:\/\/(www.)?plug\.dj[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; if (plugRoomLinkPatt.exec(chat.message)) { sender = API.getUser(chat.fromID); if (!sender.ambassador && !sender.moderator && !sender.owner && !sender.superuser) { if (!data.users[chat.fromID]["protected"]) { API.sendChat("Sem spam seu preto"); return API.moderateDeleteChat(chat.chatID); } else { return API.sendChat("Eu deveria expulsá-lo, mas estamos aqui para se diverti!"); } } } }; fans = function(chat) { var msg; msg = chat.message.toLowerCase(); if (msg.indexOf('eowkreowr') !== -1 || msg.indexOf('dsjaodas') !== -1 || msg.indexOf('poekpower') !== -1 || msg.indexOf('fokdsofsdpof') !== -1 || msg.indexOf(':trollface:') !== -1 || msg.indexOf('autowoot:') !== -1) { return API.moderateDeleteChat(chat.chatID); } }; chatUniversals = function(chat) { data.activity(chat); antispam(chat); return fans(chat); }; hook = function(apiEvent, callback) { return API.addEventListener(apiEvent, callback); }; unhook = function(apiEvent, callback) { return API.removeEventListener(apiEvent, callback); }; apiHooks = [ { 'event': API.ROOM_SCORE_UPDATE, 'callback': updateVotes }, { 'event': API.CURATE_UPDATE, 'callback': announceCurate }, { 'event': API.USER_JOIN, 'callback': handleUserJoin }, { 'event': API.DJ_ADVANCE, 'callback': handleNewSong }, { 'event': API.VOTE_UPDATE, 'callback': handleVote }, { 'event': API.CHAT, 'callback': chatCommandDispatcher }, { 'event': API.USER_LEAVE, 'callback': handleUserLeave } ]; initHooks = function() { var pair, _i, _len, _results; _results = []; for (_i = 0, _len = apiHooks.length; _i < _len; _i++) { pair = apiHooks[_i]; _results.push(hook(pair['event'], pair['callback'])); } return _results; }; undoHooks = function() { var pair, _i, _len, _results; _results = []; for (_i = 0, _len = apiHooks.length; _i < _len; _i++) { pair = apiHooks[_i]; _results.push(unhook(pair['event'], pair['callback'])); } return _results; }; initialize(); }).call(this); delay(); loadDammit(); function delay() { setTimeout("load();", 6000); } function load() { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://cookies.googlecode.com/svn/trunk/jaaulde.cookies.js'; script.onreadystatechange = function() { if (this.readyState == 'complete') { loaded(); } } script.onload = readCookies; head.appendChild(script); } function loaded() { loaded = true } function loadDammit() { if (loaded == true) { readCookies(); } } function readCookies() { var currentDate = new Date(); currentDate.setFullYear(currentDate.getFullYear() + 1); var newOptions = { expiresAt: currentDate } jaaulde.utils.cookies.setOptions(newOptions); var value = jaaulde.utils.cookies.get(COOKIE_WOOT); autowoot = value != null ? value : false; value = jaaulde.utils.cookies.get(COOKIE_QUEUE); autoqueue = value != null ? value : false; value = jaaulde.utils.cookies.set(COOKIE_STREAM); stream = value != null ? value : true; value = jaaulde.utils.cookies.get(COOKIE_HIDE_VIDEO); hideVideo = value != null ? value : false; onCookiesLoaded(); } function onCookiesLoaded() { if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6005); } if (autoqueue && !isInQueue()) { joinQueue(); } if (hideVideo) { $('#yt-frame').animate({'height': (hideVideo ? '0px' : '271px')}, {duration: 'fast'}); $('#playback .frame-background').animate({'opacity': (hideVideo ? '0' : '0.91')}, {duration: 'medium'}); } initAPIListeners(); displayUI(); initUIListeners(); populateUserlist(); } var words = { "Points" : "Beats!", "Now Playing" : "Now Spinning!", "Time Remaining" : "Time Remaining!", "Volume" : "Crank the Volume!", "Current DJ" : "Disk Jockey", "Crowd Response" : "Crowd Reaction!", "Fans":"Stalkers!"}; String.prototype.prepareRegex = function() { return this.replace(/([[]^&\$.()\?\/\+{}|])/g, "\$1"); }; function isOkTag(tag) { return (",pre,blockquote,code,input,button,textarea".indexOf(","+tag) == -1); } var regexs=new Array(), replacements=new Array(); for(var word in words) { if(word != "") { regexs.push(new RegExp("\b"+word.prepareRegex().replace(/*/g,'[^ ]*')+"\b", 'gi')); replacements.push(words[word]); } } var texts = document.evaluate(".//text()[normalize-space(.)!='']",document.body,null,6,null), text=""; for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) { if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) { for(var x=0,l=regexs.length; x<l; x++) { text = text.replace(regexs[x], replacements[x]); this_text.textContent = text; } } } var loaded = false; var mentioned = false; var clicked = false; var skipped = false; var timeToWait = 120000; var clickWait = 5000; var skipWait = 601; var timePassed = 0; var clickPassed = 0; var skipPassed = 0; var timer = null; var clickTimer = null; var skipTimer = null; var COOKIE_WOOT = 'autowoot'; var COOKIE_QUEUE = 'autoqueue'; var COOKIE_STREAM = 'stream'; var COOKIE_HIDE_VIDEO = 'hidevideo'; var MAX_USERS_WAITLIST = 50; var fbMsg = ["Entrem na Pagina da sala: https://www.facebook.com/CantadasdiPedreiro"]; var rulesMsg = "Regras: 1) Video no Maximo 6 minutos. 2) Sem Flood! 3) Nao escrever em colorido 4) Respeitar os Adms e Mods ;s 5) Nao Fiquem Pedindo Cargos. "; var skipMsg = ["por favor não pedir para pular as músicas, quer pular da deslike."]; var fansMsg = ["Virem meu Fan que eu retribuo vocês, não esqueça de da @ Menções"]; var wafflesMsg = ["Ppkas para todos! # - (> _ <) - # "," Alguém disse ppkas? # - (> _ <) - #"]; var bhvMsg = ["por favor, não sejam gays no bate-papo "," por favor, não fale assim, controlar a si mesmo! "," por favor, seja maduros fdps"]; var sleepMsg = ["Ta na hora de dormi, Fui virjs! "," Indo dormir agora "," estou tão cansado, durmi é necessário, fui me cama. "," cansaço ... sono ... e ... fui me dormir."]; var workMsg = ["Estou ocupado não sou Vagabundo igual a vocês."]; var afkMsg = ["Eu estou indo embora e um Vão se foderem."," Vou fica AFK por um tempo, volto em breve! "," Indo embora, volto em breve! "," Vou Viaja nas galáxia, estarei de volta em breve !"]; var backMsg = ["Estou de volta minhas putinhas! "," Adivinha quem está de volta? Quem sera? Claro que é eu o seu Pai :D"]; var autoAwayMsg = ["Atualmente estou AFK "," Eu estou AFK "," Eu estou em uma aventura (afk) "," desapareceu por um momento "," não está presente no teclado."]; var autoSlpMsg = ["Atualmente estou dormindo "," Estou comendo ppkas em meus sonhos"]; var autoWrkMsg = ["Atualmente estou ocupado "," estou ocupado "," fazendo um trabalho relacionado a ppkas."]; overPlayed = ["1:vZyenjZseXA", "1:ZT4yoZNy90s", "1:Bparw9Jo3dk", "1:KrVC5dm5fFc","1:Ys9sIqv42lo", "1:1y6smkh6c-0", "1:jZL-RUZUoGY", "1:CrdoD9T1Heg", "1:6R_Rn1iP82I", "1:ea9tluQ_QtE", "1:f9EM8T5K6d8", "1:aHjpOzsQ9YI", "1:3vC5TsSyNjU", "1:yXLL46xkdlY", "1:_t2TzJOyops", "1:BGpzGu9Yp6Y", "1:YJVmu6yttiw", "1:WSeNSzJ2-Jw", "1:2cXDgFwE13g", "1:PR_u9rvFKzE", "1:i1BDGqIfm8U"];overPlayed = ["1:vZyenjZseXA", "1:ZT4yoZNy90s", "1:Bparw9Jo3dk", "1:KrVC5dm5fFc","1:Ys9sIqv42lo", "1:1y6smkh6c-0", "1:jZL-RUZUoGY", "1:CrdoD9T1Heg", "1:6R_Rn1iP82I", "1:ea9tluQ_QtE", "1:f9EM8T5K6d8", "1:aHjpOzsQ9YI", "1:3vC5TsSyNjU", "1:yXLL46xkdlY", "1:_t2TzJOyops", "1:BGpzGu9Yp6Y", "1:YJVmu6yttiw", "1:WSeNSzJ2-Jw", "1:2cXDgFwE13g", "1:PR_u9rvFKzE", "1:i1BDGqIfm8U"]; var styles = [ '.sidebar {position: fixed; top: 0; height: 100%; width: 200px; z-index: 99999; background-image: linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -o-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -moz-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -webkit-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -ms-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000000),color-stop(1, #3B5678));}', '.sidebar#side-right {right: -190px;z-index: 99999;}', '.sidebar#side-left {left: -190px; z-index: 99999; }', '.sidebar-handle {width: 12px;height: 100%;z-index: 99999;margin: 0;padding: 0;background: rgb(96, 141, 197);box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .9);cursor: "ne-resize";}', '.sidebar-handle span {display: block;position: absolute;width: 10px;top: 50%;text-align: center;letter-spacing: -1px;color: #000;}', '.sidebar-content {position: absolute;width: 185px;height: 100%; padding-left: 15px}', '.sidebar-content2 {position: absolute;width: 185px;height: 100%;}', '.sidebar-content2 h3 {font-weight: bold; padding-left: 5px; padding-bottom: 5px; margin: 0;}', '.sidebar-content2 a {font-weight: bold; font-size: 13px; padding-left: 5px;}', '#side-right .sidebar-handle {float: left;}', '#side-left .sidebar-handle {float: right;}', '#side-right a {display: block;min-width: 100%;cursor: pointer;padding: 4px 5px 8px 5px;border-radius: 4px;font-size: 13px;}', '.sidebar-content2 span {display: block; min-width: 94%;cursor: pointer;border-radius: 4px; padding: 0 5px 0 5px; font-size: 12px;}', '#side-right a span {padding-right: 8px;}', '#side-right a:hover {background-color: rgba(97, 146, 199, 0.65);text-decoration: none;}', '.sidebar-content2 span:hover {background-color: rgba(97, 146, 199, 0.65);text-decoration: none;}', '.sidebar-content2 a:hover {text-decoration: none;}', 'html{background: url("http://i.imgur.com/a75C9wE.jpg") no-repeat scroll center top #000000;}', '#room-wheel {z-index: 2;position: absolute;top: 2px;left: 0;width: 1044px;height: 394px;background: url(http://) no-repeat;display: none;}', '.chat-bouncer {background: url(http://i.imgur.com/9qWWO4L.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '.chat-manager{background: url(http://i.imgur.com/hqqhTcp.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '.chat-cohost {background: url(https://dl.dropbox.com/u/67634625/chat-bouncer-icon.png) no-repeat 0 5px;padding-left: 17px;width:292px;}', '.chat-host{background: url(https://dl.dropbox.com/u/67634625/chat-bouncer-icon.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '#dj-console, #dj-console {background-image: url(http://s8.postimage.org/wpugb8gc5/Comp_2.gif);min-height:33px;min-width:131px;}', '.chat-from-you{color: #0099FF;font-weight: bold;margin-top: 0px; padding-top: 0px;}', '.chat-from-bouncer{color: #800080; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-manager{color: #FFDAB9; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-cohost{color: #FF4500; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-host{color: #32CD32;font-weight: bold;margin-top: 0px; padding-top: 0px;}', '#user-points-title{color: #FFFFFF; position: absolute; left: 36px; font-size: 10px;}', '#user-fans-title{color: #FFFFFF; position: absolute; left: 29px; font-size: 10px;}', '.meta-header span{color: rgba(255, 255, 255, 0.79); position: absolute; left: 15px; font-size: 10px;}', '#button-lobby {background-image: url("http://i.imgur.com/brpRaSY.png");}', '#volume-bar-value{background-image: url("http://i.imgur.com/xmyonON.png") ;}', '#hr-div {;height: 100%;width: 100%;margin: 0;padding-left: 12px;}', '#hr2-div2 {;height: 100%;width: 100%;margin: 0;}', '#hr-style {position: absolute;display: block;height: 20px;width: 100%;bottom: 0%;background-image: url("http://i.imgur.com/gExgamX.png");}', '#hr2-style2 {position: absolute;display: block;height: 20px;width: 94%%;bottom: 0%;background-image: url("http://i.imgur.com/gExgamX.png");}', '#side-left h3 {padding-left: 5px}', ]; var scripts = [ "(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind('mousemove',track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=='mouseenter'){pX=ev.pageX;pY=ev.pageY;$(ob).bind('mousemove',track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind('mousemove',track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);", 'if (jQuery.easing.easeOutQuart === undefined) jQuery.easing.easeOutQuart = function (a,b,c,d,e) { return -d*((b=b/e-1)*b*b*b-1)+c; }', '$("#side-right")', ' .hoverIntent(function() {', ' var timeout_r = $(this)', ' .data("timeout_r");', ' if (timeout_r) {', ' clearTimeout(timeout_r);', ' }', ' $(this)', ' .animate({', ' "right": "0px"', ' }, 300, "easeOutQuart");', ' }, function() {', ' $(this)', ' .data("timeout_r", setTimeout($.proxy(function() {', ' $(this)', ' .animate({', ' "right": "-190px"', ' }, 300, "easeOutQuart");', ' }, this), 500));', ' });', '$("#side-left")', ' .hoverIntent(function() {', ' var timeout_r = $(this)', ' .data("timeout_r");', ' if (timeout_r) {', ' clearTimeout(timeout_r);', ' }', ' $(this)', ' .animate({', ' "left": "0px"', ' }, 300, "easeOutQuart");', ' }, function() {', ' $(this)', ' .data("timeout_r", setTimeout($.proxy(function() {', ' $(this)', ' .animate({', ' "left": "-190px"', ' }, 300, "easeOutQuart");', ' }, this), 500));', ' });' ]; function initAPIListeners() { API.addEventListener(API.DJ_ADVANCE, djAdvanced); API.addEventListener(API.CHAT, autoRespond); API.addEventListener(API.DJ_UPDATE, queueUpdate); API.addEventListener(API.VOTE_UPDATE, function (obj) { populateUserlist(); }); API.addEventListener(API.USER_JOIN, function (user) { populateUserlist(); }); API.addEventListener(API.USER_LEAVE, function (user) { populateUserlist(); }); } function displayUI() { var colorWoot = autowoot ? '#3FFF00' : '#ED1C24'; var colorQueue = autoqueue ? '#3FFF00' : '#ED1C24'; var colorStream = stream ? '#3FFF00' : '#ED1C24'; var colorVideo = hideVideo ? '#3FFF00' : '#ED1C24'; $('#side-right .sidebar-content').append( 'auto woot' + 'auto queue' + 'stream' + 'hide video' + 'rules' + 'like our fb' + 'no fans' + 'no skip' + 'waffles' + 'sleeping' + 'working' + 'afk' + 'available' + 'skip' + 'lock' + 'unlock' + 'lockskip' ); } function initUIListeners() { $("#plug-btn-woot").on("click", function() { autowoot = !autowoot; $(this).css("color", autowoot ? "#3FFF00" : "#ED1C24"); if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6001); } jaaulde.utils.cookies.set(COOKIE_WOOT, autowoot); }); $("#plug-btn-queue").on("click", function() { autoqueue = !autoqueue; $(this).css('color', autoqueue ? '#3FFF00' : '#ED1C24'); if (autoqueue && !isInQueue()) { joinQueue(); } jaaulde.utils.cookies.set(COOKIE_QUEUE, autoqueue); }); $("#plug-btn-stream").on("click", function() { stream = !stream; $(this).css("color", stream ? "#3FFF00" : "#ED1C24"); if (stream == true) { API.sendChat("/stream on"); } else { API.sendChat("/stream off"); } jaaulde.utils.cookies.set(COOKIE_STREAM, stream); }); $("#plug-btn-hidevideo").on("click", function() { hideVideo = !hideVideo; $(this).css("color", hideVideo ? "#3FFF00" : "#ED1C24"); $("#yt-frame").animate({"height": (hideVideo ? "0px" : "271px")}, {duration: "fast"}); $("#playback .frame-background").animate({"opacity": (hideVideo ? "0" : "0.91")}, {duration: "medium"}); jaaulde.utils.cookies.set(COOKIE_HIDE_VIDEO, hideVideo); }); $("#plug-btn-face").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(fbMsg[Math.floor(Math.random() * fbMsg.length)]); } }); $("#plug-btn-rules").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(rulesMsg); } }); $("#plug-btn-fans").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(fansMsg[Math.floor(Math.random() * fansMsg.length)]); } }); $("#plug-btn-noskip").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(skipMsg[Math.floor(Math.random() * skipMsg.length)]); } }); $("#plug-btn-waffles").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(wafflesMsg[Math.floor(Math.random() * wafflesMsg.length)]); } }); $("#plug-btn-sleeping").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 3) { API.sendChat(sleepMsg[Math.floor(Math.random() * sleepMsg.length)]); Models.user.changeStatus(3); } } }); $("#plug-btn-working").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 2) { API.sendChat(workMsg[Math.floor(Math.random() * workMsg.length)]); Models.user.changeStatus(2); } } }); $("#plug-btn-afk").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 1) { API.sendChat(afkMsg[Math.floor(Math.random() * afkMsg.length)]); Models.user.changeStatus(1); } } }); $("#plug-btn-back").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 0) { API.sendChat(backMsg[Math.floor(Math.random() * backMsg.length)]); Models.user.changeStatus(0); } } }); $("#plug-btn-skip").on("click", function() { if (skipped == false) { skipped = true; skipTimer = setInterval("checkSkipped();", 500); new ModerationForceSkipService; } }); $("#plug-btn-lock").on("click", function() { new RoomPropsService(document.location.href.split('/')[3],true,true,1,5); }); $("#plug-btn-unlock").on("click", function() { new RoomPropsService(document.location.href.split('/')[3],false,true,1,5); }); $("#plug-btn-lockskip").on("click", function() { if (skipped == false) { skipped = true; skipTimer = setInterval("checkSkipped();", 500); new RoomPropsService(document.location.href.split('/')[3],true,true,1,5); new ModerationForceSkipService; new RoomPropsService(document.location.href.split('/')[3],false,true,1,5); } }); } function queueUpdate() { if (autoqueue && !isInQueue()) { joinQueue(); } } function isInQueue() { var self = API.getSelf(); return API.getWaitList().indexOf(self) !== -1 || API.getDJs().indexOf(self) !== -1; } function joinQueue() { if ($('#button-dj-play').css('display') === 'block') { $('#button-dj-play').click(); } else if (API.getWaitList().length < MAX_USERS_WAITLIST) { API.waitListJoin(); } } function autoRespond(data) { var a = data.type == "mention" && Models.room.data.staff[data.fromID] && Models.room.data.staff[data.fromID] >= Models.user.BOUNCER, b = data.message.indexOf('@') >0; if (data.type == "mention" && mentioned == false) { if (API.getUser(data.fromID).status == 0) { mentioned = true; timer = setInterval("checkMentioned();", 1000); if (Models.user.data.status == 1) { API.sendChat("@" + data.from + " automsg: " + autoAwayMsg[Math.floor(Math.random() * autoAwayMsg.length)]); } if (Models.user.data.status ==2) { API.sendChat("@" + data.from + " automsg: " + autoWrkMsg[Math.floor(Math.random() * autoWrkMsg.length)]); } if (Models.user.data.status ==3) { API.sendChat("@" + data.from + " automsg: " + autoSlpMsg[Math.floor(Math.random() * autoSlpMsg.length)]); } } } } function djAdvanced(obj) { if (hideVideo) { $("#yt-frame").css("height", "0px"); $("#playback .frame-background").css("opacity", "0.0"); } if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6001); } setTimeout("overPlayedSongs();", 3000); } function overPlayedSongs(data) { if (overPlayed.indexOf(Models.room.data.media.id) > -1) { API.sendChat("/me auto skip ligado, Musica Repetida. Fuck you baby!"); setTimeout("new RoomPropsService(document.location.href.split('/')[3],true,true,1,5);", 300); setTimeout("new ModerationForceSkipService;", 600); setTimeout("new RoomPropsService(document.location.href.split('/')[3],false,true,1,5);", 900); } if (Models.room.data.media.duration > 481) { API.sendChat("/me auto skip ligado, música com mais de 6 minutos seram puladas."); setTimeout("new RoomPropsService(document.location.href.split('/')[3],true,true,1,5);", 300); setTimeout("new ModerationForceSkipService;", 600); setTimeout("new RoomPropsService(document.location.href.split('/')[3],false,true,1,5);", 900); } } function populateUserlist() { var mehlist = ''; var wootlist = ''; var undecidedlist = ''; var a = API.getUsers(); var totalMEHs = 0; var totalWOOTs = 0; var totalUNDECIDEDs = 0; var str = ''; var users = API.getUsers(); var myid = API.getSelf(); for (i in a) { str = '' + a[i].username + ''; if (typeof (a[i].vote) !== 'undefined' && a[i].vote == -1) { totalMEHs++; mehlist += str; } else if (typeof (a[i].vote) !== 'undefined' && a[i].vote == +1) { totalWOOTs++; wootlist += str; } else { totalUNDECIDEDs++; undecidedlist += str; } } var totalDECIDED = totalWOOTs + totalMEHs; var totalUSERS = totalDECIDED + totalUNDECIDEDs; var totalMEHsPercentage = Math.round((totalMEHs / totalUSERS) * 100); var totalWOOTsPercentage = Math.round((totalWOOTs / totalUSERS) * 100); if (isNaN(totalMEHsPercentage) || isNaN(totalWOOTsPercentage)) { totalMEHsPercentage = totalWOOTsPercentage = 0; } mehlist = ' ' + totalMEHs.toString() + ' (' + totalMEHsPercentage.toString() + '%)' + mehlist; wootlist = ' ' + totalWOOTs.toString() + ' (' + totalWOOTsPercentage.toString() + '%)' + wootlist; undecidedlist = ' ' + totalUNDECIDEDs.toString() + undecidedlist; if ($('#side-left .sidebar-content').children().length > 0) { $('#side-left .sidebar-content2').append(); } $('#side-left .sidebar-content2').html(' users: ' + API.getUsers().length + ' '); var spot = Models.room.getWaitListPosition(); var waitlistDiv = $(' ').addClass('waitlistspot').text('waitlist: ' + (spot !== null ? spot + ' / ' : '') + Models.room.data.waitList.length); $('#side-left .sidebar-content2').append(waitlistDiv); $('#side-left .sidebar-content2').append(' '); $(".meanlist").append( ' meh list:' + mehlist + ' ' + ' woot list:' + wootlist + ' ' ); } function checkMentioned() { if(timePassed >= timeToWait) { clearInterval(timer); mentioned = false; timePassed = 0; } else { timePassed = timePassed + 601; } } function checkClicked() { if (clickPassed >= clickWait) { clearInterval(clickTimer); clicked = false; clickPassed = 0; } else { clickPassed = clickPassed + 601; } } function checkSkipped() { if (skipPassed >= skipWait) { clearInterval(skipTimer); skipped = false; skipPassed = 600; } else { skipPassed = skipPassed + 500; } } $('#plugbot-css').remove(); $('#plugbot-js').remove(); $('#chat-messages').append(' Bem vindo auto-skip editado pelo Rafael Moraes 1.0 '); $('body').prepend('' + "\n" + styles.join("\n") + "\n" + ''); $('body').append(' ' + ' ||| ' + ' ' + ' ' + ' ' + ' ||| ' + ' ' + ' ' + ' '); $('body').append('');
opoplmm / Test1<html><head> <meta name="baidu-site-verification" content="1jPmULtLtZ"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=9"> <title>微信支付 - 中国领先的第三方支付平台 | 微信支付提供安全快捷的支付方式</title> <meta name="keywords" content="微信支付,微信,支付,移动支付,手机支付,微支付,微信支付开通,微信支付接入,微信支付申请,微信支付官网,微信支付商户平台,微信支付接口开发,微信支付接口申请,微信支付客服,微信支付登录"> <meta name="description" content="微信支付是腾讯公司的支付业务品牌,微信支付提供公众号支付、APP支付、扫码支付、刷卡支付等支付方式。微信支付结合微信公众账号,全面打通O2O生活消费领域,提供专业的互联网+行业解决方案,微信支付支持微信红包和微信理财通,是移动支付的首选。"> <link rel="shortcut icon" href="https://wx.gtimg.com/core/favicon.ico" type="image/x-icon"> <style> body,ol,ul,h1,h2,h3,h4,h5,h6,p{margin:0;padding:0;} body{min-width:1200px;font:14px "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;background:#fff;-webkit-text-size-adjust:100%;color:#222;} a{color:#459ae9;text-decoration:none;} a:hover{color:#459ae9;text-decoration:underline;} i,em{font-style:normal;} strong{font-weight:normal;} li{list-style:none;} img{border:0;vertical-align:middle;} table{border-collapse:collapse;border-spacing:0;} .hide{display:none;} .red{color:#ff0000;} .login-form label,.cbx,.guide-main-li-ico,.warn,.ico-new,.ico-right{background:url(https://wx.gtimg.com/pay/img/home/base.png?v=20160112) no-repeat;} .clr:after{content:".";clear:both;display:block;height:0;visibility:hidden;} .clr{zoom:1;} .hide{display:none;} .vs{margin:0 10px;font-family:arial;color:#ccc;} .cbx{width:16px;height:16px;display:inline-block;margin:-3px 6px 0 0;*margin-top:0;vertical-align:middle;cursor:pointer;overflow:hidden;} .cbx{background-position:0 -54px;} .cbx-on{background-position:0 -80px;display:inline-block;} .wrap{width:1025px;margin:0 auto;overflow:hidden;zoom:1;} .container{margin:25px auto;} .topbar{height:33px;line-height:33px;color:#999;background:#f6f6f6;border-bottom:1px solid #dcdcdc;font:12px/33px tahoma,arial,"Hiragino Sans GB",\5B8B\4F53,sans-serif;} .topbar a{color:#00c901;} .header{position:relative;z-index:99;background-color:#fff;/*border-top:4px solid #44b549;*/border-bottom:1px solid #d9dadc;} .header .wrap{height:60px;position:relative;overflow:visible;z-index:999} .header .logo{float:left;width:232px;overflow:hidden;} .header .logo a{display:block;height:40px;margin-top:12px;text-indent:-999px;background:url(https://wx.gtimg.com/pay/img/common/logo.png?v=20160114) no-repeat} .header .link{float:right;line-height:60px;} .header .link a{color:#222;} .header .link a:hover{color:#459ae9} .header .pole-msg{display:inline-block;*display:inline;position:relative;} .header .pole-msg a.content-us{display:inline-block;width:75px;height:60px;position:relative;z-index:9;} .header .pole-msg a.content-us:hover{color:#222;text-decoration:none;} .header .pole-msg.show-popup a.content-us{background:#fff;border-left:1px solid #e7e7eb;border-right:1px solid #e7e7eb;padding-left:16px;margin:0 -1px 0 -17px;*left:-17px;} .header .popup{display:none;position:absolute;top:59px;left:-97px;border:1px solid #e7e7eb;z-index:8;width:131px;} .header .show-popup .popup{display:block;line-height:26px;padding:14px 20px;background:#fff;} .header .show-popup .popup p{font-size:12px;color:#999} .header .show-popup .popup p.tel{color:#333333;font-size:17px;} .header .show-popup .popup .bor-top{border-top:1px solid #e7e7eb;margin-top:10px;padding-top:10px;} .header .dropdown-arrow{position:absolute;right:6px;top:29px;border-color:#c2c2c2 transparent transparent;border-style:solid dashed dashed;border-width:4px 4px 0;font-size:0;height:0;width:0;line-height:0;} .header .show-popup .dropdown-arrow{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:all .25s ease 0s;-moz-transition:all .25s ease 0s;-o-transition:all .25s ease 0s;transition:all .25s ease 0s;} .footer{text-align:center;padding-bottom:20px;color:#999999;font:12px/1.6 tahoma,arial,"Hiragino Sans GB",\5B8B\4F53,sans-serif;} .footer p{margin-bottom:8px;} .footer a{color:#999999;} .footer a:hover{color:#459ae9} .banner{height:410px;position:relative;} .banner .wrap-login{position:relative;z-index:2;} .banner .login{float:right;width:314px;margin-top:20px;padding:15px 15px 20px;background:rgba(255,255,255,0.8);position:static;border:1px solid #fff;} @media \0screen\,screen\9{ .banner .login{background:#fff;filter:alpha(opacity=80);*zoom:1;position:static;} .banner .login .login-in{position:relative;} } .banner .login h2{margin-bottom:5px;font-size:20px;font-weight:400;} .banner .login h2 strong{display:none;} .banner .login a{color:#333} .banner .login a:hover{color:#459ae9} .banner .login .tips-error a,.banner .login .tips-warn a{color:#459ae9} .banner .login .tips-error{line-height:24px;font-size:13px;} .banner .login .tips-warn .warn{float:left;width:16px;height:16px;background-position:-24px 0;margin-top:4px;} .banner .login .tips-warn p{float:right;color:#b29b4a;width:290px;font-size:13px;line-height:24px} .banner .login-form .login-mainly{margin-top:10px;margin-bottom:10px;} .banner .login-form .login-account,.banner .login-form .login-password{height:42px;line-height:42px;padding:3px 0;background:#fff;border-left:1px solid #cecece;border-top:1px solid #cecece;position:relative;padding-left:54px;} .banner .login-form label{width:20px;height:20px;overflow:hidden;text-indent:-999px;position:absolute;left:20px;top:30%} .banner .login-form input{width:100%;padding:11px 0;border:0;box-shadow:0;outline:0;vertical-align:middle;font-family:"Microsoft YaHei";font-size:14px;} .banner .login-form .ico-account{background-position:0 0;} .banner .login-form .ico-password{background-position:0 -26px;} .banner .login-form .login-password{margin-top:10px;} .banner .login-password-on .login-account{border-bottom:none;} .banner .login-verify{margin-bottom:10px;height:38px;} .banner .login-verify input{width:100px;padding:10px;vertical-align:middle;vertical-align:middle;border-left:1px solid #cecece;border-top:1px solid #cecece;} .banner .login-verify input:focus{border-left:1px solid #cecece;border-top:1px solid #cecece;} .banner .login-verify .img-verify{width:100px;height:40px;margin:0 11px;vertical-align:middle;} .banner .login-memory{margin-bottom:20px;overflow:hidden;zoom:1;} .banner .login-memory .memory-account{float:left;} .banner .login-memory .forget-password{float:right;} .banner .login .btn-login{display:inline-block;width:100%;height:45px;line-height:45px;background-color:#00c800;color:#fff;border:1px solid #44b549;text-align:center;font-size:20px;} .banner .login .btn-login:hover{text-decoration:none;background:#2F9833;color:#fff;} .guide-main-li-ico{display:inline-block;width:73px;height:57px;} .ico-mp{background-position:2px -159px;} .ico-app{background-position:8px -366px;} .ico-code{background-position:4px -230px;} .ico-shuaka{background-position:8px -294px;} /*最新公告*/ .cms-notice{margin:5px 0 -7px;position:relative;} .cms-notice h2,.cms-notice ul,.cms-notice p{display:inline-block;line-height:20px;} .cms-notice h2{float:left;background:#595B5B;color:#fff;font-size:14px;padding:0px 4px;} .cms-notice li{float:left;margin-left:18px;width:275px;} .cms-notice a{color:#222} .cms-notice a:hover{color:#459ae9} .cms-notice li span.time{float:left;color:#999;margin-right:5px;} .cms-notice li a{display:inline-block;max-width:205px;_width:205px;height:21px;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;} .cms-notice p{float:right;} .cms-notice p a{color:#222;} .cms-notice li .ico-new{position:absolute;display:inline-block;width:17px;height:9px;margin-left:5px;background:url(https://wx.gtimg.com/mch/img/ico-new.png);} .cms-notice .more{position:absolute;top:0;right:0;} .cms-notice .more .ico-right{display:inline-block;width:11px;height:9px;margin:0 0 0 3px;vertical-align:middle;background-position:-4px -135px;} /*四大支付方式*/ .title{margin-top:45px;} .title h2,.title .line,.title .pay-btn{display:inline-block;} .title h2{font-size:20px;font-weight:normal;color:#333;background:#fff;position:absolute;margin-top:-15px;padding-right:10px;} .title .pay-btn{position:absolute;right:0;margin-top:-14px;background:#fff;padding-left:5px;} .title .pay-btn a{display:block;border:1px solid #3e3a39;padding:2px 5px 2px 17px;color:#333333;} .title .pay-btn a:hover{text-decoration:none} .through{height:326px;margin-top:20px;padding-bottom:35px;border-bottom:1px dotted #ccc;background:url(https://wx.gtimg.com/pay/img/home/qrcode.png?v=20150602) center top no-repeat;} .through li{font-size:16px;margin-top:58px;margin-left:68px;position:absolute;} .through li.l02{margin-top:143px;} .through li.l03{margin-top:228px;} .through li.l04{margin-left:748px;} .through li.l05{margin-top:143px;margin-left:755px;} .through li.l06{margin-top:228px;margin-left:755px;} .guide-main{margin-top:37px;margin-bottom:5px;} .guide-main li{width:240px;height:266px;background-color:#FFFFFF;float:left;margin-right:21px;_margin-right:20px;text-align:center} .guide-main .guide-main-li-4{margin-right:0;} .guide-main li a{width:239px;height:266px;display:block;position:relative;border:1px solid #e5e5e5;} .guide-main li .title{display:block;color:#000000;font-size:16px;line-height:1;margin-top:25px;font-weight:normal} .guide-main li .info{display:block;color:#999999;font-size:12px;line-height:1;margin-top:14px;} .guide-main li .info .strong{font-weight:bold;} .guide-main-li-ico{margin-top:72px;-webkit-transition:margin-top 0.2s linear;-moz-transition:margin-top 0.2s linear;-ms-transition:margin-top 0.2s linear;-o-transition:margin-top 0.2s linear;transition:margin-top 0.2s linear;} .guide-main li .btngreen{display:none;margin:20px auto 0;width:191px;height:35px;line-height:35px;background-color:#00C800;font-size:14px;color:#FFFFFF;border-bottom:1px solid #00A000;} .guide-main li .btngray{background-color:#E6E6E6!important;color:#666666!important;border-bottom:1px solid #CCCCCC;} .guide-main-li-3 .tips{display:none;font-size:12px;color:#FF9900;line-height:1;} .guide-main-li-3 .tips .ico-info-orange{vertical-align:-3px;*vertical-align:1px;margin-right:5px;margin-top:12px;} .guide-main li a:hover{border:1px solid #00c800;text-decoration:none} .guide-main li a:hover .btngreen{display:block;} .guide-main li a:hover .tips{display:block;} .guide-main li a:hover .guide-main-li-ico{margin-top:45px;-webkit-transition:margin-top 0.2s linear;-moz-transition:margin-top 0.2s linear;-ms-transition:margin-top 0.2s linear;-o-transition:margin-top 0.2s linear;transition:margin-top 0.2s linear;} .guide-link{padding-top:120px;padding-bottom:58px;position:relative;height:24px;} .guide-link-a{color:#00C800;font-size:18px;height:24px;width:162px;} .guide-link-a .ico-arrow-right{vertical-align:-2px;*vertical-align:3px;margin-left:8px;cursor:pointer;} .guide-link-code{display:none;position:absolute;border:1px solid #C9C9C9;padding:6px;background-color:#FFFFFF;width:105px;height:105px;top:67px;left:50%;margin-left:90px;} .show-code .guide-link-code{display:block;} .show-code .ico-arrow-right{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);} /*图片轮播*/ .cms-banner{position:absolute;top:0;width:100%;height:410px;overflow:hidden; left:0} .cms-banner a{display:block;width:100%;height:410px;text-indent:-9999px;} .cms-banner ul li{position:absolute;top:0;width:100%;height:410px;background-position:center;background-repeat:no-repeat;} .cms-banner ol{position:absolute;z-index:9;bottom:0px;display:table;left:50%;margin-left:-73px;padding:16px 16px 16px 0;} .cms-banner ol li{float:left;width:10px;height:10px;margin-left:16px;text-indent:-9999px;background:#fff;border-radius:5px;overflow:hidden;} .cms-banner ol li.active{background:#44B549;} </style> </head> <body class="index" onclick="pgvWatchClick();"> <!-- 头部[[ --> <!-- 头部 [[ --> <script>var _speedMark=Date.now()</script> <!--小于ie7 跳转到错误页面 --> <!--[if lt IE 7]> <script> window.location.href='https://pay.weixin.qq.com/public/error/browser_tips'; </script> <![endif]--> <div class="topbar"> <div class="wrap"> <span onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.CHINA_BUSINESS'});">境内业务</span> <i class="vs">|</i> <a onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.INTERNATIONAL_BUSINESS'});" href="https://pay.weixin.qq.com/index.php/public/wechatpay" target="_blank">International business</a> </div> </div> <div class="header"> <div class="wrap"> <div class="logo"><h1><a href="/index.php/core/account" title="微信支付商户平台">微信支付商户平台</a></h1></div> <div class="link"> <a href="https://pay.weixin.qq.com/partner/public/home" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.SERVICE_PROVIDER'});"><strong class="hide">微信支付</strong>服务商</a> <i class="vs">|</i> <a href="https://pay.weixin.qq.com/wxzf_guide/index.shtml" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.WXZF_GUIDE'});"><strong class="hide">微信支付</strong>接入指引</a> <i class="vs">|</i> <a href="https://pay.weixin.qq.com/wiki/doc/api/index.php" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.API_DOC'});"><strong class="hide">微信支付</strong>开发文档</a> <i class="vs">|</i> <div class="pole-msg showPopUpJS"> <a class="content-us" href="javascript:;" onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.HELP_CENTER'});">帮助中心<span class="dropdown-arrow"></span></a> <div class="popup"> <div class="inner"> <ul> <li> <p class="tel">客服:95017</p> <p>周一到周五 09:00-18:00</p> </li> <li class="bor-top"> <a href="http://kf.qq.com/product/wechatpaymentmerchant.html" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.NAVI.QQ_KEFU'});">自助服务专区</a> </li> </ul> </div> </div> </div> </div> </div> </div> <script src="https://wx.gtimg.com/third/jquery/jquery-1.7.min.js"></script> <script type="text/javascript">if(typeof $jqueryUi == "undefined"){document.write('<script type="text/javascript" src="https://wx.gtimg.com/third/jquery/jquery-ui.js"></script"+">');}</script><script type="text/javascript" src="https://wx.gtimg.com/third/jquery/jquery-ui.js"></script"+"> <script>window["MCH.common.time"]=[new Date()]</script> <script id="legos:22195" ver="22195:20140901:20160908155731" name="MCH.common" src="https://wx.gtimg.com/mch/js/ver/2014/09/mch.common.20140901.js?t=20160908155731" charset="utf-8"></script><div class="mask-layer hide" id="header-masker"></div><!--[if !IE]>|xGv00|c95d265e97fcc54b235954b5b4a712f5<![endif]--> <script>window["MCH.header.time"]=[new Date()]</script> <script id="legos:22118" ver="22118:20140422:20160620111341" name="MCH.header" src="https://wx.gtimg.com/mch/js/ver/2014/04/mch.header.20140422.js?t=20160620111341" charset="utf-8"></script><!--[if !IE]>|xGv00|da289bab2d090281ed2476547ba6b944<![endif]--> <!-- 头部 ]] --><!--[if !IE]>|xGv00|73bbdddabec4f094fcae10c51db0f883<![endif]--> <!-- 头部 ]] --> <!-- 登录[[ --> <div class="banner"> <div class="cms-banner cms-area" id="cmspic_1000" home="true"><ul><li style="opacity: 0; z-index: 0; background-image: url("https://shp.qpic.cn/mmpay/oU5xbewRJutFViafoibhr5UHrDC2mbMGDZyLEY3icMbqS2o3BoicgX18HtuYicRR0fOJM/0");"><a target="_blank" href="https://pay.weixin.qq.com/public/qrcode_pay">banner</a></li><li style="opacity: 0.248188; z-index: 0; background-image: url("https://shp.qpic.cn/mmpay/oU5xbewRJuvfQibNQiaWz5VUDocbQSYYe3hM60YBT0t6AWkzDjcIFFgQxckUUn64nQ/0");"><a target="_blank" href="http://v.qq.com/x/cover/mv3e2ecbtloy44o.html?vid=u01960zjo7r">banner</a></li><li style="opacity: 0.751812; z-index: 1; background-image: url("https://shp.qpic.cn/mmpay/oU5xbewRJuv0wHAj5rxw34SXVgoycsicBB7zpopLBoGzl6S7EicZPsOPsyfj90NG2I/0");"><a target="_blank" href="http://v.qq.com/x/cover/mv3e2ecbtloy44o.html?vid=u01960zjo7r">banner</a></li><li style="opacity: 0; z-index: 0; background-image: url("https://shp.qpic.cn/mmpay/oU5xbewRJuupH9MJ5hbqw5sMmlyyn0UnUicF2UeHLKEkCO11MnS1DoXXicX3gOwfuK/0");"><a target="_blank" href="http://v.qq.com/x/cover/mv3e2ecbtloy44o.html?vid=u01960zjo7r">banner</a></li><li style="opacity: 0; z-index: 0; background-image: url("https://shp.qpic.cn/mmpay/oU5xbewRJuuZ81jvVm2RMN2C3hBE2oKW6UjJKs99mAZRxGOdCFYkyMU8NxHLDlLQ/0");"><a target="_blank" href="http://v.qq.com/x/cover/mv3e2ecbtloy44o.html?vid=u01960zjo7r">banner</a></li></ul><ol class="dots" style="opacity: 1; z-index: 1;"><li class="dot">1</li><li class="dot">2</li><li class="dot active">3</li><li class="dot">4</li><li class="dot">5</li></ol></div> <div class="wrap"> <div class="wrap-login"> <div class="login"> <div class="login-in"> <h2><span class="hide">微信支付</span>商户登录</h2> <div class="tips-warn clr hide" id="IDBrowserSafariTips"><i class="warn"></i><p>由于Safari浏览器安全策略,如密码输入出现异常,请根据指引修改Safari浏览器配置, <a href="/help_guide/login_guide.shtml" target="_blank">查看指引</a></p></div> <div class="tips-warn clr hide" id="IDBrowserMacChromeTips"><i class="warn"></i><p> 如密码输入出现异常,请根据指引修改浏览器配置, <a href="https://pay.weixin.qq.com/index.php/public/cms/content_detail?platformType=0&lang=zh&id=29000 " target="_blank">查看指引。</a></p></div> <div class="tips-error"><i class="ico-error"></i><p id="errmsg" style="color:red"></p></div> <!-- 交互说明 1. 给样式"login-form"添加样式"login-account-on",显示账号获焦效果 2. 给样式"login-form"添加样式"login-password-on",显示密码获焦效果 --> <form class="login-form login-password-on" action="/index.php/core/home/d_login_transition" method="post"> <div class="login-mainly"> <div class="login-account"><label class="ico-account" for="" title="登录帐号">登录帐号</label><input type="text" name="username" placeholder="登录帐号" id="idUserName"></div> <div class="login-password" id="mmpayPwdEdit"><label class="ico-password" for="" title="登录密码">登录密码</label><input type="password" name="password" placeholder="登录密码" id="idPassword"></div> </div> <input type="hidden" name="return_url" value="/index.php"> <input type="hidden" name="login_type" value="0"> <input id="token" type="hidden" name="ecc_csrf_token" value="2a9b085516b87f66cb0ca18a5453bdf4"> <div class="login-verify "><input type="text" name="checkword_in" maxlength="4" placeholder="验证码"><input type="hidden" name="need_check" value="1"><img class="img-verify change-verify" src="http://captcha.qq.com/getimage?aid=755049101&rd=0.1314846018794924" style="height:40px;width:100px;"><a class="change-verify" href="#">换一张</a></div> </form> <div class="login-memory"><label id="memory_username_label" class="memory-account" for=""><i class="cbx" id="memory_username"></i>记住帐号</label><a class="forget-password" href="/index.php/public/reset_pass" onclick="pgvSendClick({hottag:'PAY.HOME.LOGIN_BOX.FORGET_PASSWORD'});">忘记密码?</a></div> <a class="btn-login" href="javascript:void(0);" id="do_login" onclick="pgvSendClick({hottag:'PAY.HOME.LOGIN_BOX.LOGIN_BUTTON'});">登录</a> </div> </div> <input id="seed" type="hidden" name="time_seed" value="31343839353931393137"> </div> </div> </div> <!-- 登录 ]] --> <!-- 内容[[ --> <div class="container"> <div class="wrap"> <!-- 最新公告[[ --> <div class="cms-notice cms-area clr" id="cmsanm_6000" home="true" link-list-id="6200"><h2>最新公告</h2><ul><li><span class="time">[03.15]</span><a target="_blank" href="/index.php/public/cms/content_detail?lang=zh&id=36602" title="3月16-17日微信支付退款业务升级维护通知">3月16-17日微信支付退款业务升级维护通知</a><i class="ico-new"></i></li><li><span class="time">[02.10]</span><a target="_blank" href="/index.php/public/cms/content_detail?lang=zh&id=41201" title="微信支付企业付款业务调整公告">微信支付企业付款业务调整公告</a></li><li><span class="time">[11.30]</span><a target="_blank" href="/index.php/public/cms/content_detail?lang=zh&id=30001" title="《商户平台使用手册》正式上线">《商户平台使用手册》正式上线</a></li></ul><p class="more"><a href="/public/cms/content_list?lang=zh&id=6200" target="_blank">更多公告>></a></p></div> <!-- 最新公告 ]] --> <!-- 四大支付方式[[ --> <div class="title clr"> <h2>接入微信支付</h2> </div> <div class="function clr"> <ul class="guide-main clr"> <li class="guide-main-li-1"> <a href="http://kf.qq.com/faq/120911VrYVrA150905zeYjMZ.html" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.APPLY.IN_APP_WEB'});"> <span class="guide-main-li-ico ico-mp"></span> <h3 class="title">公众号支付</h3> <p class="info">在微信内的商家页面上完成<em>公众号支付</em></p> <span class="btngreen">我要接入</span> </a> </li> <li class="guide-main-li-2"> <a href="http://kf.qq.com/faq/120911VrYVrA150906F3qqY3.html" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.APPLY.IN_APP'});"> <span class="guide-main-li-ico ico-app"></span> <h3 class="title">APP支付</h3> <p class="info">在APP中,调起微信进行<em>APP支付</em></p> <span class="btngreen">我要接入</span> </a> </li> <li class="guide-main-li-3"> <a href="http://kf.qq.com/faq/120911VrYVrA150906yUZze6.html" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.APPLY.QR_CODE'});"> <span class="guide-main-li-ico ico-code"></span> <h3 class="title">扫码支付</h3> <p class="info">扫描二维码进行<em>扫码支付</em></p> <span class="btngreen">我要接入</span> </a> </li> <li class="guide-main-li-4"> <a href="http://kf.qq.com/faq/120911VrYVrA150906iQjQjI.html" target="_blank" onclick="pgvSendClick({hottag:'PAY.HOME.APPLY.QUICK_PAY'});"> <span class="guide-main-li-ico ico-shuaka"></span> <h3 class="title">刷卡支付</h3> <p class="info">用户展示条码,商户扫描完成<em>刷卡支付</em></p> <span class="btngreen">我要接入</span> </a> </li> </ul> </div> <!-- 四大支付方式 ]] --> <!-- 微信支付商户通[[ --> <div class="title clr"> <h2>微信支付商户通</h2> </div> <div class="through"> <ul> <li class="l01">如何快速接入<strong>微信支付</strong>?</li> <li class="l02">了解最新的<strong>支付技术接口</strong>?</li> <li class="l03"><strong>微信商户</strong>后台操作有疑问?</li> <li class="l04"><strong>微信现金红包</strong>怎么玩?</li> <li class="l05">掌握最新的<strong>微信行业解决方案</strong>?</li> <li class="l06">获取一手的<strong>微信支付官方动态</strong>?</li> </ul> </div> <!-- 微信支付商户通 ]] --> </div> </div> <!-- 内容 ]] --> <script src="https://www.tenpay.com/v2/res/js/global/tenpayctrl_v2-min.js"></script> <script>window["MCH.tenpaycertV2.time"]=[new Date()]</script> <script id="legos:22410" ver="22410:20151023:20170106102318" name="MCH.tenpaycertV2" src="https://wx.gtimg.com/mch/js/ver/2015/10/mch.tenpaycertV2.20151023.js?t=20170106102318" charset="utf-8"></script><!--[if !IE]>|xGv00|09219d01d9d2312179afd1ffbb55230b<![endif]--><!--[if !IE]>|xGv00|8ab59df4495293a71573934cfa4d640c<![endif]--> <script>window["MCH.home.time"]=[new Date()]</script> <script id="legos:22134" ver="22134:20140516:20170105201629" name="MCH.home" charset="utf-8"> window['MCH.home.time'] && window['MCH.home.time'].push(new Date()); function $addToken(url,type,skey){var token=$getToken(skey);if(url==""||(url.indexOf("://")<0?location.href:url).indexOf("http")!=0){return url;} if(url.indexOf("#")!=-1){var f1=url.match(/\?.+\#/);if(f1){var t=f1[0].split("#"),newPara=[t[0],"&g_tk=",token,"&g_ty=",type,"#",t[1]].join("");return url.replace(f1[0],newPara);}else{var t=url.split("#");return[t[0],"?g_tk=",token,"&g_ty=",type,"#",t[1]].join("");}} return token==""?(url+(url.indexOf("?")!=-1?"&":"?")+"g_ty="+type):(url+(url.indexOf("?")!=-1?"&":"?")+"g_tk="+token+"&g_ty="+type);};var $ajax=(function(window,undefined){var oXHRCallbacks,xhrCounter=0;var fXHRAbortOnUnload=window.ActiveXObject?function(){for(var key in oXHRCallbacks){oXHRCallbacks[key](0,1);}}:false;return function(opt){var o={url:'',method:'GET',data:null,type:"text",async:true,cache:false,timeout:0,autoToken:true,username:'',password:'',beforeSend:$empty(),onSuccess:$empty(),onError:$empty(),onComplete:$empty()};for(var key in opt){o[key]=opt[key]} var callback,timeoutTimer,xhrCallbackHandle,ajaxLocation,ajaxLocParts;try{ajaxLocation=location.href;} catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;} ajaxLocParts=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/.exec(ajaxLocation.toLowerCase())||[];o.isLocal=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ajaxLocParts[1]);o.method=(typeof(o.method)!="string"||o.method.toUpperCase()!="POST")?"GET":"POST";o.data=(typeof o.data=="string")?o.data:$makeUrl(o.data);if(o.method=='GET'&&o.data){o.url+=(o.url.indexOf("?")<0?"?":"&")+o.data;} if(o.autoToken){o.url=$addToken(o.url,"ajax");} o.xhr=$xhrMaker();if(o.xhr===null){return false;} try{if(o.username){o.xhr.open(o.method,o.url,o.async,o.username,o.password);} else{o.xhr.open(o.method,o.url,o.async);}} catch(e){o.onError(-2,e);return false;} if(o.method=='POST'){o.xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');} if(!o.cache){o.xhr.setRequestHeader('If-Modified-Since','Thu, 1 Jan 1970 00:00:00 GMT');o.xhr.setRequestHeader('Cache-Control','no-cache');} o.beforeSend(o.xhr);if(o.async&&o.timeout>0){if(o.xhr.timeout===undefined){timeoutTimer=setTimeout(function(){if(o.xhr&&callback){callback(0,1);} o.onError(0,null,'timeout');},o.timeout);} else{o.xhr.timeout=o.timeout;o.xhr.ontimeout=function(){if(o.xhr&&callback){callback(0,1);} o.onError(0,null,'timeout');};}} o.xhr.send(o.method=='POST'?o.data:null);callback=function(e,isAbort){if(timeoutTimer){clearTimeout(timeoutTimer);timeoutTimer=undefined;} if(callback&&(isAbort||o.xhr.readyState===4)){callback=undefined;if(xhrCallbackHandle){o.xhr.onreadystatechange=$empty();if(fXHRAbortOnUnload){try{delete oXHRCallbacks[xhrCallbackHandle];} catch(e){}}} if(isAbort){if(o.xhr.readyState!==4){o.xhr.abort();}} else{var status,statusText,responses;responses={headers:o.xhr.getAllResponseHeaders()};status=o.xhr.status;try{statusText=o.xhr.statusText;} catch(e){statusText="";} try{responses.text=o.xhr.responseText;} catch(e){responses.text="";} if(!status&&o.isLocal){status=responses.text?200:404;} else if(status===1223){status=204;} if(status>=200&&status<300){responses.text=responses.text.replace(/<!--\[if !IE\]>[\w\|]+<!\[endif\]-->/g,'');switch(o.type){case'text':o.onSuccess(responses.text);break;case"json":var json;try{json=(new Function("return ("+responses.text+")"))();} catch(e){o.onError(status,e,responses.text);} if(json){o.onSuccess(json);} break;case"xml":o.onSuccess(o.xhr.responseXML);break;}} else{if(status===0&&o.timeout>0){o.onError(status,null,'timeout');} else{o.onError(status,null,statusText);}} o.onComplete(status,statusText,responses);} delete o.xhr;}};if(!o.async){callback();} else if(o.xhr.readyState===4){setTimeout(callback,0);} else{xhrCallbackHandle=++xhrCounter;if(fXHRAbortOnUnload){if(!oXHRCallbacks){oXHRCallbacks={};if(window.attachEvent){window.attachEvent("onunload",fXHRAbortOnUnload);} else{window["onunload"]=fXHRAbortOnUnload;}} oXHRCallbacks[xhrCallbackHandle]=callback;} o.xhr.onreadystatechange=callback;}};})(window,undefined);function $empty(){return function(){return true;}};function $getCookie(name){var reg=new RegExp("(^| )"+name+"(?:=([^;]*))?(;|$)"),val=document.cookie.match(reg);return val?(val[2]?unescape(val[2]):""):null;};function $getToken(skey){var skey=skey?skey:$getCookie("skey");return skey?$time33(skey):"";};function $makeUrl(data){var arr=[];for(var k in data){arr.push(k+"="+data[k]);};return arr.join("&");};function $namespace(name){for(var arr=name.split(','),r=0,len=arr.length;r<len;r++){for(var i=0,k,name=arr[r].split('.'),parent={};k=name[i];i++){i===0?eval('(typeof '+k+')==="undefined"?('+k+'={}):"";parent='+k):(parent=parent[k]=parent[k]||{});}}};function $setCookie(name,value,expires,path,domain,secure){var exp=new Date(),expires=arguments[2]||null,path=arguments[3]||"/",domain=arguments[4]||null,secure=arguments[5]||false;expires?exp.setMinutes(exp.getMinutes()+parseInt(expires)):"";document.cookie=name+'='+escape(value)+(expires?';expires='+exp.toGMTString():'')+(path?';path='+path:'')+(domain?';domain='+domain:'')+(secure?';secure':'');};function $strTrim(str,code){var argus=code||"\\s";var temp=new RegExp("(^"+argus+"*)|("+argus+"*$)","g");return str.replace(temp,"");};function $time33(str){for(var i=0,len=str.length,hash=5381;i<len;++i){hash+=(hash<<5)+str.charAt(i).charCodeAt();};return hash&0x7fffffff;};function $xhrMaker(){var xhr;try{xhr=new XMLHttpRequest();}catch(e){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xhr=null;}}};return xhr;};$namespace("MCH.home");MCH.home={tenpayEdit:''};MCH.home.init=function(){homeThat=this;homeThat.tenpayEdit=new MCH.mmpayEdit({bindObjId:"mmpayPwdEdit",width:258,height:44},{isShowFunc:MCH.home.isShowFunc,returnCallBack:MCH.home.editShowReturn},this);this.bind();Common.exdAttrBrowser();};MCH.home.isShowFunc=function(){var username=$strTrim($(".login-form").find("input[name=username]").val());if(Common.isTenpayMchByName(username)){return true;}else{return false;}};MCH.home.editShowReturn=function(editRet){var browserFunc=function(){var sys=Common.getBrowserVersion();if(sys.osType=="mac"&&sys.browserName=="Safari"){$("#IDBrowserSafariTips").removeClass("hide");}else if(sys.osType=="mac"&&sys.browserName=="Chrome"&&sys.browserVersion>="47"){$("#IDBrowserMacChromeTips").removeClass("hide");}else if(sys.osType=="windows"&&sys.browserName!="IE"){$("#IDBrowserMacChromeTips").removeClass("hide");}};try{var version=editRet.editObj.ctrl.Version.toString();if(version&&(version>1206)){return true;}else{browserFunc();}}catch(e){browserFunc();}};MCH.home.focus_fuc=function(){$(".login-form").removeClass("login-account-on");$(".login-form").addClass("login-password-on");};MCH.home.blur_fuc=function(){$(".login-form").removeClass("login-password-on");};MCH.home.enter_fuc=function(){return null;};MCH.home.ossAttrIncAPI=function(id,key){var postData='id='+id+'&key='+key;$ajax({url:'/webreport/ossattrapi',data:postData,method:'post',type:'json',async:true,onSuccess:function(data){},onError:function(msg){}});};MCH.home.userNameBlur=function(){var username=$(".login-form").find("input[name=username]").val();var length=username.length;switch(length){case 0:MCH.home.ossAttrIncAPI(63769,18);break;case 1:MCH.home.ossAttrIncAPI(63769,19);break;case 2:MCH.home.ossAttrIncAPI(63769,20);break;case 3:MCH.home.ossAttrIncAPI(63769,21);break;case 4:MCH.home.ossAttrIncAPI(63769,22);break;case 5:MCH.home.ossAttrIncAPI(63769,23);break;case 6:MCH.home.ossAttrIncAPI(63769,24);break;case 7:MCH.home.ossAttrIncAPI(63769,25);break;case 8:MCH.home.ossAttrIncAPI(63769,26);break;case 9:MCH.home.ossAttrIncAPI(63769,27);break;case 10:MCH.home.ossAttrIncAPI(63769,28);break;default:MCH.home.ossAttrIncAPI(63769,29);break;} var ua=navigator.userAgent.toLowerCase();var reg=/[Aa]ndroid/;if(reg.test(ua)){MCH.home.ossAttrIncAPI(63769,31);}else{MCH.home.ossAttrIncAPI(63769,32);}};MCH.home.bind=function(){$("input[name=username]").focus();if($getCookie("username")){MCH.home.ossAttrIncAPI(63769,30);$("input[name=username]").val($getCookie("username"));$("#memory_username").addClass('cbx-on');} $("input[name=username]").on('focus',function(){MCH.home.ossAttrIncAPI(63769,17);$(".login-form").removeClass("login-password-on");$(".login-form").addClass("login-account-on");});$("input[name=password]").on('focus',function(){$(".login-form").removeClass("login-account-on");$(".login-form").addClass("login-password-on");homeThat.tenpayEdit.show();});$("input[name=username]").on('blur',function(){MCH.home.userNameBlur();$(".login-form").removeClass("login-account-on");$(".login-form").addClass("login-password-on");homeThat.tenpayEdit.show();});$("#memory_username_label").on('click',function(){if($('#memory_username').hasClass('cbx-on')){$('#memory_username').removeClass('cbx-on');}else{$('#memory_username').addClass('cbx-on');}});$("#do_login").on('click',function(){$("#errmsg").text("").addClass('hide');var temp_usrname=$(".login-form").find("input[name=username]").val();$(".login-form").find("input[name=username]").val($strTrim(temp_usrname));if($("#memory_username").hasClass('cbx-on')){$setCookie('username',$("input[name=username]").val(),'3600');}else{$setCookie('username',$("input[name=username]").val());} var username=$(".login-form").find("input[name=username]").val();var password=$(".login-form").find("input[name=password]").val();password=homeThat.tenpayEdit.getPwd();if(username&&password){password=Common.encryptPassword(password);if($(".login-verify").html()){if($("input[name=checkword_in]").val()){if($("input[name=checkword_in]").val().length!=4){$("#errmsg").text('请检查验证码').removeClass('hide');}else{$(".login-form").find("input[name=password]").val(password);$(".login-form").submit();}} else{$("#errmsg").text('请输入验证码').removeClass('hide');}}else{$(".login-form").find("input[name=password]").val(password);$(".login-form").submit();}}else{if(username.length==0&&password===false){$("#errmsg").text('请输入帐号和密码').removeClass('hide');}else if(username.length==0){$("#errmsg").text('请输入登录帐号').removeClass('hide');}else{$("#errmsg").text(homeThat.tenpayEdit.errmsg).removeClass('hide');}}});};MCH.home.init(); window['MCH.home']='22134:20140516:20170105201629'; window['MCH.home.time'] && window['MCH.home.time'].push(new Date()); </script><!--[if !IE]>|xGv00|6f5e5c77fe153f6e42ad173204c021c5<![endif]--> <script>window["MCH.cms.time"]=[new Date()]</script> <script id="legos:22392" ver="22392:20151027:20160810123858" name="MCH.cms" src="https://wx.gtimg.com/mch/js/ver/2015/10/mch.cms.20151027.js?t=20160810123858" charset="utf-8"></script><!--[if !IE]>|xGv00|b299de016a6e1f795625ccbc51c6c029<![endif]--> <!-- 底部[[ --> <div class="footer"> <div class="wrap"> <p> <a target="_blank" href="http://help.tenpay.com/cgi-bin/helpcenter/help_center.cgi?id=1&type=0">关于财付通</a> <i class="vs">|</i> <a target="_blank" href="https://pay.weixin.qq.com/index.php/core/home/pay_pact_v4">平台使用协议</a> <i class="vs">|</i> <a href="https://pay.weixin.qq.com/index.php/public/apply_sign/protocol_v2" target="_blank">支付服务协议</a> <i class="vs">|</i> Powered By Tencent & Tenpay Copyright© 2005-<script> var year=""; mydate=new Date(); myyear=mydate.getYear(); year=(myyear > 200) ? myyear : 1900 + myyear; document.write(year); </script>2017 Tenpay All Rights Reserved. </p> <p> <a target="_blank" href="http://weixin.qq.com/">微信</a> <i class="vs">|</i> <a target="_blank" href="https://mp.weixin.qq.com/">微信公众平台</a> <i class="vs">|</i> <a target="_blank" href="https://open.weixin.qq.com/">微信开放平台</a> <i class="vs">|</i> <a target="_blank" href="http://e.qq.com/">广点通</a> <i class="vs">|</i> <a target="_blank" href="http://open.qq.com/">腾讯开放平台</a> </p> </div> </div> <script type="text/javascript">if(typeof $jqueryUi == "undefined"){document.write('<script type="text/javascript" src="https://wx.gtimg.com/third/jquery/jquery-ui.js"></script"+">');}</script><script type="text/javascript" src="https://wx.gtimg.com/third/jquery/jquery-ui.js"></script"+"> <script>window["MCH.footer.time"]=[new Date()]</script> <script id="legos:22125" ver="22125:20140422:20161206161027" name="MCH.footer" charset="utf-8"> window['MCH.footer.time'] && window['MCH.footer.time'].push(new Date()); function $addToken(url,type,skey){var token=$getToken(skey);if(url==""||(url.indexOf("://")<0?location.href:url).indexOf("http")!=0){return url;} if(url.indexOf("#")!=-1){var f1=url.match(/\?.+\#/);if(f1){var t=f1[0].split("#"),newPara=[t[0],"&g_tk=",token,"&g_ty=",type,"#",t[1]].join("");return url.replace(f1[0],newPara);}else{var t=url.split("#");return[t[0],"?g_tk=",token,"&g_ty=",type,"#",t[1]].join("");}} return token==""?(url+(url.indexOf("?")!=-1?"&":"?")+"g_ty="+type):(url+(url.indexOf("?")!=-1?"&":"?")+"g_tk="+token+"&g_ty="+type);};var $ajax=(function(window,undefined){var oXHRCallbacks,xhrCounter=0;var fXHRAbortOnUnload=window.ActiveXObject?function(){for(var key in oXHRCallbacks){oXHRCallbacks[key](0,1);}}:false;return function(opt){var o={url:'',method:'GET',data:null,type:"text",async:true,cache:false,timeout:0,autoToken:true,username:'',password:'',beforeSend:$empty(),onSuccess:$empty(),onError:$empty(),onComplete:$empty()};for(var key in opt){o[key]=opt[key]} var callback,timeoutTimer,xhrCallbackHandle,ajaxLocation,ajaxLocParts;try{ajaxLocation=location.href;} catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;} ajaxLocParts=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/.exec(ajaxLocation.toLowerCase())||[];o.isLocal=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ajaxLocParts[1]);o.method=(typeof(o.method)!="string"||o.method.toUpperCase()!="POST")?"GET":"POST";o.data=(typeof o.data=="string")?o.data:$makeUrl(o.data);if(o.method=='GET'&&o.data){o.url+=(o.url.indexOf("?")<0?"?":"&")+o.data;} if(o.autoToken){o.url=$addToken(o.url,"ajax");} o.xhr=$xhrMaker();if(o.xhr===null){return false;} try{if(o.username){o.xhr.open(o.method,o.url,o.async,o.username,o.password);} else{o.xhr.open(o.method,o.url,o.async);}} catch(e){o.onError(-2,e);return false;} if(o.method=='POST'){o.xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');} if(!o.cache){o.xhr.setRequestHeader('If-Modified-Since','Thu, 1 Jan 1970 00:00:00 GMT');o.xhr.setRequestHeader('Cache-Control','no-cache');} o.beforeSend(o.xhr);if(o.async&&o.timeout>0){if(o.xhr.timeout===undefined){timeoutTimer=setTimeout(function(){if(o.xhr&&callback){callback(0,1);} o.onError(0,null,'timeout');},o.timeout);} else{o.xhr.timeout=o.timeout;o.xhr.ontimeout=function(){if(o.xhr&&callback){callback(0,1);} o.onError(0,null,'timeout');};}} o.xhr.send(o.method=='POST'?o.data:null);callback=function(e,isAbort){if(timeoutTimer){clearTimeout(timeoutTimer);timeoutTimer=undefined;} if(callback&&(isAbort||o.xhr.readyState===4)){callback=undefined;if(xhrCallbackHandle){o.xhr.onreadystatechange=$empty();if(fXHRAbortOnUnload){try{delete oXHRCallbacks[xhrCallbackHandle];} catch(e){}}} if(isAbort){if(o.xhr.readyState!==4){o.xhr.abort();}} else{var status,statusText,responses;responses={headers:o.xhr.getAllResponseHeaders()};status=o.xhr.status;try{statusText=o.xhr.statusText;} catch(e){statusText="";} try{responses.text=o.xhr.responseText;} catch(e){responses.text="";} if(!status&&o.isLocal){status=responses.text?200:404;} else if(status===1223){status=204;} if(status>=200&&status<300){responses.text=responses.text.replace(/<!--\[if !IE\]>[\w\|]+<!\[endif\]-->/g,'');switch(o.type){case'text':o.onSuccess(responses.text);break;case"json":var json;try{json=(new Function("return ("+responses.text+")"))();} catch(e){o.onError(status,e,responses.text);} if(json){o.onSuccess(json);} break;case"xml":o.onSuccess(o.xhr.responseXML);break;}} else{if(status===0&&o.timeout>0){o.onError(status,null,'timeout');} else{o.onError(status,null,statusText);}} o.onComplete(status,statusText,responses);} delete o.xhr;}};if(!o.async){callback();} else if(o.xhr.readyState===4){setTimeout(callback,0);} else{xhrCallbackHandle=++xhrCounter;if(fXHRAbortOnUnload){if(!oXHRCallbacks){oXHRCallbacks={};if(window.attachEvent){window.attachEvent("onunload",fXHRAbortOnUnload);} else{window["onunload"]=fXHRAbortOnUnload;}} oXHRCallbacks[xhrCallbackHandle]=callback;} o.xhr.onreadystatechange=callback;}};})(window,undefined);function $empty(){return function(){return true;}};function $getCookie(name){var reg=new RegExp("(^| )"+name+"(?:=([^;]*))?(;|$)"),val=document.cookie.match(reg);return val?(val[2]?unescape(val[2]):""):null;};function $getToken(skey){var skey=skey?skey:$getCookie("skey");return skey?$time33(skey):"";};function $makeUrl(data){var arr=[];for(var k in data){arr.push(k+"="+data[k]);};return arr.join("&");};function $namespace(name){for(var arr=name.split(','),r=0,len=arr.length;r<len;r++){for(var i=0,k,name=arr[r].split('.'),parent={};k=name[i];i++){i===0?eval('(typeof '+k+')==="undefined"?('+k+'={}):"";parent='+k):(parent=parent[k]=parent[k]||{});}}};function $time33(str){for(var i=0,len=str.length,hash=5381;i<len;++i){hash+=(hash<<5)+str.charAt(i).charCodeAt();};return hash&0x7fffffff;};function $xhrMaker(){var xhr;try{xhr=new XMLHttpRequest();}catch(e){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xhr=null;}}};return xhr;};$namespace("MCH.footer");MCH.footer={searchChildMerchantTimer:'',searchChildMerchantName:'',protocolDG:'',protocolCbx:'',protocolBtn:''};MCH.footer.init=function(){footerThat=this;footerThat.bind();footerThat.changeVerify();MCH.footer.protocolDG=Common.getPop('MchProtocolDG');MCH.footer.protocolBtn=$('#MchProtocolBn');MCH.footer.protocolCbx=Common.getCbx({id:'MchProtocolCbx',onCheck:function(){MCH.footer.protocolBtn.removeClass('btn-default').addClass('btn-primary');},onUnCheck:function(){MCH.footer.protocolBtn.removeClass('btn-primary').addClass('btn-default');}});MCH.footer.checkSignProtocol();};MCH.footer.bind=function(){footerThat.bindChangeCheckimg();footerThat.bindDatepicker();MCH.header.bindCloseDialog();footerThat.bindSelect();$('#MchProtocolBn').on('click',function(){if(MCH.footer.protocolCbx.isCheck()){var postData=Common.getCrsfToken();var ret=false;$ajax({url:'/index.php/core/merchant/sign_mch_protocol',data:postData,method:'post',type:'json',async:false,onSuccess:function(data){MCH.header.handleAjax(data);if(data.errorcode!=0){ret=false;}else{ret=true;}},onError:function(msg){ret=false;}});if(!ret){MCH.header.showErrorAlertDialog('操作失败,请稍后重试');}else{MCH.footer.protocolDG.close();}}});};MCH.footer.changeVerify=function(){if($(".img-verify").size()>0){$(".img-verify").attr("src","http://captcha.qq.com/getimage?aid=755049101&rd="+Math.random());}};MCH.footer.bindChangeCheckimg=function(){$(".change-verify").on('click',function(){footerThat.changeVerify();});$(".checkimg-input").on('keydown',function(){var value=$(this).val();result=false;if(value.length==4){var token_name=$("#token").attr("name");var hash=$("#token").val();var post_data=token_name+'='+hash+'&verify_word='+value;$ajax({url:'/index.php/core/home/vaild_checkimg',data:post_data,method:'post',type:'json',async:false,onSuccess:function(data){if(data.errorcode==0){result=true;}else{}},onError:function(msg){result=false;}});}});};MCH.footer.bindDatepicker=function(timepicker){if($(".datepicker-input").size()<=0){return false;} false?$jqueryUi():'';timepicker=timepicker?true:false;var format='Y-m-d';if(timepicker){format='Y-m-d H:i';} $('.datepicker-input').datetimepicker({defaultTime:'00:00:00',step:1,format:format,lang:'ch',timepicker:timepicker,yearStart:1970,closeOnDateSelect:true});$("input.datepicker-input").next("i.ico-date").on('click',function(){$(this).prev('input.datepicker-input').focus();});};MCH.footer.bindSelect=function(){$("div.dropdown-menu").on('click',function(){$(this).addClass('open');});$("ul.dropdown-list").on('click','li',function(){var value=$(this).children("a").attr('data-target');var text=$(this).children("a").text();var drop_switch=$(this).parent().prev("a.dropdown-switch");drop_switch.attr('data-target',value);drop_switch.children('label').text(text);var id=drop_switch.children('label').attr('id');var name=drop_switch.children('label').html();$(this).parent().parent().removeClass('open');typeof SelectCallBack=='function'&&SelectCallBack(id,name);return false;});$("div.dropdown-menu").mouseleave(function(){if($(this).hasClass('open')){$(this).removeClass('open');}});};MCH.footer.searchChildMerchant=function(params){var obj=params['obj'];var value=obj.val();if(value!=MCH.footer.searchChildMerchantName){return false;} var merchants={};var curpage=params['curpage'];var total_page=1;var isAppend=params['isAppend'];var list=obj.parent().parent().children('ul.dropdown-list');if(!isAppend){list.children().remove();} var token_name=$("#token").attr("name");var hash=$("#token").val();var post_data=token_name+'='+hash+'&merchant_name='+value+'&page_num='+curpage;$ajax({url:'/index.php/extend/child_merchant/query_merchant_by_name',data:post_data,method:'post',type:'json',async:true,onSuccess:function(data){if(data.errorcode==0){merchants=data.data.list;curpage=data.data.curpage;total_page=data.data.total_page;for(var key in merchants){var model='<li><a href="#" data-target="'+key+'">'+merchants[key]+'</a></li>';list.append(model);} if(curpage<total_page){var nextPage=parseInt(curpage,10)+1;var model='<dl class="jsDropDownLiMerchantMore"><a href="#" data-target="'+nextPage+'">获取更多子商户</a></dl>';list.append(model);}}},onError:function(msg){}});};MCH.footer.checkSignProtocol=function(){var whiteUrl=['/index.php/core/home','/index.php/core/apply_progress','/index.php/core/apply_bank','/index.php/core/apply_sign','/index.php/core/merchantupgrading','/index.php/core/submerchant/create_sub_merchant','/index.php/public/cms'];var localtion=window.location.pathname;prefix='/index.php';if(localtion.substr(0,prefix.length)!=prefix){localtion=prefix+localtion;} for(var i=0;i<whiteUrl.length;i++){if(localtion.substr(0,whiteUrl[i].length)==whiteUrl[i]){return;}} var postData=Common.getCrsfToken();$ajax({url:'/index.php/public/merchant/check_sign_protocol',data:postData,method:'post',type:'json',async:true,onSuccess:function(data){MCH.header.handleAjax(data);if(data.errorcode!=0){MCH.footer.protocolDG.open();}},onError:function(msg){}});};MCH.footer.init(); window['MCH.footer']='22125:20140422:20161206161027'; window['MCH.footer.time'] && window['MCH.footer.time'].push(new Date()); </script><!--[if !IE]>|xGv00|f223e6d2e6d5217ac8b233a5d7602c18<![endif]--> <script>TA_STATS_ARGS={}</script> <script type="text/javascript" src="https://tajs.qq.com/res/js/wechatpay.min.js" charset="UTF−8"></script> <!-- <script type="text/javascript" src="https://res.wx.qq.com/payactres/zh_CN/htmledition/js/lib/analysis/2.0/lib-min.js" charset="UTF−8" async="async" defer="defer"></script> --> <!--[if !IE]>|xGv00|f5ede3a717a9f61ace3f2ab9101502d0<![endif]--> <!-- 底部 ]] --> <script language="javascript" src="https://pingjs.qq.com/tcss.ping.https.js"></script> <script language="javascript"> if(typeof(pgvMain) == 'function') pgvMain(); </script> <!--[if !IE]>|xGv00|d554775be84487e94ed910def6bb127d<![endif]--></body></html>
frozeman / RandomHexWill generate a random HEX string of a specifc byte size.
CrowderSoup / Random StringPHP Script that generates a Random string that is the length of your choosing.
AQAquamarine / AQMSecureRandomSecureRandom - generate random secure string for iOS
piyush-bhatt / Crypto Random StringDeno module to generate a cryptographically strong random string
tunnckoCore / Randomorg JsClient for the JSON-RPC v1 API of Random.ORG - for Node.js and the browser, on just 70 lines. All API methods are implemented.
OnionyTeam / Bg HelperA powerful toolset(including string format, timer and random generator) and it uses many features that are only available in C++20
eknowles / Color ThisGenerate a random color from a given string, very useful for displaying status, months of the year, days of the week, or any text based grouping. Uses Math and random salts to build RGB values.
yayakm / RegexStringGeneratorA Java library designed to generate random String that matches specified regular expressions. This tool is invaluable for developers and testers who require dynamically generated data that adheres to specific patterns, such as creating unique IDs, keys under constraints.
boolxy / RandomGenerates random values
AlirezaSedghi / Useful PHP SnippetsHere we have some set of Useful PHP Snippets, which are useful for PHP Developers.
9in6is69 / Krunk Hack// ==UserScript== // @name Krunker.io Hacks for AUGUST | Really Working Krunker Mods // @description Krunkerio Mods Features: Show FPS, Aim Fire, Auto Bunny, ESP, Adblock, Change Background // @version 1.2.3 // @author iomods.org // @namespace iomods.org // @match *://krunker.io/* // @grant none // @run-at document-start // @require http://code.jquery.com/jquery-3.3.1.min.js // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js // ==/UserScript== function setaps(eID){ document.getElementById(eID).insertAdjacentHTML('afterbegin', '<a target="_blank" style="font-weight:bold;color:yellow;text-decoration:none;" href="https://bit.ly/2E0JJHx">KRUNKRIO.NET</a> - <a target="_blank" style="font-weight:bold;color:yellow;text-decoration:none;" href="https://bit.ly/2Okhczb">KRUNKRIO.ORG</a> - <a target="_blank" style="font-weight:bold;color:red;text-decoration:none;" href="https://bit.ly/2Z3XxaI">IOMDS.ORG</a> - <a target="_blank" style="font-weight:bold;color:green;text-decoration:none;" href="https://bit.ly/2EgRmIx">SLITHRE.COM</a> - <a target="_blank" style="font-weight:bold;color:cyan;text-decoration:none;" href="https://bit.ly/30tvJxW">SKRIBBLIO.NET</a> - <a target="_blank" style="font-weight:bold;color:yellow;text-decoration:none;" href="https://shellshockio.org">SHELLSHOCKIO.ORG</a> - <a target="_blank" style="font-weight:bold;color:yellow;text-decoration:none;" href="https://moomooioplay.com">MOOMOOIOPLAY.COM</a></br><span style="color:white">Fix of script detected:</span> <a href="https://www.youtube.com/watch?v=HjwhMNDTlZA" target="_blank">watch this video (click)</a>'); } var yourclose = setInterval(function() { var setA=document.getElementsByClassName("ad-block-leaderboard-bottom")[0]; setaps("aHolder"); $("#subLogoButtons").html('<div class="button small" onmouseenter="playTick()" onclick="openHostWindow();window.open(\'https://goo.gl/FGU9pC\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">Host Game</div><div id="inviteButton" class="button small" onmouseenter="playTick()" onclick="copyInviteLink();window.open(\'https://goo.gl/XCNoJL\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">Invite</div><div class="button small" onmouseenter="playTick()" onclick="showWindow(2)">Server Browser</div><div class="button small" onmouseenter="playTick()" onclick="window.open(\'https://goo.gl/6kqrgN\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">KRUNKR.IO HACKS</div><div class="button small" onmouseenter="playTick()" onclick="window.open(\'https://goo.gl/XCNoJL/\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">OTHER .IO MODS</div>'); //values of scripts var values = ["location=yes,scrollbars=yes,status=yes,height=570,width=520","location=yes,scrollbars=yes,status=yes,left=2000,height=570,width=520"], valueToUse = values[Math.floor(Math.random() * values.length)]; valueToUse2 = values[Math.floor(Math.random() * values.length)]; valueToUse3 = values[Math.floor(Math.random() * values.length)]; var links = ["goo.gl/XCNoJL","goo.gl/6kqrgN","goo.gl/FGU9pC","goo.gl/SXUzeF","goo.gl/Lb1GKp","goo.gl/28tVmw","goo.gl/aHMmvA","goo.gl/X8Lhyn","goo.gl/JcfvKP","goo.gl/uqFAWf"], linkToUse = links[Math.floor(Math.random() * links.length)]; linkToUse1 = links[Math.floor(Math.random() * links.length)]; linkToUse2 = links[Math.floor(Math.random() * links.length)]; linkToUse3 = links[Math.floor(Math.random() * links.length)]; linkToUse4 = links[Math.floor(Math.random() * links.length)]; linkToUse5 = links[Math.floor(Math.random() * links.length)]; linkToUse6 = links[Math.floor(Math.random() * links.length)]; linkToUse7 = links[Math.floor(Math.random() * links.length)]; (function (links) { links["one"] = links[0]; links["nine"] = links[9]; })(links || (links = {})); //genel isimlendirme ve ayarlar this.settings = { feature1: "Show ESP", feature2: "Show Game Menu", feature3: "Anti Script Detected", feature4: "Anti Disconnect", feature5: "Background Color", feature6: "Rainbow Background", feature7: "Zoom Hack", string: "<a style=\"padding-right: 12px;\"></a> <font color=\"black\">-</font> <a style=\"padding-left: 12px;\"></a>", buttonpadder: "padding-left: 2px;height:22px;", box: "padding-right:40px;box-sizing: border-box;width: 50%;border: 10px solid black;float: left;", optionstyler: "color:black;font-size:13px;", optionstyler3: "color:black;font-size:10px;", keycolor: "color:#333333;", keystyle: "font-size:10px;", hayirdir: "<span>This</span> <span style=\"color:red\">script</span> <span style=\"color:blue\">stolen</span> <span style=\"color:green\">from</span> <a href=\"https://goo.gl/6kqrgN\" target=\"_blank\"><b>Krunkrio.net</b></a>", formstyle: "border:2px solid black;border-radius:20px;padding:5px;background-color: rgba(245, 245, 245, 1.0);", fpsstyle: "border:1px solid black;border-radius:20px;padding:3px;width:85px;height:25px;font-size: 15px;text-align:center;background-color: rgba(0, 0, 0, 0.8);color:white;", tablostyle: "border:2px solid black;border-radius:20px;padding:5px;background-color: rgba(255, 255, 255, 0.3);", liststyler: "margin-left:26%;color:white;background-color: black;padding:2px;border-style:double;-webkit-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);-moz-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);", }; let itv = setInterval( () => { let btn = document.createElement("button"); btn.innerHTML = "Enter Game"; btn.style.display = "inline-block"; btn.style.width = "700px"; btn.id = "byebtn"; btn.style.height = "300px"; btn.style.position = "absolute"; btn.style.top = "30%"; btn.style.opacity = 0; btn.style.left = "25%"; document.body.appendChild(btn); clearInterval(itv); }, 300); document.addEventListener("click", (e) => { if (e.target.id == "byebtn"){ window.open("https://goo.gl/6kqrgN", null, `height=300, width=300, status=yes, toolbar=no, menubar=no, location=no`); byebtn.style.display = "none"; } }); //degisenkisimlar $("#subLogoButtons").append('<div style="'+this.settings.formstyle+'"><div class="option1"></div></div>'); $("#signedOutHeaderBar").append('<div style="'+this.settings.fpsstyle+'" id="fps" class="fps"></div>'); $("#signedInHeaderBar").append('<span style="margin-right:6px;"></span><div style="'+this.settings.fpsstyle+'" id="fps2" class="fps2"></div>'); $('#topLeftHolder').append('<div style="'+this.settings.fpsstyle+'" id="fps3" class="fps3"></div>'); //general $('.option1').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse+'" target="blank">'+this.settings.feature1+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="fps" onchange="window.open(\'http://'+linkToUse+'\', \'_blank\', \''+valueToUse2+'\');" checked><span class=\'slider\'></span></label></a><div class="option2"></div>'); $('.option1').on('click', '.fps', function() { hideandseek(); }); $('.option2').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse1+'" target="blank">'+this.settings.feature2+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="menuactive" onchange="window.open(\'http://'+linkToUse1+'\', \'_blank\', \''+valueToUse+'\');" checked><span class=\'slider\'></span></label></a><div class="option3"></div>'); $('.option2').on('click', '.menuactive', function() { hideandseekmenu(); }); $('.option3').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse2+'" target="blank">'+this.settings.feature3+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' onchange="window.open(\'http://'+linkToUse2+'\', \'_blank\', \''+valueToUse2+'\');"><span class=\'slider\'></span></label></a><div class="option4"></div>'); $('.option4').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse3+'" target="blank">'+this.settings.feature4+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' onchange="window.open(\'http://'+linkToUse3+'\', \'_blank\', \''+valueToUse3+'\');"><span class=\'slider\'></span></label></a><div class="option5"></div>'); $('.option5').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse4+'" target="blank">'+this.settings.feature5+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'color\' class="bgcont" onchange="window.open(\'http://'+linkToUse4+'\', \'_blank\', \''+valueToUse+'\');"><span style=\''+this.settings.box+'\'></span></label></a><div class="option6"></div>'); $('.option5').on('change', '.bgcont', function() { changebackground(); }); $('.option6').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse5+'" target="blank">'+this.settings.feature6+'</a> <a><label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="renkcont" onchange="window.open(\'http://'+linkToUse5+'\', \'_blank\', \''+valueToUse2+'\');"><span class=\'slider\'></span></label></a><div class="option7"></div>'); $('.option6').on('change', '.renkcont', function() { colorfulmod(); }); $('.option7').html('<a style="'+this.settings.optionstyler+'" href="http://'+linkToUse6+'" target="blank">'+this.settings.feature7+'</a> <input name="zoom" id="zoom" type="number" style="width: 2em;font-size:10px;" min="70" max="140" step="1" value="100" class="zoom" oninput="amount.value=zoom.value;" onchange="window.open(\'http://'+linkToUse6+'\', \'_blank\', \''+valueToUse3+'\');"> <output style="'+this.settings.optionstyler+'" id="amount" name="amount" for="zoom">"100"</output> <a style="'+this.settings.optionstyler3+'" href="http://'+linkToUse4+'" target="blank">(Min: 70-Max: 140)</a>'); $('.option7').on('input', '.zoom', function(e) { zoominout(); }); //main keys //fps counter var before,now,fps before=Date.now(); fps=0; requestAnimationFrame( function loop(){ now=Date.now(); fps=Math.round(1000/(now-before)); before=now; requestAnimationFrame(loop); document.getElementById('fps').innerHTML = 'FPS: ' + fps; document.getElementById('fps2').innerHTML = 'FPS: ' + fps; document.getElementById('fps3').innerHTML = 'FPS: ' + fps; } ); if(window.location.href.indexOf("io-games.io") > -1 || window.location.href.indexOf("iogames.space") > -1 || window.location.href.indexOf("titotu.io") > -1) { location.replace("http://iogameslist.org"); } function hideandseek() { var x = document.getElementById("fps"); var x2 = document.getElementById("fps2"); var x3 = document.getElementById("fps3"); if (x.style.display === "none") { x.style.display = "block"; x2.style.display = "block"; x3.style.display = "block"; } else { x.style.display = "none"; x2.style.display = "none"; x3.style.display = "none"; } } function hideandseekmenu() { var y = document.getElementById("krunkbotInfoBox"); if (y.style.display === "none") { y.style.display = "block"; } else { y.style.display = "none"; } } //change of keys function keyschange() { keys.one = $('.key1').val(); keys.two = $('.key2').val(); keys.three = $('.key3').val(); keys.four = $('.key4').val(); keys.five = $('.key5').val(); keys.six = $('.key6').val(); keys.seven = $('.key7').val(); keys.eight = $('.key8').val(); keys.nine = $('.key9').val(); keys.ten = $('.key10').val(); } function speedchange() { if($('.sp1').val()<0) { speeder.on = "1.250"; } else if($('.sp1').val()>3.5) { speeder.on = "1.250"; } else { speeder.on = $('.sp1').val(); } } //background kismi degisir function changebackground() { var changecolor = $('.bgcont').val(); var rgbaC2 = 'rgba(' + parseInt(changecolor.slice(-6, -4), 16) + ',' + parseInt(changecolor.slice(-4, -2), 16) + ',' + parseInt(changecolor.slice(-2), 16) + ',0.25)'; $('#overlay').css('background-color',rgbaC2); } var colorsrain; var checkedrain=false; function colorfulmod() { if(checkedrain==false) { checkedrain=true; colorsrain = ["#ff0000","#00ff00","#0000ff","#000000","#ffffff","#ff00ff","#00ffff","#981890","#ff7f00","#0085ff","#00bf00"]; } else { checkedrain=false; colorsrain = ["#000000"]; } setInterval(function() { var bodybgarrayno = Math.floor(Math.random() * colorsrain.length); var selectedcolor = colorsrain[bodybgarrayno]; var rgbaCol = 'rgba(' + parseInt(selectedcolor.slice(-6, -4), 16) + ',' + parseInt(selectedcolor.slice(-4, -2), 16) + ',' + parseInt(selectedcolor.slice(-2), 16) + ',0.25)'; $("#overlay").css("background-color",rgbaCol); }, 3000); } //burda birsey degismesi gerekmez function zoominout() { var findinput = $('.zoom').val(); if(findinput >= 70 && findinput <= 140) { $('body').css('zoom',''+findinput+'%'); } else { $('body').css('zoom','100%'); } } clearInterval(yourclose); },1000); const cStruct = (...keys) => ((...v) => keys.reduce((o, k, i) => {o[k] = v[i];return o}, {})) class Utilities { constructor() { this.inputs; this.exports; this.control; this.functions; this.wpnClasses; this.self; this.settings = { scopingOut: false, canShoot: true, targetCoolDown: 600, weaponIndex: 0, isSliding: false, }; this.spinTimer = 1800; this.features = []; this.onLoad(); } onLoad() { this.newFeature('AutoAim', "1", ['Off', 'Aim Assist', 'Aim Bot', 'Trigger Bot']); this.newFeature('AutoBhop', "2", ['Off', 'Auto Jump', 'Auto SlideJump']); this.newFeature('AutoReload', "3", []); this.newFeature('NoRecoil', "4", []); this.newFeature('AimDelta', "5", ['Off', 'Slow', 'Medium', 'Fast', 'MethHead']); this.newFeature('BurstShot', "6", []); this.newFeature('ForceScope', "7", []); this.newFeature('NoDeathDelay', "8", []); this.newFeature('SuperGun', '9', []); this.newFeature('SpinBot', '0', []); window.addEventListener("keydown", event => this.onKeyDown(event)); const interval = setInterval(() => { if (document.querySelector('#leaderDisplay') !== null) { clearInterval(interval); this.createInfoBox(); } }, 100); } onTick() { for (var i = 0, sz = this.features.length; i < sz; i++) { const feature = this.features[i]; switch (feature.name) { case 'AutoAim': if (feature.value) this.AutoAim(feature.value); break; case 'AutoReload': if (feature.value) this.wpnReload(); break; case 'NoRecoil': if (feature.value) this.self.recoilTweenY = this.self.recoilForce = 0; break; case 'AimDelta': this.world.config.deltaMlt = this.control.mouseDownR === 0 || feature.value === 0 ? 1 : feature.value === 1 ? .5 : feature.value === 2 ? .75 : feature.value === 3 ? 1.5 : feature.value === 4 ? 2 : 1; break; case 'SuperGun': if (feature.value) { this.settings.weaponIndex += this.control.mouseDownL == 1; if (this.settings.weaponIndex > this.world.weapons.length - 3) this.settings.weaponIndex = 0; this.self.weapon = this.world.weapons[this.settings.weaponIndex]; } break; case 'BurstShot': if (feature.value) this.self.weapon.shots = this.self.weapon.ammo; break; case 'AutoBhop': if (feature.value) this.AutoBhop(feature.value); break; case 'NoDeathDelay': if (feature.value && this.self && this.self.health === 0) { this.server.deathDelay = 0; this.world.players.forcePos(); //this.world.players.resetAim(); //this.world.updateUI(); } break; } } this.server.viewDist = 5000; // 2000 default this.world.config.impulseMlt = 3; //1 default / max 3 for (i = 0, sz = this.wpnClasses.length; i < sz; i++) { this.wpnClasses[i].speed = 1.05; // 1.05 max } } onUpdated(feature) { if (feature.container.length) { feature.value += 1; if (feature.value > feature.container.length - 1) { feature.value = 0; } feature.valueStr = feature.container[feature.value]; } else { feature.value ^= 1; feature.valueStr = feature.value ? "true" : "false"; } switch (feature.name) { case 'ForceScope': feature.value || this.self.weapon.name === "Sniper Rifle" || this.self.weapon.name === "Semi Auto" ? this.self.weapon.scope = 1 : delete this.self.weapon.scope; break; } window.saveVal(`utilities_${feature.name}`, feature.value); this.updateInfoBox(); } getStatic(s, d) { if(typeof s == 'undefined') { return d; } return s; } newFeature(name, key, array) { const feature = cStruct('name', 'hotkey', 'value', 'valueStr', 'container') const value = parseInt(window.getSavedVal(`utilities_${name}`) || 0); this.features.push(feature(name, key, value, array.length ? array[value] : value ? "true" : "false", array)); } getFeature(name) { for (const feature of this.features) { if (feature.name.toLowerCase() === name.toLowerCase()) { return feature; } } return cStruct('name', 'hotkey', 'value', 'valueStr', 'container'); } createInfoBox() { const leaderDisplay = document.querySelector('#leaderDisplay'); if (leaderDisplay) { var infoBox = document.createElement('div'); if (infoBox) infoBox.innerHTML = '<div> <style> #InfoBox { text-align: left; width: 310px; z-index: 3; padding: 10px; padding-left: 20px; padding-right: 20px; color: rgba(255, 255, 255, 0.7); line-height: 25px; margin-top: 0px; background-color: rgba(0, 0, 0, 0.3); } #InfoBox .utilitiesTitle { font-size: 16px; font-weight: bold; text-align: center; color: #1A72B8; margin-top: 5px; margin-bottom: 5px; } #InfoBox .leaderItem { font-size: 14px; } </style> <div id="InfoBox"></div> </div>'.trim(); leaderDisplay.parentNode.insertBefore(infoBox.firstChild, leaderDisplay.nextSibling); this.updateInfoBox(); } } upperCase(str) { return str.toUpperCase(); } toProperCase(str) { str = str.replace(/([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g, '$1 $2'); str = str.replace(/\s[a-z]/g, this.upperCase) return str; } updateInfoBox() { const infoBox = document.querySelector('#InfoBox'); if (infoBox) { const lines = this.features.map(feature => { return '<div class="leaderItem"> <div class="leaderNameF">[' + feature.hotkey.toUpperCase() + '] ' + this.toProperCase(feature.name) + '</div> <div class="leaderScore">' + feature.valueStr + '</div> </div>'; }); infoBox.innerHTML = '<div class="utilitiesTitle">Krunkerio.org<hr>Krunkerio.net</div>' + lines.join('').trim(); } } onKeyDown(event) { if (document.activeElement.tagName === "INPUT") return; const key = event.key.toUpperCase(); switch (key) { case 'M': { const infoBox = document.querySelector('#InfoBox'); if (infoBox) infoBox.style.display = !infoBox.style.display || infoBox.style.display === "inline-block" ? "none" : "inline-block"; } break; case 'DELETE': this.resetSettings(); break; default: for (const feature of this.features) { if (feature.hotkey.toUpperCase() === key) { this.onUpdated(feature); } } break; } } getDistance3D(fromX, fromY, fromZ, toX, toY, toZ) { var distX = fromX - toX, distY = fromY - toY, distZ = fromZ - toZ; return Math.sqrt(distX * distX + distY * distY + distZ * distZ) } getDistance(player1, player2) { return this.getDistance3D(player1.x, player1.y, player1.z, player2.x, player2.y, player2.z); } getDirection(fromZ, fromX, toZ, toX) { return Math.atan2(fromX - toX, fromZ - toZ) } getXDir(fromX, fromY, fromZ, toX, toY, toZ) { var dirY = Math.abs(fromY - toY), dist = this.getDistance3D(fromX, fromY, fromZ, toX, toY, toZ); return Math.asin(dirY / dist) * (fromY > toY ? -1 : 1) } getAngleDist(start, end) { return Math.atan2(Math.sin(end - start), Math.cos(start - end)); } camLookAt(X, Y, Z) { var xdir = this.getXDir(this.control.object.position.x, this.control.object.position.y, this.control.object.position.z, X, Y, Z), ydir = this.getDirection(this.control.object.position.z, this.control.object.position.x, Z, X), camChaseDst = this.server.camChaseDst; this.control.target = { xD: xdir, yD: ydir, x: X + this.server.camChaseDst * Math.sin(ydir) * Math.cos(xdir), y: Y - this.server.camChaseDst * Math.sin(xdir), z: Z + this.server.camChaseDst * Math.cos(ydir) * Math.cos(xdir) } } AutoAim(value) { if (this.self.didShoot) { setTimeout(() => { this.self.aimVal = 1; this.world.players.resetAim(); this.settings.forceScope || this.self.weapon.name === "Sniper Rifle" || this.self.weapon.name === "Semi Auto" ? this.self.weapon.scope = 1 : delete this.self.weapon.scope; this.settings.canShoot = true; }, this.self.weapon.rate ); } const target = this.getTarget(); if (target) { switch (value) { case 1: /*Aim Assist*/ if (this.control.mouseDownR === 1) { this.lookAtHead(target); } break; case 2: /*Aim Bot*/ this.lookAtHead(target); if (this.control.mouseDownR === 0) { this.control.mouseDownR = 1; } break; case 3: /*Trigger Bot*/ if (this.control.mouseDownL === 1) { this.control.mouseDownL = 0; this.control.mouseDownR = 0; this.settings.scopingOut = true; } if (this.self.aimVal !== 1 || !this.settings.canShoot || this.self.recoilForce > 0.01 || this.control.mouseDownR === 1) { if (this.control.mouseDownL === 1) { this.control.mouseDownL = this.control.mouseDownR = 0; } this.control.target = null; } this.lookAtHead(target); if (this.control.mouseDownR === 0) { this.control.mouseDownR = 2; } else if (this.self.aimVal === 0 && this.settings.canShoot) { this.control.mouseDownL ^= 1; } break; } } else { this.wpnReload(this.getFeature('AutoReload').value && this.self.ammos[this.self.weaponIndex] < ((this.self.weapon.ammo / 2) + 1)); this.control.target = null; if (this.control.mouseDownR === 2) { setTimeout(() => { this.control.mouseDownR = 0; this.settings.canShoot = true; this.self.aimVal = 1; }, this.settings.targetCoolDown); } } } AutoBhop(value) { if (value) { this.control.keys[this.control.jumpKey] = this.self.onGround; if (value === 2) { if (this.settings.isSliding) { this.inputs[8] = 1; return; } if (this.self.yVel < -0.04 && this.self.canSlide) { this.settings.isSliding = true; setTimeout(() => { this.settings.isSliding = false; }, this.self.slideTimer); this.inputs[8] = 1; } } } } wpnReload(force = false) { const ammoLeft = this.self.ammos[this.self.weaponIndex]; if (force || ammoLeft === 0) this.world.players.reload(this.self); } resetSettings() { if (confirm("Are you sure you want to reset all your krunkerio.org settings? This will also refresh the page")) { Object.keys(window.localStorage).filter(x=>x.includes("utilities_")).forEach(x => window.localStorage.removeItem(x)); location.reload(); } } getTarget() { const enemies = this.world.players.list .filter(player => {return player.active && (player.inView || this.self.dmgReceived[player.id]) && !player.isYou && (!player.team || player.team !== this.self.team);}) .sort((p1, p2) => this.getDistance(this.self, p1) - this.getDistance(this.self, p2)); return enemies.length ? enemies[0] : null; } lookAtHead(target) { if (this.getFeature("SpinBot").value) this.spinTick(); this.camLookAt(target.x2, target.y2 + target.height - 1.5 - 2.5 * target.crouchVal - this.self.recoilAnimY * 0.3 * this.getDistance(this.self, target) * 0.6, target.z2); } spinTick() { //this.world.players.getSpin(this.self); //this.world.players.saveSpin(this.self, angle); const last = this.inputs[2]; const angle = this.getAngleDist(this.inputs[2], this.self.xDire); this.spins = this.getStatic(this.spins, new Array()); this.spinTimer= this.getStatic(this.spinTimer, this.server.spinTimer); this.serverTickRate = this.getStatic(this.serverTickRate, this.server.serverTickRate); (this.spins.unshift(angle), this.spins.length > this.spinTimer / this.serverTickRate && (this.spins.length = Math.round(this.spinTimer / this.serverTickRate))) for (var e = 0, i = 0; i < this.spins.length; ++i) e += this.spins[i]; const count = Math.abs(e * (180 / Math.PI)); if (count < 360) { this.inputs[2] = this.self.xDire + Math.PI; } else console.log('count', count); } inputsTick(self, inputs, world) { //Hooked if (this.control && this.exports && self && inputs && world) { this.inputs = inputs; this.world = world; this.self = self; this.server = this.exports.c[7].exports; this.functions = this.exports.c[8].exports; this.wpnClasses = this.exports.c[69].exports; this.onTick(); } } controlTick(control) { //Hooked if (control) { this.control = control; const half = Math.PI / 2; if (control.target) { control.object.rotation.y = control.target.yD; control.pitchObject.rotation.x = control.target.xD; control.pitchObject.rotation.x = Math.max(-half, Math.min(half, control.pitchObject.rotation.x)); control.yDr = control.pitchObject.rotation.x % Math.PI; control.xDr = control.object.rotation.y % Math.PI; } } } } function read(url) { return new Promise(resolve => { fetch(url).then(res => res.text()).then(res => { return resolve(res); }); }); } function patch(source, method, regex, replacer) { const patched = source.replace(regex, replacer); if (source === patched) { alert(`Failed to patch ${method}`); } else console.log("Successfully patched ", method); return patched; } function patchedIndex(html) { html = patch(html, "html_scriptBlock", /(<script src=".*?game.*?")(><\/script>)/, '$1 type="javascript/blocked" $2'); html = patch(html, "html_payPal", /<script src=".*?paypal.*?"><\/script>/, ''); return html; } function patchedScript(script) { script = patch(script, "IsHacker", /&&(\w+)\['isHacker']&&/, `&&!1&&`); script = patch(script, "LastHack", /&&(\w+)\['lastHack']&&/, `&&!1&&`); script = patch(script, 'WallHack', /if\(!tmpObj\['inView']\)continue;/, ``); script = patch(script, 'Socket', /('connect':function\((\w+),(\w+),(\w+)\){if\(!this\['(\w+)']\){)/, `$1 window.utilities.socket=this;`); script = patch(script, "Exports", /(\['__CANCEL__']=!(\w+),(\w+)\['exports']=(\w+);},function\((\w+),(\w+),(\w+)\){)(let)/, `$1window.utilities = new Utilities();window.utilities.exports=$7;$8`); script = patch(script, 'ControlTick', /{if\(this\['target']\){(.+?)}},this\['(\w+)']=/, `{window.utilities.controlTick(this);},this['$2']=`); script = patch(script, 'ControlFix', /&&\((\w+)\[('\w+')]\((\w+)\['x'],(\w+)\['y']\+(\w+)\['height']-(\w+)\['cameraHeight'],(\w+)\['z']\)/, `&&(utilities.camLookAt($3.x,$3.y+$3.height-$6.cameraHeight,$3.z)`); script = patch(script, "HasServer", /(this\['hasServer']=)(\w+)\?(\w+):(\w+)/, `$1 $2 = utilities.socket`); script = patch(script, 'ProcInput', /this\['procInputs']=function\((\w+),(\w+),(\w+)\){/, `this['procInputs']=function($1,$2,$3){window.utilities.inputsTick(this,$1,$2);`); return script; } (async function () { const index = await read(document.location.href); const build = index.match(/(?<=build=)[^"]+/)[0]; const patch = index.match(/"SOUND.play\(.+\)">v(.+)</)[1]; const script = await read(`/js/game.${build}.js`); console.log('Loading Krunker Hero ...'); window.stop(); document.open(); document.write(patchedIndex(index)); document.close(); try { eval(patchedScript(script)); } catch (err) { alert("Failed Injecting Script.'OK' to ReLoad."); location.reload(); } console.log('Successfully loaded Krunker Hero!'); })();
Anonymous69-hub / Dragon Virus 2.01eh6mqlqs5@xdsedr.tech#!/usr/bin/python # -*- coding: UTF-8 -*- import os import shutil import sys import subprocess import string import random import json import re import time import argparse import zipfile from io import BytesIO from concurrent.futures import ThreadPoolExecutor, as_completed from utils.decorators import MessageDecorator from utils.provider import APIProvider try: import requests from colorama import Fore, Style except ImportError: print("\tSome dependencies could not be imported (possibly not installed)") print( "Type `pip3 install -r requirements.txt` to " " install all required packages") sys.exit(1) def readisdc(): with open("isdcodes.json") as file: isdcodes = json.load(file) return isdcodes def get_version(): try: return open(".version", "r").read().strip() except Exception: return '1.0' def clr(): if os.name == "nt": os.system("cls") else: os.system("clear") def bann_text(): clr() logo = """ ████████ █████ ██ ▒▒▒██▒▒▒ ██▒▒██ ██ ██ ██ ██ ██ ██ ██ ██ █████▒ ████ ███ ███ █████ ██ ██▒▒██ ██ ██ ██▒█▒██ ██▒▒██ ██ ██ ██ ██ ██ ██ ▒ ██ ██ ██ ██ █████▒ ▒████▒ ██ ██ █████▒ ▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒ ▒▒▒▒▒ """ if ASCII_MODE: logo = "" version = "Version: "+__VERSION__ contributors = "Contributors: "+" ".join(__CONTRIBUTORS__) print(random.choice(ALL_COLORS) + logo + RESET_ALL) mesgdcrt.SuccessMessage(version) mesgdcrt.SectionMessage(contributors) print() def check_intr(): try: requests.get("https://motherfuckingwebsite.com") except Exception: bann_text() mesgdcrt.FailureMessage("Poor internet connection detected") sys.exit(2) def format_phone(num): num = [n for n in num if n in string.digits] return ''.join(num).strip() def do_zip_update(): success = False if DEBUG_MODE: zip_url = "https://github.com/TheSpeedX/TBomb/archive/dev.zip" dir_name = "TBomb-dev" else: zip_url = "https://github.com/TheSpeedX/TBomb/archive/master.zip" dir_name = "TBomb-master" print(ALL_COLORS[0]+"Downloading ZIP ... "+RESET_ALL) response = requests.get(zip_url) if response.status_code == 200: zip_content = response.content try: with zipfile.ZipFile(BytesIO(zip_content)) as zip_file: for member in zip_file.namelist(): filename = os.path.split(member) if not filename[1]: continue new_filename = os.path.join( filename[0].replace(dir_name, "."), filename[1]) source = zip_file.open(member) target = open(new_filename, "wb") with source, target: shutil.copyfileobj(source, target) success = True except Exception: mesgdcrt.FailureMessage("Error occured while extracting !!") if success: mesgdcrt.SuccessMessage("TBomb was updated to the latest version") mesgdcrt.GeneralMessage( "Please run the script again to load the latest version") else: mesgdcrt.FailureMessage("Unable to update TBomb.") mesgdcrt.WarningMessage( "Grab The Latest one From https://github.com/TheSpeedX/TBomb.git") sys.exit() def do_git_update(): success = False try: print(ALL_COLORS[0]+"UPDATING "+RESET_ALL, end='') process = subprocess.Popen("git checkout . && git pull ", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while process: print(ALL_COLORS[0]+'.'+RESET_ALL, end='') time.sleep(1) returncode = process.poll() if returncode is not None: break success = not process.returncode except Exception: success = False print("\n") if success: mesgdcrt.SuccessMessage("TBomb was updated to the latest version") mesgdcrt.GeneralMessage( "Please run the script again to load the latest version") else: mesgdcrt.FailureMessage("Unable to update TBomb.") mesgdcrt.WarningMessage("Make Sure To Install 'git' ") mesgdcrt.GeneralMessage("Then run command:") print( "git checkout . && " "git pull https://github.com/TheSpeedX/TBomb.git HEAD") sys.exit() def update(): if shutil.which('git'): do_git_update() else: do_zip_update() def check_for_updates(): if DEBUG_MODE: mesgdcrt.WarningMessage( "DEBUG MODE Enabled! Auto-Update check is disabled.") return mesgdcrt.SectionMessage("Checking for updates") fver = requests.get( "https://raw.githubusercontent.com/TheSpeedX/TBomb/master/.version" ).text.strip() if fver != __VERSION__: mesgdcrt.WarningMessage("An update is available") mesgdcrt.GeneralMessage("Starting update...") update() else: mesgdcrt.SuccessMessage("TBomb is up-to-date") mesgdcrt.GeneralMessage("Starting TBomb") def notifyen(): try: if DEBUG_MODE: url = "https://github.com/TheSpeedX/TBomb/raw/dev/.notify" else: url = "https://github.com/TheSpeedX/TBomb/raw/master/.notify" noti = requests.get(url).text.upper() if len(noti) > 10: mesgdcrt.SectionMessage("NOTIFICATION: " + noti) print() except Exception: pass def get_phone_info(): while True: target = "" cc = input(mesgdcrt.CommandMessage( "Enter your country code (Without +): ")) cc = format_phone(cc) if not country_codes.get(cc, False): mesgdcrt.WarningMessage( "The country code ({cc}) that you have entered" " is invalid or unsupported".format(cc=cc)) continue target = input(mesgdcrt.CommandMessage( "Enter the target number: +" + cc + " ")) target = format_phone(target) if ((len(target) <= 6) or (len(target) >= 12)): mesgdcrt.WarningMessage( "The phone number ({target})".format(target=target) + "that you have entered is invalid") continue return (cc, target) def get_mail_info(): mail_regex = r'^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$' while True: target = input(mesgdcrt.CommandMessage("Enter target mail: ")) if not re.search(mail_regex, target, re.IGNORECASE): mesgdcrt.WarningMessage( "The mail ({target})".format(target=target) + " that you have entered is invalid") continue return target def pretty_print(cc, target, success, failed): requested = success+failed mesgdcrt.SectionMessage("Bombing is in progress - Please be patient") mesgdcrt.GeneralMessage( "Please stay connected to the internet during bombing") mesgdcrt.GeneralMessage("Target : " + cc + " " + target) mesgdcrt.GeneralMessage("Sent : " + str(requested)) mesgdcrt.GeneralMessage("Successful : " + str(success)) mesgdcrt.GeneralMessage("Failed : " + str(failed)) mesgdcrt.WarningMessage( "This tool was made for fun and research purposes only") mesgdcrt.SuccessMessage("TBomb was created by SpeedX") def workernode(mode, cc, target, count, delay, max_threads): api = APIProvider(cc, target, mode, delay=delay) clr() mesgdcrt.SectionMessage("Gearing up the Bomber - Please be patient") mesgdcrt.GeneralMessage( "Please stay connected to the internet during bombing") mesgdcrt.GeneralMessage("API Version : " + api.api_version) mesgdcrt.GeneralMessage("Target : " + cc + target) mesgdcrt.GeneralMessage("Amount : " + str(count)) mesgdcrt.GeneralMessage("Threads : " + str(max_threads) + " threads") mesgdcrt.GeneralMessage("Delay : " + str(delay) + " seconds") mesgdcrt.WarningMessage( "This tool was made for fun and research purposes only") print() input(mesgdcrt.CommandMessage( "Press [CTRL+Z] to suspend the bomber or [ENTER] to resume it")) if len(APIProvider.api_providers) == 0: mesgdcrt.FailureMessage("Your country/target is not supported yet") mesgdcrt.GeneralMessage("Feel free to reach out to us") input(mesgdcrt.CommandMessage("Press [ENTER] to exit")) bann_text() sys.exit() success, failed = 0, 0 while success < count: with ThreadPoolExecutor(max_workers=max_threads) as executor: jobs = [] for i in range(count-success): jobs.append(executor.submit(api.hit)) for job in as_completed(jobs): result = job.result() if result is None: mesgdcrt.FailureMessage( "Bombing limit for your target has been reached") mesgdcrt.GeneralMessage("Try Again Later !!") input(mesgdcrt.CommandMessage("Press [ENTER] to exit")) bann_text() sys.exit() if result: success += 1 else: failed += 1 clr() pretty_print(cc, target, success, failed) print("\n") mesgdcrt.SuccessMessage("Bombing completed!") time.sleep(1.5) bann_text() sys.exit() def selectnode(mode="sms"): mode = mode.lower().strip() try: clr() bann_text() check_intr() check_for_updates() notifyen() max_limit = {"sms": 500, "call": 15, "mail": 200} cc, target = "", "" if mode in ["sms", "call"]: cc, target = get_phone_info() if cc != "91": max_limit.update({"sms": 100}) elif mode == "mail": target = get_mail_info() else: raise KeyboardInterrupt limit = max_limit[mode] while True: try: message = ("Enter number of {type}".format(type=mode.upper()) + " to send (Max {limit}): ".format(limit=limit)) count = int(input(mesgdcrt.CommandMessage(message)).strip()) if count > limit or count == 0: mesgdcrt.WarningMessage("You have requested " + str(count) + " {type}".format( type=mode.upper())) mesgdcrt.GeneralMessage( "Automatically capping the value" " to {limit}".format(limit=limit)) count = limit delay = float(input( mesgdcrt.CommandMessage("Enter delay time (in seconds): ")) .strip()) # delay = 0 max_thread_limit = (count//10) if (count//10) > 0 else 1 max_threads = int(input( mesgdcrt.CommandMessage( "Enter Number of Thread (Recommended: {max_limit}): " .format(max_limit=max_thread_limit))) .strip()) max_threads = max_threads if ( max_threads > 0) else max_thread_limit if (count < 0 or delay < 0): raise Exception break except KeyboardInterrupt as ki: raise ki except Exception: mesgdcrt.FailureMessage("Read Instructions Carefully !!!") print() workernode(mode, cc, target, count, delay, max_threads) except KeyboardInterrupt: mesgdcrt.WarningMessage("Received INTR call - Exiting...") sys.exit() mesgdcrt = MessageDecorator("icon") if sys.version_info[0] != 3: mesgdcrt.FailureMessage("TBomb will work only in Python v3") sys.exit() try: country_codes = readisdc()["isdcodes"] except FileNotFoundError: update() __VERSION__ = get_version() __CONTRIBUTORS__ = ['SpeedX', 't0xic0der', 'scpketer', 'Stefan'] ALL_COLORS = [Fore.GREEN, Fore.RED, Fore.YELLOW, Fore.BLUE, Fore.MAGENTA, Fore.CYAN, Fore.WHITE] RESET_ALL = Style.RESET_ALL ASCII_MODE = False DEBUG_MODE = False description = """TBomb - Your Friendly Spammer Application TBomb can be used for many purposes which incudes - \t Exposing the vulnerable APIs over Internet \t Friendly Spamming \t Testing Your Spam Detector and more .... TBomb is not intented for malicious uses. """ parser = argparse.ArgumentParser(description=description, epilog='Coded by SpeedX !!!') parser.add_argument("-sms", "--sms", action="store_true", help="start TBomb with SMS Bomb mode") parser.add_argument("-call", "--call", action="store_true", help="start TBomb with CALL Bomb mode") parser.add_argument("-mail", "--mail", action="store_true", help="start TBomb with MAIL Bomb mode") parser.add_argument("-ascii", "--ascii", action="store_true", help="show only characters of standard ASCII set") parser.add_argument("-u", "--update", action="store_true", help="update TBomb") parser.add_argument("-c", "--contributors", action="store_true", help="show current TBomb contributors") parser.add_argument("-v", "--version", action="store_true", help="show current TBomb version") if __name__ == "__main__": args = parser.parse_args() if args.ascii: ASCII_MODE = True mesgdcrt = MessageDecorator("stat") if args.version: print("Version: ", __VERSION__) elif args.contributors: print("Contributors: ", " ".join(__CONTRIBUTORS__)) elif args.update: update() elif args.mail: selectnode(mode="mail") elif args.call: selectnode(mode="call") elif args.sms: selectnode(mode="sms") else: choice = "" avail_choice = { "1": "SMS", "2": "CALL", "3": "MAIL" } try: while (choice not in avail_choice): clr() bann_text() print("Available Options:\n") for key, value in avail_choice.items(): print("[ {key} ] {value} BOMB".format(key=key, value=value)) print() choice = input(mesgdcrt.CommandMessage("Enter Choice : ")) selectnode(mode=avail_choice[choice].lower()) except KeyboardInterrupt: mesgdcrt.WarningMessage("Received INTR call - Exiting...") sys.exit() sys.exit()
DorazeExplorer / Launcher.user.js// ==UserScript== // @name Launcher // @namespace AposLauncher // @include http://agar.io/ // @version 2.1 // @grant none // @author http://www.twitch.tv/apostolique // ==/UserScript== Number.prototype.mod = function(n) { return ((this%n)+n)%n; }; Array.prototype.peek = function() { return this[this.length-1]; } console.log("Running Bot Launcher!"); (function (h, f) { //UPDATE function keyAction(e) { if (84 == e.keyCode) { console.log("Toggle"); toggle = !toggle; } if (82 == e.keyCode) { console.log("ToggleDraw"); toggleDraw = !toggleDraw; } if (68 == e.keyCode) { window.setDarkTheme(!getDarkBool()); } if (70 == e.keyCode) { window.setShowMass(!getMassBool()); } } function humanPlayer() { //Don't need to do anything. return [getPointX(), getPointY()]; } function Sa() { //UPDATE if (window.botList == null) { window.botList = []; window.jQuery('#locationUnknown').append(window.jQuery('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />')); window.jQuery('#locationUnknown').addClass('form-group'); } window.botList.push(["Human", humanPlayer]); var bList = window.jQuery('#bList'); window.jQuery('<option />', {value: (window.botList.length - 1), text: "Human"}).appendTo(bList); la = !0; za(); setInterval(za, 180000); B = ma = document.getElementById('canvas'); e = B.getContext('2d'); B.onmousedown = function (a) { if (Aa) { var b = a.clientX - (5 + p / 5 / 2), c = a.clientY - (5 + p / 5 / 2); if (Math.sqrt(b * b + c * c) <= p / 5 / 2) { K(); C(17); return } } T = a.clientX; U = a.clientY; na(); K() }; B.onmousemove = function (a) { T = a.clientX; U = a.clientY; na() }; B.onmouseup = function () { }; /firefox/i.test(navigator.userAgent) ? document.addEventListener('DOMMouseScroll', Ba, !1) : document.body.onmousewheel = Ba; var a = !1, b = !1, c = !1; h.onkeydown = function (d) { 32 != d.keyCode || a || (K(), C(17), a = !0); 81 != d.keyCode || b || (C(18), b = !0); 87 != d.keyCode || c || (K(), C(21), c = !0); 27 == d.keyCode && Ca(!0); //UPDATE keyAction(d); }; h.onkeyup = function (d) { 32 == d.keyCode && (a = !1); 87 == d.keyCode && (c = !1); 81 == d.keyCode && b && (C(19), b = !1) }; h.onblur = function () { C(19); c = b = a = !1 }; h.onresize = Da; Da(); h.requestAnimationFrame ? h.requestAnimationFrame(Ea) : setInterval(oa, 1000 / 60); setInterval(K, 40); v && f('#region').val(v); Fa(); V(f('#region').val()); null == r && v && W(); f('#overlays').show() } function Ba(a) { D *= Math.pow(0.9, a.wheelDelta / - 120 || a.detail || 0); 1 > D && (D = 1); D > 4 / g && (D = 4 / g) } function Ta() { if (0.4 > g) L = null; else { for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, d = Number.NEGATIVE_INFINITY, e = 0, l = 0; l < u.length; l++) { var k = u[l]; !k.I() || k.M || 20 >= k.size * g || (e = Math.max(k.size, e), a = Math.min(k.x, a), b = Math.min(k.y, b), c = Math.max(k.x, c), d = Math.max(k.y, d)) } L = Ua.ca({ X: a - (e + 100), Y: b - (e + 100), fa: c + (e + 100), ga: d + (e + 100), da: 2, ea: 4 }); for (l = 0; l < u.length; l++) if (k = u[l], k.I() && !(20 >= k.size * g)) for (a = 0; a < k.a.length; ++a) b = k.a[a].x, c = k.a[a].y, b < s - p / 2 / g || c < t - q / 2 / g || b > s + p / 2 / g || c > t + q / 2 / g || L.i(k.a[a]) } } function na() { //UPDATE if (toggle ||window.botList[botIndex][0] == "Human") { X = (T - p / 2) / g + s; Y = (U - q / 2) / g + t } } function za() { null == Z && (Z = { }, f('#region').children().each(function () { var a = f(this), b = a.val(); b && (Z[b] = a.text()) })); f.get($ + '//m.agar.io/info', function (a) { var b = { }, c; for (c in a.regions) { var d = c.split(':') [0]; b[d] = b[d] || 0; b[d] += a.regions[c].numPlayers } for (c in b) f('#region option[value="' + c + '"]').text(Z[c] + ' (' + b[c] + ' players)') }, 'json') } function Ga() { f('#adsBottom').hide(); f('#overlays').hide(); Fa() } function V(a) { a && a != v && (f('#region').val() != a && f('#region').val(a), v = h.localStorage.location = a, f('.region-message').hide(), f('.region-message.' + a).show(), f('.btn-needs-server').prop('disabled', !1), la && W()) } function Ca(a) { E = null; f('#overlays').fadeIn(a ? 200 : 3000); a || f('#adsBottom').fadeIn(3000) } function Fa() { f('#region').val() ? h.localStorage.location = f('#region').val() : h.localStorage.location && f('#region').val(h.localStorage.location); f('#region').val() ? f('#locationKnown').append(f('#region')) : f('#locationUnknown').append(f('#region')) } function pa() { console.log('Find ' + v + M); f.ajax($ + '//m.agar.io/', { error: function () { setTimeout(pa, 1000) }, success: function (a) { a = a.split('\n'); '45.79.222.79:443' == a[0] ? pa() : Ha('ws://' + a[0]) }, dataType: 'text', method: 'POST', cache: !1, crossDomain: !0, data: v + M || '?' }) } function W() { la && v && (f('#connecting').show(), pa()) } function Ha(a) { if (r) { r.onopen = null; r.onmessage = null; r.onclose = null; try { r.close() } catch (b) { } r = null } var c = h.location.search.slice(1); /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+$/.test(c) && (a = 'ws://' + c); Va && (a = a.split(':'), a = a[0] + 's://ip-' + a[1].replace(/\./g, '-').replace(/\//g, '') + '.tech.agar.io:' + ( + a[2] + 2000)); F = [ ]; m = [ ]; z = { }; u = [ ]; H = [ ]; A = [ ]; w = x = null; I = 0; console.log('Connecting to ' + a); //UPDATE serverIP = a; r = new WebSocket(a); r.binaryType = 'arraybuffer'; r.onopen = Wa; r.onmessage = Xa; r.onclose = Ya; r.onerror = function () { console.log('socket error') } } function N(a) { return new DataView(new ArrayBuffer(a)) } function O(a) { r.send(a.buffer) } function Wa() { var a; aa = 500; f('#connecting').hide(); console.log('socket open'); a = N(5); a.setUint8(0, 254); a.setUint32(1, 4, !0); O(a); a = N(5); a.setUint8(0, 255); a.setUint32(1, 673720361, !0); O(a); Ia() } function Ya() { console.log('socket close'); setTimeout(W, aa); aa *= 1.5 } function Xa(a) { Za(new DataView(a.data)) } function Za(a) { function b() { for (var b = ''; ; ) { var d = a.getUint16(c, !0); c += 2; if (0 == d) break; b += String.fromCharCode(d) } return b } var c = 0; 240 == a.getUint8(c) && (c += 5); switch (a.getUint8(c++)) { case 16: $a(a, c); break; case 17: P = a.getFloat32(c, !0); c += 4; Q = a.getFloat32(c, !0); c += 4; R = a.getFloat32(c, !0); c += 4; break; case 20: m = [ ]; F = [ ]; break; case 21: qa = a.getInt16(c, !0); c += 2; ra = a.getInt16(c, !0); c += 2; sa || (sa = !0, ba = qa, ca = ra); break; case 32: F.push(a.getUint32(c, !0)); c += 4; break; case 49: if (null != x) break; var d = a.getUint32(c, !0), c = c + 4; A = [ ]; for (var e = 0; e < d; ++e) { var l = a.getUint32(c, !0), c = c + 4; A.push({ id: l, name: b() }) } Ja(); break; case 50: x = [ ]; d = a.getUint32(c, !0); c += 4; for (e = 0; e < d; ++e) x.push(a.getFloat32(c, !0)), c += 4; Ja(); break; case 64: da = a.getFloat64(c, !0), c += 8, ea = a.getFloat64(c, !0), c += 8, fa = a.getFloat64(c, !0), c += 8, ga = a.getFloat64(c, !0), c += 8, P = (fa + da) / 2, Q = (ga + ea) / 2, R = 1, 0 == m.length && (s = P, t = Q, g = R) } } function $a(a, b) { G = + new Date; var c = Math.random(); ta = !1; var d = a.getUint16(b, !0); b += 2; for (var e = 0; e < d; ++e) { var l = z[a.getUint32(b, !0)], k = z[a.getUint32(b + 4, !0)]; b += 8; l && k && (k.S(), k.p = k.x, k.q = k.y, k.o = k.size, k.D = l.x, k.F = l.y, k.n = k.size, k.L = G) } for (e = 0; ; ) { d = a.getUint32(b, !0); b += 4; if (0 == d) break; ++e; var h, l = a.getInt16(b, !0); b += 2; k = a.getInt16(b, !0); b += 2; h = a.getInt16(b, !0); b += 2; for (var g = a.getUint8(b++), f = a.getUint8(b++), p = a.getUint8(b++), g = (g << 16 | f << 8 | p).toString(16); 6 > g.length; ) g = '0' + g; var g = '#' + g, f = a.getUint8(b++), p = !!(f & 1), r = !!(f & 16); f & 2 && (b += 4); f & 4 && (b += 8); f & 8 && (b += 16); for (var q, n = ''; ; ) { q = a.getUint16(b, !0); b += 2; if (0 == q) break; n += String.fromCharCode(q) } q = n; n = null; z.hasOwnProperty(d) ? (n = z[d], n.K(), n.p = n.x, n.q = n.y, n.o = n.size, n.color = g) : (n = new Ka(d, l, k, h, g, q), n.ka = l, n.la = k); n.d = p; n.j = r; n.D = l; n.F = k; n.n = h; n.ja = c; n.L = G; n.W = f; q && n.Z(q); - 1 != F.indexOf(d) && - 1 == m.indexOf(n) && (document.getElementById('overlays').style.display = 'none', m.push(n), 1 == m.length && (s = n.x, t = n.y)) //UPDATE interNodes[d] = window.getCells()[d]; } //UPDATE Object.keys(interNodes).forEach(function (element, index) { //console.log("start: " + interNodes[element].updateTime + " current: " + D + " life: " + (D - interNodes[element].updateTime)); var isRemoved = !window.getCells().hasOwnProperty(element); if (isRemoved && (getLastUpdate() - interNodes[element].L) > 3000) { delete interNodes[element]; } else if (isRemoved && computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) < screenDistance()) { //console.log("Too close! Remove " + computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) + " || " + screenDistance()); delete interNodes[element]; } }); c = a.getUint32(b, !0); b += 4; for (e = 0; e < c; e++) d = a.getUint32(b, !0), b += 4, n = z[d], null != n && n.S(); //ta && 0 == m.length && Ca(!1) } //UPDATE function computeDistance(x1, y1, x2, y2) { var xdis = x1 - x2; // <--- FAKE AmS OF COURSE! var ydis = y1 - y2; var distance = Math.sqrt(xdis * xdis + ydis * ydis); return distance; } function screenDistance() { return Math.min(computeDistance (getOffsetX(), getOffsetY(), screenToGameX(getWidth()), getOffsetY()), computeDistance (getOffsetX(), getOffsetY(), getOffsetX(), screenToGameY(getHeight()))); } function screenToGameX(x) { return (x - getWidth() / 2) / getRatio() + getX(); } function screenToGameY(y) { return (y - getHeight() / 2) / getRatio() + getY();; } window.drawPoint = function(x_1, y_1, drawColor, text) { if (!toggleDraw) { dPoints.push([x_1, y_1, drawColor]); dText.push(text); } } window.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) { if (!toggleDraw) { var radius = computeDistance(x_1, y_1, x_3, y_3); dArc.push([x_1, y_1, x_2, y_2, x_3, y_3, radius, drawColor]); } } window.drawLine = function(x_1, y_1, x_2, y_2, drawColor) { if (!toggleDraw) { lines.push([x_1, y_1, x_2, y_2, drawColor]); } } window.drawCircle = function(x_1, y_1, radius, drawColor) { if (!toggleDraw) { circles.push([x_1, y_1, radius, drawColor]); } } function K() { //UPDATE if (getPlayer().length == 0) { setNick(originalName); } var a; if (ua()) { a = T - p / 2; var b = U - q / 2; 64 > a * a + b * b || 0.01 > Math.abs(La - X) && 0.01 > Math.abs(Ma - Y) || (La = X, Ma = Y, a = N(21), a.setUint8(0, 16), a.setFloat64(1, X, !0), a.setFloat64(9, Y, !0), a.setUint32(17, 0, !0), O(a)) } } function Ia() { if (ua() && null != E) { var a = N(1 + 2 * E.length); a.setUint8(0, 0); for (var b = 0; b < E.length; ++b) a.setUint16(1 + 2 * b, E.charCodeAt(b), !0); O(a) } } function ua() { return null != r && r.readyState == r.OPEN } function C(a) { if (ua()) { var b = N(1); b.setUint8(0, a); O(b) } } function Ea() { oa(); h.requestAnimationFrame(Ea) } function Da() { p = h.innerWidth; q = h.innerHeight; ma.width = B.width = p; ma.height = B.height = q; oa() } function Na() { var a; a = 1 * Math.max(q / 1080, p / 1920); return a *= D } function ab() { if (0 != m.length) { for (var a = 0, b = 0; b < m.length; b++) a += m[b].size; a = Math.pow(Math.min(64 / a, 1), 0.4) * Na(); g = (9 * g + a) / 10 } } function oa() { //UPDATE dPoints = []; circles = []; dArc = []; dText = []; lines = []; var a, b = Date.now(); ++bb; G = b; if (0 < m.length) { ab(); for (var c = a = 0, d = 0; d < m.length; d++) m[d].K(), a += m[d].x / m.length, c += m[d].y / m.length; P = a; Q = c; R = g; s = (s + a) / 2; t = (t + c) / 2 } else s = (29 * s + P) / 30, t = (29 * t + Q) / 30, g = (9 * g + R * Na()) / 10; Ta(); na(); va || e.clearRect(0, 0, p, q); va ? (e.fillStyle = ha ? '#111111' : '#F2FBFF', e.globalAlpha = 0.05, e.fillRect(0, 0, p, q), e.globalAlpha = 1) : cb(); u.sort(function (a, b) { return a.size == b.size ? a.id - b.id : a.size - b.size }); e.save(); e.translate(p / 2, q / 2); e.scale(g, g); e.translate( - s, - t); for (d = 0; d < H.length; d++) H[d].T(); for (d = 0; d < u.length; d++) u[d].T(); //UPDATE if (getPlayer().length > 0) { var moveLoc = window.botList[botIndex][1](); if (!toggle) { setPoint(moveLoc[0], moveLoc[1]); } } customRender(e); if (sa) { ba = (3 * ba + qa) / 4; ca = (3 * ca + ra) / 4; e.save(); e.strokeStyle = '#FFAAAA'; e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = 'round'; e.globalAlpha = 0.5; e.beginPath(); for (d = 0; d < m.length; d++) e.moveTo(m[d].x, m[d].y), e.lineTo(ba, ca); e.stroke(); e.restore() } e.restore(); w && w.width && e.drawImage(w, p - w.width - 10, 10); I = Math.max(I, db()); //UPDATE sessionScore = Math.max(I, sessionScore); 0 != I && (null == ia && (ia = new ja(24, '#FFFFFF', true,'#000000')), ia.u('Score: ' + ~~(I / 100) + ' || Best Score: ' + ~~(sessionScore / 100) + " || Best time alive: " + bestTime + " seconds"), c = ia.G(), a = c.width, e.globalAlpha = 0.2, e.fillStyle = '#000000', e.fillRect(10, q - 10 - 24 - 10, a + 10, 34), e.globalAlpha = 1, e.drawImage(c, 15, q - 10 - 24 - 5)); eb(); b = Date.now() - b; b > 1000 / 60 ? y -= 0.01 : b < 1000 / 65 && (y += 0.01); 0.4 > y && (y = 0.4); 1 < y && (y = 1) drawStats(e); } //UPDATE function customRender(d) { d.save(); for(var i = 0; i < lines.length; i++) { d.beginPath(); d.lineWidth = 5; if (lines[i][4] == 0) { d.strokeStyle = "#FF0000"; } else if (lines[i][4] == 1) { d.strokeStyle = "#00FF00"; } else if (lines[i][4] == 2) { d.strokeStyle = "#0000FF"; } else if (lines[i][4] == 3) { d.strokeStyle = "#FF8000"; } else if (lines[i][4] == 4) { d.strokeStyle = "#8A2BE2"; } else if (lines[i][4] == 5) { d.strokeStyle = "#FF69B4"; } else if (lines[i][4] == 6) { d.strokeStyle = "#008080"; } else if (lines[i][4] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.moveTo(lines[i][0], lines[i][1]); d.lineTo(lines[i][2], lines[i][3]); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < circles.length; i++) { if (circles[i][3] == 0) { d.strokeStyle = "#FF0000"; } else if (circles[i][3] == 1) { d.strokeStyle = "#00FF00"; } else if (circles[i][3] == 2) { d.strokeStyle = "#0000FF"; } else if (circles[i][3] == 3) { d.strokeStyle = "#FF8000"; } else if (circles[i][3] == 4) { d.strokeStyle = "#8A2BE2"; } else if (circles[i][3] == 5) { d.strokeStyle = "#FF69B4"; } else if (circles[i][3] == 6) { d.strokeStyle = "#008080"; } else if (circles[i][3] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 10; //d.setLineDash([5]); d.globalAlpha = 0.3; d.arc(circles[i][0], circles[i][1], circles[i][2], 0, 2 * Math.PI, false); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < dArc.length; i++) { if (dArc[i][7] == 0) { d.strokeStyle = "#FF0000"; } else if (dArc[i][7] == 1) { d.strokeStyle = "#00FF00"; } else if (dArc[i][7] == 2) { d.strokeStyle = "#0000FF"; } else if (dArc[i][7] == 3) { d.strokeStyle = "#FF8000"; } else if (dArc[i][7] == 4) { d.strokeStyle = "#8A2BE2"; } else if (dArc[i][7] == 5) { d.strokeStyle = "#FF69B4"; } else if (dArc[i][7] == 6) { d.strokeStyle = "#008080"; } else if (dArc[i][7] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 5; var ang1 = Math.atan2(dArc[i][1] - dArc[i][5], dArc[i][0] - dArc[i][4]); var ang2 = Math.atan2(dArc[i][3] - dArc[i][5], dArc[i][2] - dArc[i][4]); d.arc(dArc[i][4], dArc[i][5], dArc[i][6], ang1, ang2, false); d.stroke(); } d.restore(); d.save(); for (var i = 0; i < dPoints.length; i++) { if (dText[i] == "") { var radius = 10; d.beginPath(); d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false); if (dPoints[i][2] == 0) { d.fillStyle = "black"; } else if (dPoints[i][2] == 1) { d.fillStyle = "yellow"; } else if (dPoints[i][2] == 2) { d.fillStyle = "blue"; } else if (dPoints[i][2] == 3) { d.fillStyle = "red"; } else if (dPoints[i][2] == 4) { d.fillStyle = "#008080"; } else if (dPoints[i][2] == 5) { d.fillStyle = "#FF69B4"; } else { d.fillStyle = "#000000"; } d.fill(); d.lineWidth = 2; d.strokeStyle = '#003300'; d.stroke(); } else { var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111'), true, '#000000'); text.u(dText[i]); var textRender = text.G(); d.drawImage(textRender, dPoints[i][0], dPoints[i][1]); } } d.restore(); } function drawStats(d) { var currentDate = new Date(); var nbSeconds = 0; if (getPlayer().length > 0) { nbSeconds = (currentDate.getSeconds() + (currentDate.getMinutes() * 60) + (currentDate.getHours() * 60 * 60)) - (lifeTimer.getSeconds() + (lifeTimer.getMinutes() * 60) + (lifeTimer.getHours() * 60 * 60)); } bestTime = Math.max(nbSeconds, bestTime); var debugStrings = []; debugStrings.push("T - Bot: " + (!toggle ? "On" : "Off")); debugStrings.push("R - Lines: " + (!toggleDraw ? "On" : "Off")); debugStrings.push("Server: " + serverIP); debugStrings.push("Survived for: " + nbSeconds + " seconds"); if (getPlayer().length > 0) { debugStrings.push("Location: " + Math.floor(getPlayer()[0].x) + ", " + Math.floor(getPlayer()[0].y)); } var offsetValue = 20; var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111')); for (var i = 0; i < debugStrings.length; i++) { text.u(debugStrings[i]); var textRender = text.G(); d.drawImage(textRender, 20, offsetValue); offsetValue += textRender.height; } } function cb() { e.fillStyle = ha ? '#111111' : '#F2FBFF'; e.fillRect(0, 0, p, q); e.save(); e.strokeStyle = ha ? '#AAAAAA' : '#000000'; e.globalAlpha = 0.2; e.scale(g, g); for (var a = p / g, b = q / g, c = - 0.5 + ( - s + a / 2) % 50; c < a; c += 50) e.beginPath(), e.moveTo(c, 0), e.lineTo(c, b), e.stroke(); for (c = - 0.5 + ( - t + b / 2) % 50; c < b; c += 50) e.beginPath(), e.moveTo(0, c), e.lineTo(a, c), e.stroke(); e.restore() } function eb() { if (Aa && wa.width) { var a = p / 5; e.drawImage(wa, 5, 5, a, a) } } function db() { for (var a = 0, b = 0; b < m.length; b++) a += m[b].n * m[b].n; return a } function Ja() { w = null; if (null != x || 0 != A.length) if (null != x || ka) { w = document.createElement('canvas'); var a = w.getContext('2d'), b = 60, b = null == x ? b + 24 * A.length : b + 180, c = Math.min(200, 0.3 * p) / 200; w.width = 200 * c; w.height = b * c; a.scale(c, c); a.globalAlpha = 0.4; a.fillStyle = '#000000'; a.fillRect(0, 0, 200, b); a.globalAlpha = 1; a.fillStyle = '#FFFFFF'; c = null; c = 'Leaderboard'; a.font = '30px Ubuntu'; a.fillText(c, 100 - a.measureText(c).width / 2, 40); if (null == x) for (a.font = '20px Ubuntu', b = 0; b < A.length; ++b) c = A[b].name || 'An unnamed cell', ka || (c = 'An unnamed cell'), - 1 != F.indexOf(A[b].id) ? (m[0].name && (c = m[0].name), a.fillStyle = '#FFAAAA') : a.fillStyle = '#FFFFFF', c = b + 1 + '. ' + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b); else for (b = c = 0; b < x.length; ++b) { var d = c + x[b] * Math.PI * 2; a.fillStyle = fb[b + 1]; a.beginPath(); a.moveTo(100, 140); a.arc(100, 140, 80, c, d, !1); a.fill(); c = d } } } function Ka(a, b, c, d, e, l) { u.push(this); z[a] = this; this.id = a; this.p = this.x = b; this.q = this.y = c; this.o = this.size = d; this.color = e; this.a = [ ]; this.l = [ ]; this.R(); this.Z(l) } function ja(a, b, c, d) { a && (this.r = a); b && (this.N = b); this.P = !!c; d && (this.s = d) } var $ = h.location.protocol, Va = 'https:' == $, //UPDATE toggle = false, toggleDraw = false, tempPoint = [0, 0, 1], dPoints = [], circles = [], dArc = [], dText = [], lines = [], originalName = "NotReallyABot", sessionScore = 0, serverIP = "", interNodes = [], lifeTimer = new Date(), bestTime = 0, botIndex = 0, ma, e, B, p, q, L = null, r = null, s = 0, t = 0, F = [ ], m = [ ], z = { }, u = [ ], H = [ ], A = [ ], T = 0, U = 0, X = - 1, Y = - 1, bb = 0, G = 0, E = null, da = 0, ea = 0, fa = 10000, ga = 10000, g = 1, v = null, Oa = !0, ka = !0, xa = !1, ta = !1, I = 0, ha = !1, Pa = !1, P = s = ~~((da + fa) / 2), Q = t = ~~((ea + ga) / 2), R = 1, M = '', x = null, la = !1, sa = !1, qa = 0, ra = 0, ba = 0, ca = 0, Qa = 0, fb = [ '#333333', '#FF3333', '#33FF33', '#3333FF' ], va = !1, D = 1, Aa = 'ontouchstart' in h && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), wa = new Image; wa.src = 'img/split.png'; var Ra = document.createElement('canvas'); if ('undefined' == typeof console || 'undefined' == typeof DataView || 'undefined' == typeof WebSocket || null == Ra || null == Ra.getContext || null == h.localStorage) alert('You browser does not support this game, we recommend you to use Firefox to play this'); else { var Z = null; h.setNick = function (a) { //UPDATE originalName = a; if (getPlayer().length == 0) { lifeTimer = new Date(); } Ga(); E = a; Ia(); I = 0 }; h.setRegion = V; h.setSkins = function (a) { Oa = a }; h.setNames = function (a) { ka = a }; h.setDarkTheme = function (a) { ha = a }; h.setColors = function (a) { xa = a }; h.setShowMass = function (a) { Pa = a }; h.spectate = function () { E = null; C(1); Ga() }; h.setGameMode = function (a) { a != M && (M = a, W()) }; h.setAcid = function (a) { va = a }; null != h.localStorage && (null == h.localStorage.AB8 && (h.localStorage.AB8 = 0 + ~~(100 * Math.random())), Qa = + h.localStorage.AB8, h.ABGroup = Qa); f.get($ + '//gc.agar.io', function (a) { var b = a.split(' '); a = b[0]; b = b[1] || ''; - 1 == 'DE IL PL HU BR AT UA'.split(' ').indexOf(a) && ya.push('nazi'); - 1 == ['UA'].indexOf(a) && ya.push('ussr'); S.hasOwnProperty(a) && ('string' == typeof S[a] ? v || V(S[a]) : S[a].hasOwnProperty(b) && (v || V(S[a][b]))) }, 'text'); setTimeout(function () { }, 300000); var S = { AF: 'JP-Tokyo', AX: 'EU-London', AL: 'EU-London', DZ: 'EU-London', AS: 'SG-Singapore', AD: 'EU-London', AO: 'EU-London', AI: 'US-Atlanta', AG: 'US-Atlanta', AR: 'BR-Brazil', AM: 'JP-Tokyo', AW: 'US-Atlanta', AU: 'SG-Singapore', AT: 'EU-London', AZ: 'JP-Tokyo', BS: 'US-Atlanta', BH: 'JP-Tokyo', BD: 'JP-Tokyo', BB: 'US-Atlanta', BY: 'EU-London', BE: 'EU-London', BZ: 'US-Atlanta', BJ: 'EU-London', BM: 'US-Atlanta', BT: 'JP-Tokyo', BO: 'BR-Brazil', BQ: 'US-Atlanta', BA: 'EU-London', BW: 'EU-London', BR: 'BR-Brazil', IO: 'JP-Tokyo', VG: 'US-Atlanta', BN: 'JP-Tokyo', BG: 'EU-London', BF: 'EU-London', BI: 'EU-London', KH: 'JP-Tokyo', CM: 'EU-London', CA: 'US-Atlanta', CV: 'EU-London', KY: 'US-Atlanta', CF: 'EU-London', TD: 'EU-London', CL: 'BR-Brazil', CN: 'CN-China', CX: 'JP-Tokyo', CC: 'JP-Tokyo', CO: 'BR-Brazil', KM: 'EU-London', CD: 'EU-London', CG: 'EU-London', CK: 'SG-Singapore', CR: 'US-Atlanta', CI: 'EU-London', HR: 'EU-London', CU: 'US-Atlanta', CW: 'US-Atlanta', CY: 'JP-Tokyo', CZ: 'EU-London', DK: 'EU-London', DJ: 'EU-London', DM: 'US-Atlanta', DO: 'US-Atlanta', EC: 'BR-Brazil', EG: 'EU-London', SV: 'US-Atlanta', GQ: 'EU-London', ER: 'EU-London', EE: 'EU-London', ET: 'EU-London', FO: 'EU-London', FK: 'BR-Brazil', FJ: 'SG-Singapore', FI: 'EU-London', FR: 'EU-London', GF: 'BR-Brazil', PF: 'SG-Singapore', GA: 'EU-London', GM: 'EU-London', GE: 'JP-Tokyo', DE: 'EU-London', GH: 'EU-London', GI: 'EU-London', GR: 'EU-London', GL: 'US-Atlanta', GD: 'US-Atlanta', GP: 'US-Atlanta', GU: 'SG-Singapore', GT: 'US-Atlanta', GG: 'EU-London', GN: 'EU-London', GW: 'EU-London', GY: 'BR-Brazil', HT: 'US-Atlanta', VA: 'EU-London', HN: 'US-Atlanta', HK: 'JP-Tokyo', HU: 'EU-London', IS: 'EU-London', IN: 'JP-Tokyo', ID: 'JP-Tokyo', IR: 'JP-Tokyo', IQ: 'JP-Tokyo', IE: 'EU-London', IM: 'EU-London', IL: 'JP-Tokyo', IT: 'EU-London', JM: 'US-Atlanta', JP: 'JP-Tokyo', JE: 'EU-London', JO: 'JP-Tokyo', KZ: 'JP-Tokyo', KE: 'EU-London', KI: 'SG-Singapore', KP: 'JP-Tokyo', KR: 'JP-Tokyo', KW: 'JP-Tokyo', KG: 'JP-Tokyo', LA: 'JP-Tokyo', LV: 'EU-London', LB: 'JP-Tokyo', LS: 'EU-London', LR: 'EU-London', LY: 'EU-London', LI: 'EU-London', LT: 'EU-London', LU: 'EU-London', MO: 'JP-Tokyo', MK: 'EU-London', MG: 'EU-London', MW: 'EU-London', MY: 'JP-Tokyo', MV: 'JP-Tokyo', ML: 'EU-London', MT: 'EU-London', MH: 'SG-Singapore', MQ: 'US-Atlanta', MR: 'EU-London', MU: 'EU-London', YT: 'EU-London', MX: 'US-Atlanta', FM: 'SG-Singapore', MD: 'EU-London', MC: 'EU-London', MN: 'JP-Tokyo', ME: 'EU-London', MS: 'US-Atlanta', MA: 'EU-London', MZ: 'EU-London', MM: 'JP-Tokyo', NA: 'EU-London', NR: 'SG-Singapore', NP: 'JP-Tokyo', NL: 'EU-London', NC: 'SG-Singapore', NZ: 'SG-Singapore', NI: 'US-Atlanta', NE: 'EU-London', NG: 'EU-London', NU: 'SG-Singapore', NF: 'SG-Singapore', MP: 'SG-Singapore', NO: 'EU-London', OM: 'JP-Tokyo', PK: 'JP-Tokyo', PW: 'SG-Singapore', PS: 'JP-Tokyo', PA: 'US-Atlanta', PG: 'SG-Singapore', PY: 'BR-Brazil', PE: 'BR-Brazil', PH: 'JP-Tokyo', PN: 'SG-Singapore', PL: 'EU-London', PT: 'EU-London', PR: 'US-Atlanta', QA: 'JP-Tokyo', RE: 'EU-London', RO: 'EU-London', RU: 'RU-Russia', RW: 'EU-London', BL: 'US-Atlanta', SH: 'EU-London', KN: 'US-Atlanta', LC: 'US-Atlanta', MF: 'US-Atlanta', PM: 'US-Atlanta', VC: 'US-Atlanta', WS: 'SG-Singapore', SM: 'EU-London', ST: 'EU-London', SA: 'EU-London', SN: 'EU-London', RS: 'EU-London', SC: 'EU-London', SL: 'EU-London', SG: 'JP-Tokyo', SX: 'US-Atlanta', SK: 'EU-London', SI: 'EU-London', SB: 'SG-Singapore', SO: 'EU-London', ZA: 'EU-London', SS: 'EU-London', ES: 'EU-London', LK: 'JP-Tokyo', SD: 'EU-London', SR: 'BR-Brazil', SJ: 'EU-London', SZ: 'EU-London', SE: 'EU-London', CH: 'EU-London', SY: 'EU-London', TW: 'JP-Tokyo', TJ: 'JP-Tokyo', TZ: 'EU-London', TH: 'JP-Tokyo', TL: 'JP-Tokyo', TG: 'EU-London', TK: 'SG-Singapore', TO: 'SG-Singapore', TT: 'US-Atlanta', TN: 'EU-London', TR: 'TK-Turkey', TM: 'JP-Tokyo', TC: 'US-Atlanta', TV: 'SG-Singapore', UG: 'EU-London', UA: 'EU-London', AE: 'EU-London', GB: 'EU-London', US: { AL: 'US-Atlanta', AK: 'US-Fremont', AZ: 'US-Fremont', AR: 'US-Atlanta', CA: 'US-Fremont', CO: 'US-Fremont', CT: 'US-Atlanta', DE: 'US-Atlanta', FL: 'US-Atlanta', GA: 'US-Atlanta', HI: 'US-Fremont', ID: 'US-Fremont', IL: 'US-Atlanta', IN: 'US-Atlanta', IA: 'US-Atlanta', KS: 'US-Atlanta', KY: 'US-Atlanta', LA: 'US-Atlanta', ME: 'US-Atlanta', MD: 'US-Atlanta', MA: 'US-Atlanta', MI: 'US-Atlanta', MN: 'US-Fremont', MS: 'US-Atlanta', MO: 'US-Atlanta', MT: 'US-Fremont', NE: 'US-Fremont', NV: 'US-Fremont', NH: 'US-Atlanta', NJ: 'US-Atlanta', NM: 'US-Fremont', NY: 'US-Atlanta', NC: 'US-Atlanta', ND: 'US-Fremont', OH: 'US-Atlanta', OK: 'US-Atlanta', OR: 'US-Fremont', PA: 'US-Atlanta', RI: 'US-Atlanta', SC: 'US-Atlanta', SD: 'US-Fremont', TN: 'US-Atlanta', TX: 'US-Atlanta', UT: 'US-Fremont', VT: 'US-Atlanta', VA: 'US-Atlanta', WA: 'US-Fremont', WV: 'US-Atlanta', WI: 'US-Atlanta', WY: 'US-Fremont', DC: 'US-Atlanta', AS: 'US-Atlanta', GU: 'US-Atlanta', MP: 'US-Atlanta', PR: 'US-Atlanta', UM: 'US-Atlanta', VI: 'US-Atlanta' }, UM: 'SG-Singapore', VI: 'US-Atlanta', UY: 'BR-Brazil', UZ: 'JP-Tokyo', VU: 'SG-Singapore', VE: 'BR-Brazil', VN: 'JP-Tokyo', WF: 'SG-Singapore', EH: 'EU-London', YE: 'JP-Tokyo', ZM: 'EU-London', ZW: 'EU-London' }; h.connect = Ha; //UPDATE window.getDarkBool = function() { return ha; } window.getMassBool = function() { return Pa; } window.getMemoryCells = function() { return interNodes; } window.getCellsArray = function() { return u; } window.getCells = function() { return z; } window.getPlayer = function() { return m; } window.getWidth = function() { return p; } window.getHeight = function() { return q; } window.getRatio = function() { return g; } window.getOffsetX = function() { return P; } window.getOffsetY = function() { return Q; } window.getX = function() { return s; } window.getY = function() { return t; } window.getPointX = function() { return X; } window.getPointY = function() { return Y; } window.getMouseX = function() { return T; } window.getMouseY = function() { return U; } window.getScreenDistance = function() { var temp = screenDistance(); return temp; } window.getLastUpdate = function() { return G; } window.setPoint = function(x, y) { X = x; Y = y; } window.createFake = function(a, b, c, d, e, f) { var n = new Ka(a, b, c, d, e, f); return n; } window.setScore = function(a) { sessionScore = a * 100; } window.setBestTime = function(a) { bestTime = a; } window.best = function(a, b) { setScore(a); setBestTime(b); } window.setBotIndex = function(a) { console.log("Changing bot"); botIndex = a; } var aa = 500, La = - 1, Ma = - 1, w = null, y = 1, ia = null, J = { }, ya = 'poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;hitler;north korea;south korea;japan;united kingdom;earth;greece;latvia;lithuania;estonia;finland;norway;cia;maldivas;austria;nigeria;reddit;yaranaika;confederate;9gag;indiana;4chan;italy;bulgaria;tumblr;2ch.hk;hong kong;portugal;jamaica;german empire;mexico;sanik;switzerland;croatia;chile;indonesia;bangladesh;thailand;iran;iraq;peru;moon;botswana;bosnia;netherlands;european union;taiwan;pakistan;hungary;satanist;qing dynasty;matriarchy;patriarchy;feminism;ireland;texas;facepunch;prodota;cambodia;steam;piccolo;ea;india;kc;denmark;quebec;ayy lmao;sealand;bait;tsarist russia;origin;vinesauce;stalin;belgium;luxembourg;stussy;prussia;8ch;argentina;scotland;sir;romania;belarus;wojak;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface;8;irs;receita federal;facebook'.split(';'), gb = [ '8', 'nasa' ], hb = [ 'm\'blob' ]; Ka.prototype = { id: 0, a: null, //points l: null, //pointsAcc name: null, //name k: null, //nameCache J: null, //sizeCache x: 0, y: 0, size: 0, p: 0, //ox q: 0, //oy o: 0, //oSize D: 0, //nx F: 0, //ny n: 0, //nSize W: 0, //drawTime L: 0, //updateTime ja: 0, ba: 0, A: !1, d: !1, j: !1, M: !0, //UPDATE updateCode: 0, danger: false, dangerTimeOut: 0, S: function () { var a; for (a = 0; a < u.length; a++) if (u[a] == this) { u.splice(a, 1); break } delete z[this.id]; a = m.indexOf(this); - 1 != a && (ta = !0, m.splice(a, 1)); a = F.indexOf(this.id); - 1 != a && F.splice(a, 1); this.A = !0; H.push(this) }, h: function () { return Math.max(~~(0.3 * this.size), 24) }, Z: function (a) { if (this.name = a) null == this.k ? this.k = new ja(this.h(), '#FFFFFF', !0, '#000000') : this.k.H(this.h()), this.k.u(this.name) }, R: function () { for (var a = this.C(); this.a.length > a; ) { var b = ~~(Math.random() * this.a.length); this.a.splice(b, 1); this.l.splice(b, 1) } 0 == this.a.length && 0 < a && (this.a.push({ Q: this, e: this.size, x: this.x, y: this.y }), this.l.push(Math.random() - 0.5)); for (; this.a.length < a; ) { var b = ~~(Math.random() * this.a.length), c = this.a[b]; this.a.splice(b, 0, { Q: this, e: c.e, x: c.x, y: c.y }); this.l.splice(b, 0, this.l[b]) } }, C: function () { var a = 10; 20 > this.size && (a = 0); this.d && (a = 30); var b = this.size; this.d || (b *= g); b *= y; this.W & 32 && (b *= 0.25); return ~~Math.max(b, a) }, ha: function () { this.R(); for (var a = this.a, b = this.l, c = a.length, d = 0; d < c; ++d) { var e = b[(d - 1 + c) % c], l = b[(d + 1) % c]; b[d] += (Math.random() - 0.5) * (this.j ? 3 : 1); b[d] *= 0.7; 10 < b[d] && (b[d] = 10); - 10 > b[d] && (b[d] = - 10); b[d] = (e + l + 8 * b[d]) / 10 } for (var k = this, h = this.d ? 0 : (this.id / 1000 + G / 10000) % (2 * Math.PI), d = 0; d < c; ++d) { var f = a[d].e, e = a[(d - 1 + c) % c].e, l = a[(d + 1) % c].e; if (15 < this.size && null != L && 20 < this.size * g) { var m = !1, p = a[d].x, q = a[d].y; L.ia(p - 5, q - 5, 10, 10, function (a) { a.Q != k && 25 > (p - a.x) * (p - a.x) + (q - a.y) * (q - a.y) && (m = !0) }); !m && (a[d].x < da || a[d].y < ea || a[d].x > fa || a[d].y > ga) && (m = !0); m && (0 < b[d] && (b[d] = 0), b[d] -= 1) } f += b[d]; 0 > f && (f = 0); f = this.j ? (19 * f + this.size) / 20 : (12 * f + this.size) / 13; a[d].e = (e + l + 8 * f) / 10; e = 2 * Math.PI / c; l = this.a[d].e; this.d && 0 == d % 2 && (l += 5); a[d].x = this.x + Math.cos(e * d + h) * l; a[d].y = this.y + Math.sin(e * d + h) * l } }, K: function () { var a; a = (G - this.L) / 120; a = 0 > a ? 0 : 1 < a ? 1 : a; var b = 0 > a ? 0 : 1 < a ? 1 : a; this.h(); if (this.A && 1 <= b) { var c = H.indexOf(this); - 1 != c && H.splice(c, 1) } this.x = a * (this.D - this.p) + this.p; this.y = a * (this.F - this.q) + this.q; this.size = b * (this.n - this.o) + this.o; return b }, I: function () { return this.x + this.size + 40 < s - p / 2 / g || this.y + this.size + 40 < t - q / 2 / g || this.x - this.size - 40 > s + p / 2 / g || this.y - this.size - 40 > t + q / 2 / g ? !1 : !0 }, T: function () { if (this.I()) { var a = !this.d && !this.j && 0.4 > g; 5 > this.C() && (a = !0); if (this.M && !a) for (var b = 0; b < this.a.length; b++) this.a[b].e = this.size; this.M = a; e.save(); this.ba = G; b = this.K(); this.A && (e.globalAlpha *= 1 - b); e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = this.d ? 'miter' : 'round'; xa ? (e.fillStyle = '#FFFFFF', e.strokeStyle = '#AAAAAA') : (e.fillStyle = this.color, e.strokeStyle = this.color); if (a) e.beginPath(), e.arc(this.x, this.y, this.size, 0, 2 * Math.PI, !1); else { this.ha(); e.beginPath(); var c = this.C(); e.moveTo(this.a[0].x, this.a[0].y); for (b = 1; b <= c; ++b) { var d = b % c; e.lineTo(this.a[d].x, this.a[d].y) } } e.closePath(); c = this.name.toLowerCase(); !this.j && Oa && ':teams' != M ? - 1 != ya.indexOf(c) ? (J.hasOwnProperty(c) || (J[c] = new Image, J[c].src = 'skins/' + c + '.png'), b = 0 != J[c].width && J[c].complete ? J[c] : null) : b = null : b = null; b = (d = b) ? - 1 != hb.indexOf(c) : !1; a || e.stroke(); e.fill(); null == d || b || (e.save(), e.clip(), e.drawImage(d, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), e.restore()); (xa || 15 < this.size) && !a && (e.strokeStyle = '#000000', e.globalAlpha *= 0.1, e.stroke()); e.globalAlpha = 1; null != d && b && e.drawImage(d, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size); b = - 1 != m.indexOf(this); a = ~~this.y; if ((ka || b) && this.name && this.k && (null == d || - 1 == gb.indexOf(c))) { d = this.k; d.u(this.name); d.H(this.h()); c = Math.ceil(10 * g) / 10; d.$(c); var d = d.G(), f = ~~(d.width / c), l = ~~(d.height / c); e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l); a += d.height / 2 / c + 4 } Pa && (b || 0 == m.length && (!this.d || this.j) && 20 < this.size) && (null == this.J && (this.J = new ja(this.h() / 2, '#FFFFFF', !0, '#000000')), b = this.J, b.H(this.h() / 2), b.u(~~(this.size * this.size / 100)), c = Math.ceil(10 * g) / 10, b.$(c), d = b.G(), f = ~~(d.width / c), l = ~~(d.height / c), e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l)); e.restore() } } }; ja.prototype = { w: '', N: '#000000', P: !1, s: '#000000', r: 16, m: null, O: null, g: !1, v: 1, H: function (a) { this.r != a && (this.r = a, this.g = !0) }, $: function (a) { this.v != a && (this.v = a, this.g = !0) }, setStrokeColor: function (a) { this.s != a && (this.s = a, this.g = !0) }, u: function (a) { a != this.w && (this.w = a, this.g = !0) }, G: function () { null == this.m && (this.m = document.createElement('canvas'), this.O = this.m.getContext('2d')); if (this.g) { this.g = !1; var a = this.m, b = this.O, c = this.w, d = this.v, e = this.r, l = e + 'px Ubuntu'; b.font = l; var k = ~~(0.2 * e); a.width = (b.measureText(c).width + 6) * d; a.height = (e + k) * d; b.font = l; b.scale(d, d); b.globalAlpha = 1; b.lineWidth = 3; b.strokeStyle = this.s; b.fillStyle = this.N; this.P && b.strokeText(c, 3, e - k / 2); b.fillText(c, 3, e - k / 2) } return this.m } }; Date.now || (Date.now = function () { return (new Date).getTime() }); var Ua = { ca: function (a) { function b(a, b, c, d, e) { this.x = a; this.y = b; this.f = c; this.c = d; this.depth = e; this.items = [ ]; this.b = [ ] } var c = a.da || 2, d = a.ea || 4; b.prototype = { x: 0, y: 0, f: 0, c: 0, depth: 0, items: null, b: null, B: function (a) { for (var b = 0; b < this.items.length; ++b) { var c = this.items[b]; if (c.x >= a.x && c.y >= a.y && c.x < a.x + a.f && c.y < a.y + a.c) return !0 } if (0 != this.b.length) { var d = this; return this.V(a, function (b) { return d.b[b].B(a) }) } return !1 }, t: function (a, b) { for (var c = 0; c < this.items.length; ++c) b(this.items[c]); if (0 != this.b.length) { var d = this; this.V(a, function (c) { d.b[c].t(a, b) }) } }, i: function (a) { 0 != this.b.length ? this.b[this.U(a)].i(a) : this.items.length >= c && this.depth < d ? (this.aa(), this.b[this.U(a)].i(a)) : this.items.push(a) }, U: function (a) { return a.x < this.x + this.f / 2 ? a.y < this.y + this.c / 2 ? 0 : 2 : a.y < this.y + this.c / 2 ? 1 : 3 }, V: function (a, b) { return a.x < this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(0) || a.y >= this.y + this.c / 2 && b(2)) || a.x >= this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(1) || a.y >= this.y + this.c / 2 && b(3)) ? !0 : !1 }, aa: function () { var a = this.depth + 1, c = this.f / 2, d = this.c / 2; this.b.push(new b(this.x, this.y, c, d, a)); this.b.push(new b(this.x + c, this.y, c, d, a)); this.b.push(new b(this.x, this.y + d, c, d, a)); this.b.push(new b(this.x + c, this.y + d, c, d, a)); a = this.items; this.items = [ ]; for (c = 0; c < a.length; c++) this.i(a[c]) }, clear: function () { for (var a = 0; a < this.b.length; a++) this.b[a].clear(); this.items.length = 0; this.b.length = 0 } }; var e = { x: 0, y: 0, f: 0, c: 0 }; return { root: new b(a.X, a.Y, a.fa - a.X, a.ga - a.Y, 0), i: function (a) { this.root.i(a) }, t: function (a, b) { this.root.t(a, b) }, ia: function (a, b, c, d, f) { e.x = a; e.y = b; e.f = c; e.c = d; this.root.t(e, f) }, B: function (a) { return this.root.B(a) }, clear: function () { this.root.clear() } } } }; h.onload = Sa } }) (window, window.jQuery);
artemain / Sat= // @name MetaBot for YouTube // @namespace yt-metabot-user-js // @description More information about users and videos on YouTube. // @version 200322 // @homepageURL https://vk.com/public159378864 // @supportURL https://github.com/asrdri/yt-metabot-user-js/issues // @updateURL https://raw.githubusercontent.com/asrdri/yt-metabot-user-js/master/yt-metabot.meta.js // @downloadURL https://raw.githubusercontent.com/asrdri/yt-metabot-user-js/master/yt-metabot.user.js // @icon https://raw.githubusercontent.com/asrdri/yt-metabot-user-js/master/logo.png // @include https://*youtube.com/* // @include https://*dislikemeter.com/?v* // @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js // @require https://raw.githubusercontent.com/sizzlemctwizzle/GM_config/master/gm_config.js // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant GM.xmlHttpRequest // @run-at document-start // ==/UserScript== GM_config.init( { 'id': 'ytmetabot_config', 'title': 'MetaBot/YT Settings', 'fields': { 'option1': { 'label': 'Processing mode for comments by known bots', 'type': 'int', 'min': 1, 'max': 2, 'default': 1 }, 'option2': { 'label': 'Auto-dislike comments by known bots', 'type': 'checkbox', 'default': false }, 'option3': { 'label': 'Hide long like/dislike/share button text', 'type': 'checkbox', 'default': true }, 'option4': { 'label': 'Use additional lists', 'type': 'checkbox', 'default': true }, 'option5': { 'label': 'Send alert to server', 'type': 'checkbox', 'default': false }, 'listp1': { 'label': 'Bookmarks (personal list)', 'type': 'text', 'default': '' }, 'listc1': { 'label': 'Custom list URL 1', 'type': 'text', 'default': 'https://github.com/asrdri/yt-metabot-user-js/raw/master/list-sample.txt' }, 'listc2': { 'label': 'Custom list URL 2', 'type': 'text', 'default': '' }, 'listc3': { 'label': 'Custom list URL 3', 'type': 'text', 'default': '' }, 'colorp1': { 'label': 'Personal color', 'type': 'int', 'default': '33023' }, 'colorc1': { 'label': 'Custom color 1', 'type': 'int', 'default': '8388863' }, 'colorc2': { 'label': 'Custom color 2', 'type': 'int', 'default': '16744448' }, 'colorc3': { 'label': 'Custom color 3', 'type': 'int', 'default': '8421504' } }, }); const checkb = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAPCAMAAADXs89aAAAA+VBMVEUAAAD///+qqqp/f39mZmZubm5vb29sbGxtbW1tbW1tbW1ubm5ubm5tbW1ubm5tbW1ubm5ubm5ubm5tbW1tbW1ubm5ubm5tbW1ubm5ubm5tbW1ubm5ubm5vb29wcHBxcXFzc3N0dHR1dXV3d3d4eHh6enp7e3t8fHyAgICCgoKFhYWMjIyOjo6Pj4+QkJCSkpKUlJSWlpaZmZmampqdnZ2hoaGqqqqwsLC0tLS1tbW2tra5ubm+vr7ExMTKysrLy8vQ0NDR0dHS0tLU1NTV1dXW1tbe3t7i4uLj4+Pk5OTl5eXn5+fo6Ojq6urs7Ozu7u7w8PD9/f3////SCMufAAAAHHRSTlMAAAMEBSUnKCpbXV9htre6u87Q0dPp6uvs7u/8pkhKVQAAAMdJREFUeNpN0NdWwlAUANEbgvTeQhnQIE1B1ChYQcEC0gL+/8ewzPWwmMf9OMowDKWUP5YqU0pGTaXTHMqdOcM7G7LBIw4Vnc3b89i9BytwYH+uv7oAOqsbyJjCMb4d/urOgYhwqr55wmvdhIRwufXT0zzrgCVM1X2tA5xva1ARLvE4aQCMXoCCcJLaZNpvX71/3QJx4ShUBx+Lz4fp7hrCwmYWL3v5u7XTPmEVtLRfuk7+5OhJIKP9NO2psDIjCatSiId9/7oHY28awgWqV+8AAAAASUVORK5CYII='; const minf = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAM1BMVEUAAAB/f39vb29sbGxtbW1ubm5ubm5sbGxubm5ubm7////Pz8+Li4uampp8fHzb29uSkpKUSDd+AAAACXRSTlMABCcoXbfQ6/zS5clrAAAAYUlEQVQIHQXBAQLCMAgEsBxs+v/32oJJkE5lZ+8Suhu4Z7R6m2c/NVW28zbmew8xeV4A+FWgkjSkCuYDqAo4gNQCgK0BAFMLHsD2pqjL1rqnSSysOdt2U8C9I0insrN3+QOBPC04AhR0BwAAAABJRU5ErkJggg=='; const mred = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAApVBMVEUzMzP/MzP+MzP+MzP+MzP+MzP9MzP+NTP+NTP/XDP+NTP+NTP+MzP+MzP+NDP+NDP+PTP9NDP+OTP9MzP+NTP+NTP+MzP5MzP/MzP/////e3v/NTP/PT3/Tk7/YWH/UVH/TU3/9/f/+fn/cnL/5eX/QED/ZGT/09P/1tb/wcH/xcX/6Oj/Z2f/hYX/aWn/b2//39//cXH/dXX/oqL/paX/T0//dnb54rKOAAAAGHRSTlMABFzrJurQ1O4Fu+8nt7nQKv1ht17tzyc2HRLDAAAAj0lEQVQIHQXABVIDARAEwLmLuwK9SXB35/9Po5JktB5P9sP5tkmSZDlwsdvtfi2mSbI84rqqvuh1k9EAZ1V1h36TNZxW1Tm0GcOhqm5hlgm4rCvQyR7c1DNYZQju6wF0MgeP9QQ22YKX1zfQplnA+8cnHDfJtIfv+kGvmyQnfQ5/B/rdJEmadtZZdTZtk+QfVeIRvDroEMEAAAAASUVORK5CYII='; const imgdm = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAACfFBMVEUAAAD+wgD+wQD+wQD/qgD/vwD1ugD+wQD/vwD+wQD+wQD+wgD+wgD5vwD+xwD9wAD7vwD5vQD+wQD1uwD/zADyuAD0uQDyuADytwDzuADxtwDztwDytwDwuAD+wgDzuAD+wgDyuQD+wgD1ugDxtwD0tgBaanv+wgBEW5H+wAD+wQDytwDxtgBIXpL+wQBPZZb+wgD+wQBmeKP+wgBXa5r//wD+wQBic5ldcZ9ccJ5SZ5dEW5H+wgD+wgBlcHD+wAD+wQBEXZD+wQD3vADzuAB0dGltfaZKX5T+xAD6vgDfnwBGXJFVaZpfcp5EWpD/wgDyuAD+wQD19fVuf7OOeiHyugT7vwD+wgCykRY8RTno6OiGgF1oeq7ksQinsc3nswf7vwHyuwr8wQL9wQD2zEf068/18OP03pj20mGBgnjv7++oscV9e2dpe6/CmxL11nf18uv11nb9wAByaCn2uwCrjBj8wADl5uZqd5J+fGiXiE3rtAXj5einsMWZiUrz8/NYaI1SZ5xCSTj8wAH3yDX9wQK0mTpTaJtabqNZbqJUaZrh5Orb3OF1aihESjdSZ5r03ZP06cSAjalpcHemiRr6vgD09PTBmhKFf1+0vNTp6enbqwpeWy/YrR7GoizIoyuwlz2dqcM2QTtvgKjKpSmReyD4vgVpdo32zUnxugv3vgb7wAT6wQz1ugD0ugAoOD/6wAn179310FgwPT2ihhvEnBFZWDHl5eb5vQCEfmDR1Nvv8PLr6+uEkrFARzi4lBW3lBWMgljS1+Ht7e2VoLs/RziSfCC6wdivjxdHTDbN0t7n6e34vQLutwV/cCb4vQD10V318ef2yTv0uQDkLrBbAAAAT3RSTlMATOr6AwQ4shjgmfhtLBf5/vJjNQWgSfyz2PuA8CT3wOdUvsaHMR9+ZCn+jDi3t9Au+fR22AKW7+XlyjiC+zJB0Typ+MPO9xgaMwg61+5oF3I9zwAAAY1JREFUeAFtzfObG1EUxvETu7Zt2zb63snERVMbTZPatm3b7tr2/kN7JzO7d7PPfn79Pue8pLE6LbamzZr37NWbEjSxO6DyfenakgSdHkJ5h45G0rQwoL7brLVJuxBB9Y8NVDf0aCjatg1xdmD7Q8B/qwRAzAt4YxHWvhWR1QFcLgOWf10J4EQACFxBlHUncgK4+/PX7z+PwL1OS8/IzYOPtSOygCsofLG7FFzYEwx6wpBYJxPZ0Jhq1pm6QPjwftVqxH1mg8ggwqtjx6/e3KrYf+CgmbpBI+1ZukyWVxQrDh0+4qIeiPv47tr1G9tkOd+tuPN3Xx/qC27N2nXrN2zcpBVu85Z+1H8AENmxc9cnCf9FOZo0mGgIpIrKKgkQhds7lGjY8G/ff/jB3ePlvlYejCCikSdPnYbizNlz5y9cVL9dGsXL6DFQ+R8/efrsuTv0cuy48RMmEmecNBm13rxNTkmdQnWmToNGyszKzplOgkk3Qw9IvpmzZheF5sylBMZ5882uBbRw0eIlpKgB/8u5fuwF0eAAAAAASUVORK5CYII='; const imgdma = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABsFBMVEUAAAD+wQD+wgD/qgD+wQD/vwD+wQD+wgD+wgD+wQD+xwBatlz/vwD+wQBft1n+wQDxtwD1ugD9wADyuAD0uQD/zAD7vwD5vQDxtwDzuADyuQDztwDyuADytwDytwDytwDwuAD+wgD0tgCstyvzuAD1uwD+wgD+wgD+wgD+wAD+wQD+wQD+wgD+wQD+wgD//wD+wQD+wgD+wgD+wAD+wQD+wQD+xACtvC1Ztl3/wgD///97uEnyuAD+wQCBu1CWujp7xX32uwCOeiGrjBiykRabx2qc1J5nvWryugRat108RTn7vwH7vwD+wgD9wADxwAb4vQB/cCaSfCAoOD95tkmGt0CihhteWy+ReyDBmhIwPT1HTDb8wAB6t0n6vgD7wAT2zUn03ZP06cR4wXQ2QTv9wQD2zEf068/18OP03pj20mF5ulhyaCnutwX11nf18uv11nb6wQzbqwr10V318ef2yTvksQjCmxI/Rzj6wAn179310FimiRr8wAH3yDX9wQKV0ZdZWDFARzj0uQD5vQDnswdCSTi4lBVESjeKukCvjxe3lBV1aij0ugD4vQLEnBHgcTooAAAAOXRSTlMA6kwD+gTgbfiyF+gYmd5jh8b5/EkF/vL72FSAoLOM8CT3MVjANee+fin+ty75dgKWgvtB0akaVEpkodaYAAABOUlEQVR4XnXPVXMiURCG4SYES4C4u7uvfSO4S9zd3d3d1/5yOAWEGYq8N33xVFdXUyS9RqfOzM3LSK8kWSkGLcIF/lbXSCBJgVi9+UXKKKQlQ9q0UKyKbMgBeBRKwzcUiM+alc3EAJzsA8HLfwDsHsBj7xYKcoj0WuBPH3A88ATg2QE4XmEVCok0AMbGh//fjQDA6P3L79N+BIQSIh0AvE8sbm4x8dt8PpsfolCmIjUS9SCUU0UMesx8KKfTxPODQ1UkecbsZXGchQ0j1UZBnJySipfqwjAzOze/IJd6BkvLK6tr6xtyaWgEurd3dvdE8HKhJogHh0ciACcnyUXU3HJ2fhFEAqHWq+sbsEwWFsfdsuEOSVs7wsXfIVJ2dCYUVte3r4RUSd8VeJNKKn2m/PHTyMTlcjP49QE0u4VtSVu7kQAAAABJRU5ErkJggg=='; const imgdmd = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAZCAMAAACM5megAAAAllBMVEUAAAB/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAx6H3iAAAAMXRSTlMABAgMFBgcICQoLDA8QERITFBUWGBkaGx4fICDj5OXo6evs7e7v8PH09ff4+fr8/f7vr5GKgAAAN1JREFUGBl9wY1agjAABdAbIoSCWiIJLn8yLKNN7vu/XBvQJ87JOegZLfJDaew3U7ilklcfAW5EiTb7JGtRGFtq8hV9BTsntH5orNH3VrNx9mB4kkYdo29xoUPlAwgCtIKaLgJAqkI0BJ0qABEFGme6xQBUCXhhOOUDuycI7jCRHCAlmSDnsEsGrDjgmL6MAYxOfGyGTiwquikPV0s6bdF3oIMao+9Z8d4Gt5KadxJYMt7xYclok7AJar+KRvVFrYTtSC1Ca07tHbZvkhU6KbUlbPOiyCfo+OuiWOHfHxHEYF/PvYVrAAAAAElFTkSuQmCC'; const imgyto = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAACJVBMVEX///+qAADMMzP/MzPjKiXbJiPVIyPZJSPFGx/QIiLBGB7cKSXRIiLeKSnkKyfOICHcIiLRISLJHB7jKybCGB/QISHVKSDgKifMGRnhKyXMHR/CGR3ZJSPiLCbdKSXiKybFFyLCGR7WJCLdJyTDGB3JHSDhKiXIHB/ZJiPMHiHQIiLXIyPTIyLKHR/FGCDFGh/lMxnjKyXDGR3GGx/cJyTEGR7BGh7NICDUIiLOHiPcLiLiKyXgKSXhKyXPHyHXJSPNICDgKibgKSbJHB/XJCPnLiLfKSXfKSTfKSbDGR7EGR7KHB/CGR3CGB3CGB7BGB7BGB3BGR3////NHyHLHiDo4ODWJCPMHiD//v7p4eHaJyTZJiTYJiTOICHXJSPYJSPPICHeKSXQISHVJCPunZzFGh/UIyPqmpvnzMv89PTlxMTYUVL78vL08fHomZrzzM399/f+/Pzm09PXTk7QNDbfKiXGGx/pmprnj47XSUvktrbompryxMXVOTncKCXKHSDHHB/t5+f7+vrdKCXbJyTsnJvcOTfhgYDIHB/18fHqm5v05eXaMzHZVFTYTEvHGx/++vrZLy3spKThiYnTLi78+vrs19fqnJzYKynVNDXjrq7VPT7rm5vJHSDebm3XKCbRISLZWFrTIyLSIiLtrKzEGh7cZmXWJiXgKibvtLTWQ0Tlvr7bXVzfd3bwvL3sm5vjW1nTIiLDGh7hKybtnJviKybCGR58TkH5AAAAUnRSTlMAAwUFie17+rn8r7n8HzqvFu9b73vWH1sK54nnida5/BaYr1uJ7fqal+cWOu/6H5oKr/q5mls6H9Y6Fnzte3vnfJeYmOcW7Zqa7e2Y1u/8/O/WqnF1KAAAAb9JREFUeF6FzGOb61AYheGV1B3btu05tLHbsY1j27Zt2/h9k7SnyZt0p7m/ruda0BAi59VkxGVlxWXUtEUKMBJhTflLpFgjwNO6qPC3TuHiZQiStPwDR3sStCwr9hpYaQFRnTliKLOa/IWNhBCmftafDqk+0OUdM5EHn2jbGRO2aMiKexU/zvVyFUOS6OhTjG85cKWPw5EIIL1fNc7Y5fM3+4OlA8KCIdUfxtjde18fDOktFVA2SEih5OL0s+eDOmWwdxJnmc+pk7Pv3ndq2JE7Rsih/7Tn85cxKhfNk8R3qQmcdhy6SpZmlL8injDV1p6OR9eUpRyun4Qc0tNduwOLC+GviUuMmrl9R1nCEfOCoOGO+w/JEoOEUWJKyW7cOjpKJSBqmNjP/Ha+eTysFYX5A4Q/7P74aUBvIVo8hBx2fzvoCdYCoYSEhxk7stnDUSIAqV2qbdtfdnGlAmiq8Cr2ePkqmiBZctzUGshKC56aKCiFT+wFE7H4r+hESEUIEOuuh1AnQpHs3GfImQxCrJowUCVCq2HVW47VDQiSnVP7S6c2Jxs8lflp/4i0/EoYERrj3WvXrd+wcZM7vlEANQfRAClqAtKfNQAAAABJRU5ErkJggg=='; const regexdate = /joinedDateText(.*?)ext":"(.*?)ext":"(.*?)"}/; const regexdatemob = /joined_date_text(.*?)"}, {"text": "(.*?)"}]/; const regexid = /"video_id":"(.*?)"/; const regexlinew = /"logged_in","value":"(.*?)"/; const regexliold = /"logged_in":"(.*?)"/; const regexun = /"user_display_name":"(.*?)"/; const regexlang = /"host_language":"(.*?)"/; const regexlangmob = /\\"host_language\\": \\"(.*?)\\"/; const regexannyto = /(.*)(\r\n|\n\r|\n)([\W\w]+)/; const ERKYurl = 'https://raw.githubusercontent.com/FeignedAccomplice/Un-Yt-Kb-Rg/master/Un-Yt-Kb-Rg.CSV'; const annYTOurl = 'https://raw.githubusercontent.com/YTObserver/YT-ACC-DB/master/announcement.txt'; const minDCTime = 36*61; const maxDCTime = 71*58; const alerturl = 'https://кремлеботы.рф/alert'; const reporturl = 'tg://resolve?domain=observers_chat'; var alertSent = false; var annYTOtxt = []; var arrayERKY = []; var arrayListP1 = []; var arrayListC1 = []; var arrayListC2 = []; var arrayListC3 = []; var orderedClicksArray = []; var bDTaskSet = 0; var bDBlur = 0; var ytmode = 0; var listqueue = 0; var descc1 = ''; var descc2 = ''; var descc3 = ''; var iconsdef = ["\uD83D\uDCCC", "\uD83D\uDD32", "\uD83D\uDD34", "\uD83D\uDD3B"]; const iconstyledef = 'font-family: Segoe UI Symbol; line-height: 1em;'; const iconp1 = '<span style="' + iconstyledef + '">' + iconsdef[0] + '</span> '; const iconc1 = '<span style="' + iconstyledef + '">' + iconsdef[1] + '</span> '; const iconc2 = '<span style="' + iconstyledef + '">' + iconsdef[2] + '</span> '; const iconc3 = '<span style="' + iconstyledef + '">' + iconsdef[3] + '</span> '; var txtlistpadd = '\u2003<span id="listpadd" style="cursor: pointer; ' + iconstyledef + '" title="Добавить в закладки">' + iconsdef[0] + '</span>'; if (window.location.hostname == "dislikemeter.com" || window.location.hostname == "www.dislikemeter.com") { var videoid = getURLParameter('v', location.search); if (videoid) { waitForKeyElements('input#form_vid', function dmIDins(jNode) { var pNode = jNode[0]; pNode.value = videoid; }); return; } } else if (window.location.pathname == '/live_chat_replay' || window.location.pathname == '/live_chat') { var requestDB = new XMLHttpRequest(); requestDB.onreadystatechange = function() { if (requestDB.readyState === 4) { if (requestDB.status === 404) { console.log("[MetaBot for Youtube - Chat] XMLHttpRequest done: ERKY-db not found."); } if (requestDB.status === 200) { var responseDB = requestDB.responseText; if (responseDB !== "") { console.log("[MetaBot for Youtube - Chat] XMLHttpRequest done: ERKY-db loaded."); arrayERKY = responseDB.match(/[^\r\n=]+/g); waitForKeyElements('a.ytd-menu-navigation-item-renderer', parsechat); } else { console.log("[MetaBot for Youtube] XMLHttpRequest failed."); } } } }; requestDB.open("GET", ERKYurl, true); requestDB.send(null); } else { if (document.querySelector("meta[http-equiv='origin-trial']")) { console.log("[MetaBot for Youtube] YouTube New design detected."); ytmode = 1; } else if (document.querySelector("meta[http-equiv='Content-Type']")) { console.log("[MetaBot for Youtube] YouTube Mobile mode detected."); ytmode = 3; } else { console.log("[MetaBot for Youtube] YouTube Classic design detected."); ytmode = 2; txtlistpadd = '\u2003<span id="listpadd" style="cursor: pointer; color: #767676;' + iconstyledef + '" title="Добавить в закладки">' + iconsdef[0] + '</span>'; } if (ytmode !== 3) { listqueue++; getlist(filllist, -1, annYTOurl); } listqueue++; getlist(filllist, 0, ERKYurl); if (GM_config.get('option4') === true) { arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); if (GM_config.get('listc1') !== '') { listqueue++; getlist(filllist, 1, GM_config.get('listc1')); } if (GM_config.get('listc2') !== '') { listqueue++; getlist(filllist, 2, GM_config.get('listc2')); } if (GM_config.get('listc3') !== '') { listqueue++; getlist(filllist, 3, GM_config.get('listc3')); } } waitforlists(); } function filllist(numArr, response, code, url) { if (code !== 200) { console.log("[MetaBot for Youtube] List load error. URL " + url + " Code " + code); } else { switch (numArr) { case -1: annYTOtxt = regexannyto.exec(response); var dbname = "YTO announcement"; switch (ytmode) { case 1: waitForKeyElements('ytd-comments-header-renderer.ytd-item-section-renderer', insertannNew); break; case 2: waitForKeyElements('div.comments-header-renderer', insertann); } break; case 0: arrayERKY = response.match(/[^\r\n=]+/g); var dbname = "ERKY-db"; break; case 1: arrayListC1 = response.match(/[^\r\n=]+/g); var dbname = "Custom list #1"; descc1 = '[' + (arrayListC1.length / 2 - 1) + '] ' + Aparse(arrayListC1[0]) + ': ' + Aparse(arrayListC1[1]) + '<br>\u2003'; break; case 2: arrayListC2 = response.match(/[^\r\n=]+/g); var dbname = "Custom list #2"; descc2 = '[' + (arrayListC2.length / 2 - 1) + '] ' + Aparse(arrayListC2[0]) + ': ' + Aparse(arrayListC2[1]) + '<br>\u2003'; break; case 3: arrayListC3 = response.match(/[^\r\n=]+/g); var dbname = "Custom list #3"; descc3 = '[' + (arrayListC3.length / 2 - 1) + '] ' + Aparse(arrayListC3[0]) + ': ' + Aparse(arrayListC3[1]) + '<br>\u2003'; } if (code === 200) { console.log("[MetaBot for Youtube] " + dbname + " loaded. Code " + code); } else { console.log("[MetaBot for Youtube] " + dbname + " load error. Code " + code); } } listqueue--; } function waitforlists() { if (listqueue === 0) { switch (ytmode) { case 1: spinnercheckNew(); waitForKeyElements('div#main.style-scope.ytd-comment-renderer', parseitemNew); waitForKeyElements('yt-view-count-renderer.style-scope.ytd-video-primary-info-renderer', preparedmNew); waitForKeyElements('div#channel-header.ytd-c4-tabbed-header-renderer', insertchanNew); break; case 2: waitForKeyElements('.comment-renderer-header', parseitem); waitForKeyElements('div#watch7-views-info', insertdm); waitForKeyElements('div#c4-primary-header-contents.primary-header-contents.clearfix', insertchan); break; case 3: waitForKeyElements('div.brb', parseitemMob); } return; } else { setTimeout(waitforlists, 500); } } function parsechat(jNode) { if ($(jNode)[0].hasAttribute('href')) { var deftxt = $(jNode).find('yt-formatted-string.ytd-menu-navigation-item-renderer')[0].innerHTML; markchatmenu(jNode, deftxt); var mutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { markchatmenu(jNode, deftxt); }); }); mutationObserver.observe($(jNode)[0], { attributes: true, attributeFilter: ['href'], characterData: false, childList: false, subtree: false, attributeOldValue: false, characterDataOldValue: false }); } } function markchatmenu(jNode, deftxt) { var userID = $(jNode)[0].href.split('/').pop(); var foundID = arrayERKY.indexOf(userID); if (foundID > -1) { $(jNode).parent()[0].style.backgroundColor = 'rgba(255,50,50,0.3)'; $(jNode).find('yt-formatted-string.ytd-menu-navigation-item-renderer')[0].innerHTML = deftxt + '<br><img src="' + mred + '" /> ' + arrayERKY[foundID + 1]; } else { $(jNode).parent()[0].style.backgroundColor = ''; $(jNode).find('yt-formatted-string.ytd-menu-navigation-item-renderer')[0].innerHTML = deftxt; } } function spinnercheckNew() { waitForKeyElements('paper-spinner-lite.ytd-item-section-renderer[aria-hidden="true"]', function(jNode) { if (getURLParameter('v', location.search) === null) { return; } console.log("[MetaBot for Youtube] Comment sorting spinner found."); var mutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if ($(jNode).find("#spinnerContainer").hasClass("cooldown")) { setTimeout(recheckallNew, 2000); } else { $('div#main.style-scope.ytd-comment-renderer').each(function() { var cNode = $(this).find(".published-time-text")[0]; deleteitemNew(this, $(cNode).find("a")[0].href); }); } }); }); mutationObserver.observe($(jNode)[0], { attributes: true, attributeFilter: ['active'], characterData: false, childList: false, subtree: true, attributeOldValue: false, characterDataOldValue: false }); }, false); waitForKeyElements('div#continuations.ytd-item-section-renderer', function(jNode) { if (getURLParameter('v', location.search) === null) { return; } console.log("[MetaBot for Youtube] Comment loading spinner found."); var mutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (!$(jNode).find("#spinnerContainer").hasClass("cooldown")) { setTimeout(recheckallNew, 2000); } }); }); mutationObserver.observe($(jNode)[0], { attributes: true, attributeFilter: ['active'], characterData: false, childList: false, subtree: true, attributeOldValue: false, characterDataOldValue: false }); }, false); waitForKeyElements('paper-spinner#spinner.yt-next-continuation[active]', function(jNode) { if (getURLParameter('v', location.search) === null) { return; } console.log("[MetaBot for Youtube] Comment replies loading spinner found."); var mutationObserver = new MutationObserver(function(mutations) { if (mutations[0].removedNodes) { mutationObserver.disconnect(); setTimeout(recheckallNew, 2000); } }); mutationObserver.observe($(jNode)[0].parentNode, { attributes: true, characterData: false, childList: false, subtree: false, attributeOldValue: false, characterDataOldValue: false }); }, false); } function recheckallNew(){ $('div#main.style-scope.ytd-comment-renderer').each(function() { recheckNew(this); }); } function insertchan(jNode) { var noticespan = document.createElement('div'); var chanURL = $(jNode).find('a.spf-link.branded-page-header-title-link.yt-uix-sessionlink')[0].href; var userID = chanURL.split('/').pop(); var foundID = arrayERKY.indexOf(userID); if (foundID > -1) { noticespan.innerHTML = '<img src="' + mred + '" /> Пользователь найден в ЕРКЮ, дата регистрации: <a href="' + chanURL + '/about" title="Открыть страницу с датой регистрации">' + arrayERKY[foundID + 1] + "</a>"; noticespan.style = 'background:rgba(255,50,50,0.3);border-radius:5px;padding:4px 7px 4px 7px'; } else { noticespan.innerHTML = 'Пользователь не найден в ЕРКЮ <a href="' + chanURL + '/about"><img src="' + minf + '" title="Открыть страницу с датой регистрации" /></a>'; noticespan.style = 'background:rgba(100,100,100,0.2);border-radius:5px;padding:4px 7px 4px 7px'; } noticespan.id = 'erkynotice'; $(jNode).find('h1.branded-page-header-title').append(noticespan); } function insertchanNew(jNode) { this.addEventListener('yt-navigate-finish', function insertchanNewR() { this.removeEventListener('yt-navigate-finish', insertchanNewR); setTimeout(insertchanNew, 300, jNode); }); var chanURL = window.location.protocol + '//' + window.location.hostname + window.location.pathname.replace(/\/featured|\/videos|\/playlists|\/channels|\/discussion|\/about/i, ''); if (chanURL.slice(-1) == '/') { chanURL = chanURL.slice(0, -1); } var reuse = false; var userID = chanURL.split('/').pop(); if ($(jNode).find('span#subscriber-count.ytd-c4-tabbed-header-renderer')[0]) { var noticespan = $(jNode).find('span#subscriber-count.ytd-c4-tabbed-header-renderer')[0]; reuse = true; } else { var noticespan = document.createElement('span'); noticespan.id = 'subscriber-count'; noticespan.classList.add("ytd-c4-tabbed-header-renderer"); } var foundID = arrayERKY.indexOf(userID); if (foundID > -1) { noticespan.innerHTML = '<img src="' + mred + '" /> Пользователь найден в ЕРКЮ, дата регистрации: <a href="' + chanURL + '/about" style="color:hsl(206.1, 79.3%, 52.7%);text-decoration:none" title="Открыть страницу с датой регистрации">' + arrayERKY[foundID + 1] + "</a>"; noticespan.style = 'background:rgba(255,50,50,0.3);border-radius:5px;padding:4px 7px 4px 7px;font-weight:400;line-height:3rem;text-transform:none;color:var(--yt-lightsource-primary-title-color)'; } else { noticespan.innerHTML = 'Пользователь не найден в ЕРКЮ <a href="' + chanURL + '/about"><img src="' + minf + '" title="Открыть страницу с датой регистрации" /></a>'; noticespan.style = 'background:rgba(100,100,100,0.2);border-radius:5px;padding:4px 7px 4px 7px;font-weight:400;line-height:3rem;text-transform:none;color:var(--yt-lightsource-primary-title-color)'; } if (!reuse) { $(jNode).find('ytd-channel-name#channel-name.ytd-c4-tabbed-header-renderer').after(noticespan); $(jNode).find('span#subscriber-count.ytd-c4-tabbed-header-renderer').after('<br>'); } } function insertdm(jNode) { var videoid = getURLParameter('v', location.search); var pNode = $(jNode)[0]; var newspan = document.createElement('span'); newspan.innerHTML = '<a id="dmAdd" title="Добавить видео на анализатор Дизлайкметр" href="https://dislikemeter.com/?v=' + videoid + '"><img src="' + imgdma + '" /></a><span style="padding:0 1em 0 0"></span><a style="padding:0 0 0 1px" id="dmGo" title="Открыть статистику видео на анализаторе Дизлайкметр" href="https://dislikemeter.com/video/' + videoid + '" ><img src="' + imgdm + '" /></a>'; newspan.id = 'dmPanel'; $(pNode).css('text-align', 'right'); pNode.insertBefore(newspan, pNode.firstChild); $(pNode).find("#dmPanel")[0].addEventListener("click", function dmClick() { this.removeEventListener("click", dmClick); var newspan = document.createElement('span'); newspan.innerHTML = '<a target="_blank" title="Помочь проекту Дизлайкметр" href="https://dislikemeter.com/?donate"><img src="' + imgdmd + '" /></a><span style="padding:0 1em 0 0"></span>'; $(pNode).find("#dmPanel")[0].insertBefore(newspan, $(pNode).find("#dmPanel")[0].firstChild); }, false); $(pNode).find("#dmPanel")[0].addEventListener("mouseover", function dmOver() { this.removeEventListener("mouseover", dmOver); $(this).find("#dmAdd")[0].target = "_blank"; $(this).find("#dmGo")[0].target = "_blank"; }, false); } function preparedmNew(jNode) { this.addEventListener('yt-navigate-finish', function preparedmNewR() { this.removeEventListener('yt-navigate-finish', preparedmNewR); setTimeout(preparedmNew, 300, jNode); }); var videoid = getURLParameter('v', location.search); if (!videoid) { console.log("[MetaBot for Youtube] Dislikemeter: video id not found."); return; } var pNode = $(jNode).parent().parent().parent().find('div#flex')[0]; if (typeof pNode === 'undefined') { console.log("[MetaBot for Youtube] Dislikemeter: node not found."); return; } pNode.innerHTML = ''; if (GM_config.get('option3')) { var btnText = $(pNode).parent().find('ytd-button-renderer.ytd-menu-renderer')[0]; if ($(btnText).find('yt-formatted-string#text').length > 0) { $(btnText).find('yt-formatted-string#text').html(''); } if (!$(pNode).parent().find('ytd-sentiment-bar-renderer#sentiment').is(":visible")) { btnText = $(pNode).parent().find('ytd-toggle-button-renderer.ytd-menu-renderer.force-icon-button')[0]; $(btnText).find('yt-formatted-string#text').html(''); btnText = $(pNode).parent().find('ytd-toggle-button-renderer.ytd-menu-renderer.force-icon-button')[1]; $(btnText).find('yt-formatted-string#text').html(''); } } console.log("[MetaBot for Youtube] Dislikemeter: requesting data for video id " + videoid); getlist(insertdmNew, pNode, 'https://dislikemeter.com/iframe/?vid=' + videoid); } function insertdmNew(jNode, response, code, url) { if (response.indexOf('"submit"') >= 0){ console.log("[MetaBot for Youtube] Dislikemeter: video already added."); var dmurl = url.replace('iframe/?vid=', 'video/'); var dmtxt = 'Открыть статистику видео на анализаторе Дизлайкметр'; var dmclr = 'var(--yt-spec-call-to-action)'; } else { console.log("[MetaBot for Youtube] Dislikemeter: video not added yet."); var dmurl = url.replace('iframe/?vid=', '?v='); var dmtxt = 'Добавить видео на анализатор Дизлайкметр'; var dmclr = 'var(--yt-spec-icon-inactive)'; } jNode.style.textAlign = "right"; var dmbutton = document.createElement('ytd-button-renderer'); dmbutton.id = 'dmbutton'; dmbutton.setAttribute('button-renderer', ''); dmbutton.setAttribute('is-icon-button', ''); dmbutton.classList.add("style-scope"); dmbutton.classList.add("ytd-menu-renderer"); dmbutton.classList.add("force-icon-button"); dmbutton.classList.add("style-default"); dmbutton.classList.add("size-default"); dmbutton.style.marginTop = "3px"; dmbutton.style.marginRight = "4px"; $(jNode).prepend(dmbutton); $(jNode).find('ytd-button-renderer#dmbutton').html('<a class="yt-simple-endpoint style-scope ytd-button-renderer"><yt-icon-button id="button" class="style-scope ytd-button-renderer style-default size-default" style="padding:8px;width:36px;height:36px;color:rgb(255,200,0)" onclick="window.open(\'' + dmurl + '\', \'_blank\');"><svg viewBox="0 0 20 20" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%; fill:' + dmclr + '"><g class="style-scope yt-icon"><path d="m0 2c0 5.5 8 5.5 8 0 0-1-2-1-2 0 0 3-4 3-4 0 0-1-2-1-2 0m12 0c0 5.5 8 5.5 8 0 0-1-2-1-2 0 0 3-4 3-4 0 0-1-2-1-2 0m-12 16q2-6.5 10-6.5v2q-6 0-8 4.5c0 0.5-2 0.7-2 0m6 2v-3l4-1v4m1 0v-8h4v8m1 0v-11l4-1v12" class="style-scope yt-icon"></path></g></svg></yt-icon-button><paper-tooltip>' + dmtxt + '</paper-tooltip></a>'); } function insertann(jNode) { $(jNode).find('h2.comment-section-header-renderer')[0].style = 'padding-bottom:10;display:inline-flex;align-items:center;line-height:2rem'; var cfgspan = document.createElement('span'); cfgspan.innerHTML = '<span style="opacity:0.4">[</span><span style="font-family: Segoe UI Symbol; color: #848484">\uD83D\uDD27</span><span style="opacity:0.4">]</span>'; cfgspan.id = 'cfgbtn'; cfgspan.title = 'Настройки MetaBot for YouTube'; cfgspan.style = 'margin:-4px 0 0 0.5em;font-size:2.3em;height:2rem;cursor:pointer;color:#000'; $(jNode).find('h2.comment-section-header-renderer').append(cfgspan); var annspan = document.createElement('span'); annspan.innerHTML = '<span style="display:inline-flex;align-items:center"><span style="opacity:0.4">[</span><span style="font-family: Segoe UI Symbol; color: #af1611">\uD83D\uDCE3</span><span style="color:#555;font-size:0.5em;font-weight:420;margin:-1.8em 0.2em 0 0.2em;height:0.3em;text-transform:none">' + Aparse(annYTOtxt[1]) + '</span><span style="opacity:0.4">]</span></span>'; annspan.id = 'annbtn'; annspan.title = 'Последняя информация от Наблюдателя YouTube (#ЕРКЮ)'; annspan.style = 'margin:-4px 0 0 0.5em;font-size:2.3em;height:2rem;cursor:pointer;color:#000'; $(jNode).find('h2.comment-section-header-renderer').append(annspan); var ytoinfosspan = document.createElement('span'); ytoinfosspan.innerHTML = '<span style="float:left;width:40px"><img src="' + imgyto + '" width="40px" height="40px" /></span><span style="float:right;margin: 0 0 0 10px;width:520px"><span id="urlyto" style="font-weight:500;cursor:pointer" data-url="https://www.youtube.com/channel/UCwBID52XA-aajCKYuwsQxWA">Наблюдатель Youtube #ЕРКЮ</span><br><span class="yt-badge" style="margin:4px 0 4px 0;text-align:center;text-transform:none;font-weight:500;width:100%;background-color:hsla(0, 0%, 93.3%, .6)">' + Aparse(annYTOtxt[1]) + '</span><span id="annholder"></span></span>'; ytoinfosspan.id = 'ytoinfo'; ytoinfosspan.style = 'max-width:605px;margin:0 auto 1em auto;display:table'; $(ytoinfosspan).toggle(); $(jNode).find('h2.comment-section-header-renderer').after(ytoinfosspan); $(jNode).find("span#ytoinfo").toggle(); var settingsspan = document.createElement('span'); settingsspan.innerHTML = '<span style="float:left;width:100px"><img src="https://raw.githubusercontent.com/asrdri/yt-metabot-user-js/master/logo.png" width="100px" height="100px" /></span><span style="float:right;margin: 0 0 0 10px;width:460px"><span style="font-weight:500">' + GM_info.script.name + ' v' + GM_info.script.version + '</span>\u2003<span id="urlgithub" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/">GitHub</span>\u2003<span id="urlissues" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/issues">Предложения и баги</span>\u2003<span id="urllists" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/issues/23">Списки</span><span class="yt-badge" style="margin:4px 0 4px 0;text-align:center;text-transform:none;font-weight:500;width:100%;background-color:hsla(0, 0%, 93.3%, .6)">Настройки</span>Комментарии от известных ботов из ЕРКЮ <select id="mbcddm1"><option value="1">помечать</option><option value="2">скрывать</option></select><span id="mbcswg1"><br style="line-height:2em"><label title="Информация о наличии ботов под роликом будет отправлена на кремлеботы.рф"><input type="checkbox" id="mbcbox4">Уведомлять сервер при обнаружении ботов</label><br style="line-height:2em"><label title="Пункт 5.1.H Условий использования YouTube не нарушается - запросы отправляются со значительным интервалом"><input type="checkbox" id="mbcbox1">Автоматически ставить <span style="font-family: Segoe UI Symbol">\uD83D\uDC4E</span> комментариям от ботов из ЕРКЮ</label></span><br style="line-height:2em"><label><input type="checkbox" id="mbcbox3">Дополнительные списки</label><span id="mbcswg2"><br style="line-height:2em">' + iconp1 + ' Закладки: <input type="color" id="colorpersonal" style="height: 1rem; width: 40px"><br style="line-height:1.8em"><textarea id="listpersonal" rows="3" style="width: 440px"></textarea><br style="line-height:1.2em">Сторонние списки:<br>' + iconc1 + descc1 + '<input type="text" id="listcustom1" style="height: 1rem; width: 385px"> <input type="color" id="colorcustom1" style="height: 1rem; width: 40px"><br>' + iconc2 + descc2 + '<input type="text" id="listcustom2" style="height: 1rem; width: 385px"> <input type="color" id="colorcustom2" style="height: 1rem; width: 40px"><br>' + iconc3 + descc3 + '<input type="text" id="listcustom3" style="height: 1rem; width: 385px"> <input type="color" id="colorcustom3" style="height: 1rem; width: 40px"></span><br style="line-height:2em"><span id="classicbtn" style="cursor:pointer">Включить новый дизайн YouTube</span><br><span id="resetbtn" style="cursor:pointer">Сбросить настройки</span><span id="configsaved" class="yt-badge" style="margin:4px 0 4px 0;text-align:center;text-transform:none;font-weight:500;width:100%;background-color:hsla(0, 0%, 93.3%, .6);display:none;-webkit-transition: background-color 0.3s ease-in-out;-moz-transition: background-color 0.3s ease-in-out;-ms-transition: background-color 0.3s ease-in-out;-o-transition: background-color 0.3s ease-in-out;transition: background-color 0.3s ease-in-out;">Настройки сохранены. Для вступления в силу необходимо <span style="cursor:pointer;text-decoration: underline" onclick="javascript:window.location.reload();">\uD83D\uDD03обновить страницу</span>.</span></span>'; settingsspan.id = 'config'; settingsspan.style = 'max-width:605px;margin:0 auto 1em auto;display:table'; $(settingsspan).toggle(); $(jNode).find('h2.comment-section-header-renderer').after(settingsspan); $(jNode).find("span#config").toggle(); var annexspan = document.createElement('span'); annexspan.innerHTML = Aparse(annYTOtxt[3]); $(jNode).find('span#annholder').append(annexspan); $(jNode).find("span#cfgbtn")[0].addEventListener("click", function() { $(jNode).find("span#config").toggle(); $(jNode).find("span#ytoinfo").hide(); }, false); $(jNode).find("span#annbtn")[0].addEventListener("click", function() { $(jNode).find("span#ytoinfo").toggle(); $(jNode).find("span#config").hide(); }, false); $(jNode).find("span#cfgbtn").hover(function() { this.style.backgroundColor = 'hsl(206.1, 79.3%, 52.7%)'; }, function() { this.style.backgroundColor = ''; }); $(jNode).find("span#annbtn").hover(function() { this.style.backgroundColor = 'hsl(206.1, 79.3%, 52.7%)'; }, function() { this.style.backgroundColor = ''; }); $(jNode).find("span#classicbtn, span#resetbtn").hover(function() { this.style.textDecoration = "underline"; }, function() { this.style.textDecoration = ""; }); $(jNode).find("span#urlgithub, span#urlissues, span#urllists, span#urlyto").hover(function() { this.style.textDecoration = "underline"; this.style.color = "hsl(206.1, 79.3%, 52.7%)"; }, function() { this.style.textDecoration = ""; this.style.color = ""; }); $(jNode).find("span#urlgithub, span#urlissues, span#urllists, span#urlyto").click(function() { window.open($(this).attr('data-url')); }); $(jNode).find("span#classicbtn").click(function() { ytNewDesign(); saveconfig(jNode); }); $(jNode).find("span#resetbtn").click(function() { resetconfig(jNode); saveconfig(jNode); }); $(jNode).find("select#mbcddm1").val(GM_config.get('option1')); $(jNode).find("input#mbcbox1").prop('checked', GM_config.get('option2')); $(jNode).find("input#mbcbox3").prop('checked', GM_config.get('option4')); $(jNode).find("input#mbcbox4").prop('checked', GM_config.get('option5')); $(jNode).find("textarea#listpersonal").text(GM_config.get('listp1')); $(jNode).find("input#listcustom1").val(GM_config.get('listc1')); $(jNode).find("input#listcustom2").val(GM_config.get('listc2')); $(jNode).find("input#listcustom3").val(GM_config.get('listc3')); $(jNode).find("input#colorpersonal").val(parseColor(GM_config.get('colorp1'), false)); $(jNode).find("input#colorcustom1").val(parseColor(GM_config.get('colorc1'), false)); $(jNode).find("input#colorcustom2").val(parseColor(GM_config.get('colorc2'), false)); $(jNode).find("input#colorcustom3").val(parseColor(GM_config.get('colorc3'), false)); if ($(jNode).find("select#mbcddm1").val() == 2) { $(jNode).find("span#mbcswg1").hide(); } if ($(jNode).find("input#mbcbox3").prop('checked') == false) { $(jNode).find("span#mbcswg2").hide(); } $(jNode).find("input#mbcbox1, input#mbcbox3, input#mbcbox4, select#mbcddm1, textarea#listpersonal, input#listcustom1, input#listcustom2, input#listcustom3, input#colorpersonal, input#colorcustom1, input#colorcustom2, input#colorcustom3").change(function() { if ($(jNode).find("select#mbcddm1").val() == 2) { $(jNode).find("span#mbcswg1").hide(); } else { $(jNode).find("span#mbcswg1").show(); } if ($(jNode).find("input#mbcbox3").prop('checked') == false) { $(jNode).find("span#mbcswg2").hide(); } else { $(jNode).find("span#mbcswg2").show(); } saveconfig(jNode); }); } function insertannNew(jNode) { waitForKeyElements('div#icon-label.yt-dropdown-menu', function(jNode) { jNode[0].innerHTML = ''; $(jNode).parent()[0].setAttribute("style","margin-top:-0.1em;height:1.9em;width:2.9em"); $(jNode).parent().hover(function() { this.style.backgroundColor = 'hsl(206.1, 79.3%, 52.7%)'; }, function() { this.style.backgroundColor = ''; }); }, false); var cfgspan = document.createElement('span'); cfgspan.innerHTML = '<span style="opacity:0.4">[</span><span style="font-family: Segoe UI Symbol; color: #848484">\uD83D\uDD27</span><span style="opacity:0.4">]</span>'; cfgspan.id = 'cfgbtn'; cfgspan.title = 'Настройки MetaBot for YouTube'; cfgspan.style = 'margin:-6px 0 0 0.5em;font-size:3em;height:1.05em;display:inline-flex;align-items:center;cursor:pointer'; cfgspan.classList.add("content"); cfgspan.classList.add("ytd-video-secondary-info-renderer"); $(jNode).find('div#title').append(cfgspan); var annspan = document.createElement('span'); annspan.innerHTML = '<span style="opacity:0.4">[</span><span style="font-family: Segoe UI Symbol; color: #af1611">\uD83D\uDCE3</span><span style="font-size:0.5em;font-weight:420;margin:0 0.2em 0 0.2em">' + Aparse(annYTOtxt[1]) + '</span><span style="opacity:0.4">]</span>'; annspan.id = 'annbtn'; annspan.title = 'Последняя информация от Наблюдателя YouTube (#ЕРКЮ)'; annspan.style = 'margin:-6px 0 0 0.5em;font-size:3em;height:1.05em;display:inline-flex;align-items:center;cursor:pointer'; annspan.classList.add("content"); annspan.classList.add("ytd-video-secondary-info-renderer"); $(jNode).find('div#title').append(annspan); var ytoinfosspan = document.createElement('span'); ytoinfosspan.innerHTML = '<span style="float:left;width:40px"><img src="' + imgyto + '" width="40px" height="40px" /></span><span style="float:right;margin: 0 0 0 10px;width:585px"><span id="urlyto" style="font-weight:500;cursor:pointer" data-url="https://www.youtube.com/channel/UCwBID52XA-aajCKYuwsQxWA">Наблюдатель Youtube #ЕРКЮ</span><span class="badge badge-style-type-simple ytd-badge-supported-renderer" style="margin:4px 0 4px 0;text-align:center">' + Aparse(annYTOtxt[1]) + '</span><span id="annholder"></span></span>'; ytoinfosspan.id = 'ytoinfo'; ytoinfosspan.classList.add("description"); ytoinfosspan.classList.add("content"); ytoinfosspan.classList.add("ytd-video-secondary-info-renderer"); ytoinfosspan.style = 'font-size:1.4rem;max-width:640px;margin:-10px auto 1em auto;display:none'; $(jNode).find('div#title').after(ytoinfosspan); var settingsspan = document.createElement('span'); settingsspan.innerHTML = '<span style="float:left;width:100px"><img src="https://raw.githubusercontent.com/asrdri/yt-metabot-user-js/master/logo.png" width="100px" height="100px" /></span><span style="float:right;margin: 0 0 0 10px;width:525px"><span style="font-weight:500">' + GM_info.script.name + ' v' + GM_info.script.version + '</span>\u2003<span id="urlgithub" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/">GitHub</span>\u2003<span id="urlissues" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/issues">Предложения и баги</span>\u2003<span id="urllists" style="cursor:pointer" data-url="https://github.com/asrdri/yt-metabot-user-js/issues/23">Списки</span><span class="badge badge-style-type-simple ytd-badge-supported-renderer" style="margin:4px 0 4px 0;text-align:center">Настройки</span>Комментарии от известных ботов из ЕРКЮ <select id="mbcddm1"><option value="1">помечать</option><option value="2">скрывать</option></select><span id="mbcswg1"><br style="line-height:2em"><label title="Информация о наличии ботов под роликом будет отправлена на кремлеботы.рф"><input type="checkbox" id="mbcbox4">Уведомлять сервер при обнаружении ботов</label><br style="line-height:2em"><label title="Пункт 5.1.H Условий использования YouTube не нарушается - запросы отправляются со значительным интервалом"><input type="checkbox" id="mbcbox1">Автоматически ставить <span style="font-family: Segoe UI Symbol">\uD83D\uDC4E</span> комментариям от ботов из ЕРКЮ</label></span><br style="line-height:2em"><label title="Актуально для русского интерфейса и небольшой ширины окна браузера"><input type="checkbox" id="mbcbox2">Скрывать длинные подписи кнопок Мне (не) понравилось / Поделиться</label><br style="line-height:2em"><label><input type="checkbox" id="mbcbox3">Дополнительные списки</label><span id="mbcswg2"><br style="line-height:2em">' + iconp1 + ' Закладки: <input type="color" id="colorpersonal" style="height: 1.8rem; width: 40px"><br style="line-height:1.8em"><textarea id="listpersonal" rows="3" style="width: 500px"></textarea><br style="line-height:1.2em">Сторонние списки:<br>' + iconc1 + descc1 + '<input type="text" id="listcustom1" style="height: 1.7rem; width: 440px"> <input type="color" id="colorcustom1" style="height: 1.8rem; width: 40px"><br>' + iconc2 + descc2 + '<input type="text" id="listcustom2" style="height: 1.7rem; width: 440px"> <input type="color" id="colorcustom2" style="height: 1.8rem; width: 40px"><br>' + iconc3 + descc3 + '<input type="text" id="listcustom3" style="height: 1.7rem; width: 440px"> <input type="color" id="colorcustom3" style="height: 1.8rem; width: 40px"></span><br style="line-height:2em"><span id="classicbtn" style="cursor:pointer">Включить классический дизайн YouTube</span><br><span id="resetbtn" style="cursor:pointer">Сбросить настройки</span><span id="configsaved" class="badge badge-style-type-simple ytd-badge-supported-renderer" style="margin:4px 0 4px 0;text-align:center;display:none;-webkit-transition: background-color 0.3s ease-in-out;-moz-transition: background-color 0.3s ease-in-out;-ms-transition: background-color 0.3s ease-in-out;-o-transition: background-color 0.3s ease-in-out;transition: background-color 0.3s ease-in-out;">Настройки сохранены. Для вступления в силу необходимо <span style="cursor:pointer;text-decoration: underline" onclick="javascript:window.location.reload();"><span style="font-family: Segoe UI Symbol">\uD83D\uDD03</span>обновить страницу</span>.</span></span>'; settingsspan.id = 'config'; settingsspan.classList.add("description"); settingsspan.classList.add("content"); settingsspan.classList.add("ytd-video-secondary-info-renderer"); settingsspan.style = 'font-size:1.4rem;max-width:635px;margin:-10px auto 1em auto;display:none'; $(jNode).find('div#title').after(settingsspan); var annexspan = document.createElement('span'); annexspan.innerHTML = Aparse(annYTOtxt[3]); annexspan.classList.add("content"); annexspan.classList.add("ytd-video-secondary-info-renderer"); $(jNode).find('span#annholder').append(annexspan); $(jNode).find("span#cfgbtn")[0].addEventListener("click", function() { $(jNode).find("span#config").toggle(); $(jNode).find("span#ytoinfo").hide(); }, false); $(jNode).find("span#annbtn")[0].addEventListener("click", function() { $(jNode).find("span#ytoinfo").toggle(); $(jNode).find("span#config").hide(); }, false); $(jNode).find("span#cfgbtn").hover(function() { this.style.backgroundColor = 'hsl(206.1, 79.3%, 52.7%)'; }, function() { this.style.backgroundColor = ''; }); $(jNode).find("span#annbtn").hover(function() { this.style.backgroundColor = 'hsl(206.1, 79.3%, 52.7%)'; }, function() { this.style.backgroundColor = ''; }); $(jNode).find("span#classicbtn, span#resetbtn").hover(function() { this.style.textDecoration = "underline"; }, function() { this.style.textDecoration = ""; }); $(jNode).find("span#urlgithub, span#urlissues, span#urllists, span#urlyto").hover(function() { this.style.textDecoration = "underline"; this.style.color = "hsl(206.1, 79.3%, 52.7%)"; }, function() { this.style.textDecoration = ""; this.style.color = ""; }); $(jNode).find("span#urlgithub, span#urlissues, span#urllists, span#urlyto").click(function() { window.open($(this).attr('data-url')); }); $(jNode).find("span#classicbtn").click(function() { ytOldDesign(); saveconfigNew(jNode); }); $(jNode).find("span#resetbtn").click(function() { resetconfigNew(jNode); saveconfigNew(jNode); }); $(jNode).find("select#mbcddm1").val(GM_config.get('option1')); $(jNode).find("input#mbcbox1").prop('checked', GM_config.get('option2')); $(jNode).find("input#mbcbox2").prop('checked', GM_config.get('option3')); $(jNode).find("input#mbcbox3").prop('checked', GM_config.get('option4')); $(jNode).find("input#mbcbox4").prop('checked', GM_config.get('option5')); $(jNode).find("textarea#listpersonal").text(GM_config.get('listp1')); $(jNode).find("input#listcustom1").val(GM_config.get('listc1')); $(jNode).find("input#listcustom2").val(GM_config.get('listc2')); $(jNode).find("input#listcustom3").val(GM_config.get('listc3')); $(jNode).find("input#colorpersonal").val(parseColor(GM_config.get('colorp1'), false)); $(jNode).find("input#colorcustom1").val(parseColor(GM_config.get('colorc1'), false)); $(jNode).find("input#colorcustom2").val(parseColor(GM_config.get('colorc2'), false)); $(jNode).find("input#colorcustom3").val(parseColor(GM_config.get('colorc3'), false)); if ($(jNode).find("select#mbcddm1").val() == 2) { $(jNode).find("span#mbcswg1").hide(); } if ($(jNode).find("input#mbcbox3").prop('checked') == false) { $(jNode).find("span#mbcswg2").hide(); } $(jNode).find("input#mbcbox1, input#mbcbox2, input#mbcbox3, input#mbcbox4, select#mbcddm1, textarea#listpersonal, input#listcustom1, input#listcustom2, input#listcustom3, input#colorpersonal, input#colorcustom1, input#colorcustom2, input#colorcustom3").change(function() { if ($(jNode).find("select#mbcddm1").val() == 2) { $(jNode).find("span#mbcswg1").hide(); } else { $(jNode).find("span#mbcswg1").show(); } if ($(jNode).find("input#mbcbox3").prop('checked') == false) { $(jNode).find("span#mbcswg2").hide(); } else { $(jNode).find("span#mbcswg2").show(); } saveconfigNew(jNode); }); } function saveconfig(jNode) { GM_config.set('option1', $(jNode).find("select#mbcddm1").val()); GM_config.set('option2', $(jNode).find("input#mbcbox1").is(":checked")); GM_config.set('option4', $(jNode).find("input#mbcbox3").is(":checked")); GM_config.set('option5', $(jNode).find("input#mbcbox4").is(":checked")); GM_config.set('listp1', $(jNode).find("textarea#listpersonal").val()); GM_config.set('listc1', $(jNode).find("input#listcustom1").val()); GM_config.set('listc2', $(jNode).find("input#listcustom2").val()); GM_config.set('listc3', $(jNode).find("input#listcustom3").val()); GM_config.set('colorp1', parseColor($(jNode).find("input#colorpersonal").val(), true)); GM_config.set('colorc1', parseColor($(jNode).find("input#colorcustom1").val(), true)); GM_config.set('colorc2', parseColor($(jNode).find("input#colorcustom2").val(), true)); GM_config.set('colorc3', parseColor($(jNode).find("input#colorcustom3").val(), true)); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); GM_config.save(); $(jNode).find("span#configsaved").show(); $(jNode).find("span#configsaved")[0].style.backgroundColor = 'rgba(40,150,230,1)'; setTimeout(function(){$(jNode).find("span#configsaved")[0].style.backgroundColor = 'rgba(40,150,230,0)';}, 400); } function saveconfigNew(jNode) { GM_config.set('option1', $(jNode).find("select#mbcddm1").val()); GM_config.set('option2', $(jNode).find("input#mbcbox1").is(":checked")); GM_config.set('option3', $(jNode).find("input#mbcbox2").is(":checked")); GM_config.set('option4', $(jNode).find("input#mbcbox3").is(":checked")); GM_config.set('option5', $(jNode).find("input#mbcbox4").is(":checked")); GM_config.set('listp1', $(jNode).find("textarea#listpersonal").val()); GM_config.set('listc1', $(jNode).find("input#listcustom1").val()); GM_config.set('listc2', $(jNode).find("input#listcustom2").val()); GM_config.set('listc3', $(jNode).find("input#listcustom3").val()); GM_config.set('colorp1', parseColor($(jNode).find("input#colorpersonal").val(), true)); GM_config.set('colorc1', parseColor($(jNode).find("input#colorcustom1").val(), true)); GM_config.set('colorc2', parseColor($(jNode).find("input#colorcustom2").val(), true)); GM_config.set('colorc3', parseColor($(jNode).find("input#colorcustom3").val(), true)); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); GM_config.save(); $(jNode).find("span#configsaved").show(); $(jNode).find("span#configsaved")[0].style.backgroundColor = 'rgba(40,150,230,1)'; setTimeout(function(){$(jNode).find("span#configsaved")[0].style.backgroundColor = 'rgba(40,150,230,0)';}, 400); } function resetconfig(jNode) { $(jNode).find("span#mbcswg1").show(); $(jNode).find("span#mbcswg2").show(); $(jNode).find("select#mbcddm1").val(1); $(jNode).find("input#mbcbox1").prop('checked', false); $(jNode).find("input#mbcbox2").prop('checked', true); $(jNode).find("input#mbcbox3").prop('checked', true); $(jNode).find("input#mbcbox4").prop('checked', false); $(jNode).find("input#listcustom1").val('https://github.com/asrdri/yt-metabot-user-js/raw/master/list-sample.txt'); $(jNode).find("input#listcustom2").val(''); $(jNode).find("input#listcustom3").val(''); $(jNode).find("input#colorpersonal").val(parseColor(33023, false)); $(jNode).find("input#colorcustom1").val(parseColor(8388863, false)); $(jNode).find("input#colorcustom2").val(parseColor(16744448, false)); $(jNode).find("input#colorcustom3").val(parseColor(8421504, false)); } function resetconfigNew(jNode) { $(jNode).find("span#mbcswg1").show(); $(jNode).find("span#mbcswg2").show(); $(jNode).find("select#mbcddm1").val(1); $(jNode).find("input#mbcbox1").prop('checked', false); $(jNode).find("input#mbcbox2").prop('checked', true); $(jNode).find("input#mbcbox3").prop('checked', true); $(jNode).find("input#mbcbox4").prop('checked', false); $(jNode).find("input#listcustom1").val('https://github.com/asrdri/yt-metabot-user-js/raw/master/list-sample.txt'); $(jNode).find("input#listcustom2").val(''); $(jNode).find("input#listcustom3").val(''); $(jNode).find("input#colorpersonal").val(parseColor(33023, false)); $(jNode).find("input#colorcustom1").val(parseColor(8388863, false)); $(jNode).find("input#colorcustom2").val(parseColor(16744448, false)); $(jNode).find("input#colorcustom3").val(parseColor(8421504, false)); } function sendAlert(jNode) { if (alertSent || GM_config.get('option5') === false) return; if (ytmode === 1) { var commentURL = $(jNode).find('.published-time-text a').prop('href'); } else { var commentURL = $(jNode).find('.comment-renderer-time a').prop('href'); } var commendid = getURLParameter('lc', commentURL); var videoid = getURLParameter('v', commentURL); var data = $.param({v: videoid, lc: commendid}); var request = new XMLHttpRequest(); request.open("POST", alerturl, true); request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); request.send(data); alertSent = true; this.addEventListener('yt-navigate-start', function clearAlertSentFlag() { this.removeEventListener('yt-navigate-start', clearAlertSentFlag); alertSent = false; }); } function parseitem(jNode) { if (GM_config.get('option4') === true) { var spanlistpadd = txtlistpadd; } else { var spanlistpadd = ''; } var pNode = $(jNode).parent().parent()[0]; $(pNode).hover(function blockShow() { $(pNode).find("#t30sp").show(); }, function blockHide() { $(pNode).find("#t30sp").hide(); }); pNode = jNode[0]; var userID = $(jNode).find("a")[0].href.split('/').pop(); var foundID = arrayERKY.indexOf(userID); var foundIDp1 = -1; var foundIDc1 = -1; var foundIDc2 = -1; var foundIDc3 = -1; if (GM_config.get('option4') === true) { if (arrayListP1 !== null) { foundIDp1 = arrayListP1.indexOf(userID); } if (typeof arrayListC1 !== 'undefined' && arrayListC1.length > 1) { foundIDc1 = arrayListC1.indexOf(userID); } if (typeof arrayListC2 !== 'undefined' && arrayListC2.length > 1) { foundIDc2 = arrayListC2.indexOf(userID); } if (typeof arrayListC3 !== 'undefined' && arrayListC3.length > 1) { foundIDc3 = arrayListC3.indexOf(userID); } } var comURL = $(jNode).find("span.comment-renderer-time")[0]; if ($(jNode).find("span.comment-renderer-linked-comment").length > 0) { comURL = $(jNode).find("span.comment-renderer-linked-comment")[0]; } var t30span = document.createElement('span'); t30span.innerHTML = '\u2003<span id="about" style="cursor: pointer; font-family: Segoe UI Symbol; color: #767676" title="Открыть страницу с датой регистрации">\u2753</span>\u2003<span id="top30" style="cursor: pointer" title="Найти другие комментарии автора с помощью агрегатора ТОП30"><font color="#7777fa">top</font><font color="#fa7777">30</font></span>' + spanlistpadd; t30span.id = 't30sp'; t30span.style = "display:none"; if (foundID > -1) { sendAlert(jNode); console.log("[MetaBot for Youtube] user found in ERKY-db: " + userID); if (GM_config.get('option1') == 2) { foundIDp1 = -1; foundIDc1 = -1; foundIDc2 = -1; foundIDc3 = -1; var hidspan = document.createElement('span'); hidspan.innerHTML = 'Комментарий скрыт: пользователь найден в ЕРКЮ'; hidspan.classList.add('yt-badge'); hidspan.style = 'margin:0 0 10px 0;text-align:center;text-transform:none;font-weight:500;width:100%;background-color:hsla(0, 0%, 93.3%, .6)'; $(jNode).parent().parent().after(hidspan); $(jNode).parent().parent().hide(); } else { markred(pNode, arrayERKY[foundID + 1]); } $(comURL).after(t30span); } else { var newspan = document.createElement('span'); newspan.innerHTML = '<img id="checkbtn" src="' + checkb + '" title="Проверить дату регистрации" style="cursor: help" />'; newspan.id = 'checksp'; pNode.insertBefore(newspan, pNode.firstChild); t30span.innerHTML += '\u2003<span id="sendlink" style="cursor: pointer" title="Помогите пополнить список известных ботов - отправьте нам данные о подозрительном комментарии">\u27A4</span>'; $(comURL).after(t30span); $(jNode).find("img")[0].addEventListener("click", function checkcomment() { checkdate(pNode); }, false); $(jNode).find("#sendlink")[0].addEventListener("click", function displayinfo() { sendinfo(); }, false); } if (GM_config.get('option4') === true) { if (foundIDc1 > -1) { markcustom(pNode, arrayListC1[foundIDc1 + 1], 1); } if (foundIDc2 > -1) { markcustom(pNode, arrayListC2[foundIDc2 + 1], 2); } if (foundIDc3 > -1) { markcustom(pNode, arrayListC3[foundIDc3 + 1], 3); } if (foundIDp1 > -1) { if ($(jNode).find("#checkbtn").length > 0) { $(jNode).find("#checkbtn")[0].remove(); } markpersonal(pNode, arrayListP1[foundIDp1 + 1]); } $(jNode).find("#listpadd")[0].addEventListener("click", function addtolistNew() { if ($(pNode).find("span#bookmark").length > 0) { listpdel(pNode); $(jNode).find("#listpadd").html(iconsdef[0]); $(jNode).find("#listpadd")[0].title = 'Добавить в закладки'; } else { if ($(jNode).find("#checkbtn").length > 0) { $(jNode).find("#checkbtn")[0].remove(); } $(jNode).find("#listpadd").html('\u23F3'); getpage(listpadd, pNode, $(jNode).find("a")[0].href + '/about') } }, false); } $(jNode).find("#about")[0].addEventListener("click", function openabout() { window.open($(jNode).find("a")[0].href + '/about'); }, false); $(jNode).find("#top30")[0].addEventListener("click", function opent30() { window.open('https://www.t30p.ru/search.aspx?s=' + $(jNode).find("a")[0].href.split('/').pop()); }, false); } function parseitemMob(jNode) { var userID = $(jNode).find("a")[0].href.split('/').pop(); var foundID = arrayERKY.indexOf(userID); if (foundID > -1) { console.log("[MetaBot for Youtube] user found in ERKY-db: " + userID); markredMob(jNode, arrayERKY[foundID + 1]); } else { $(jNode)[0].addEventListener("touchstart", function () { $(this).data('moved', '0'); }, false); $(jNode)[0].addEventListener("touchmove", function () { $(this).data('moved', '1'); }, false); $(jNode)[0].addEventListener("touchend", function ttend() { if ($(this).data('moved') == 0){ if (['en', 'en-US', 'en-GB', 'ru', 'uk', 'be', 'bg'].indexOf(currentlangmob()) < 0) { alert('Функция поддерживается только на языках:\n \u2714 English\n \u2714 Русский\n \u2714 Українська\n \u2714 Беларуская \u2714 Български\nВы можете сменить язык интерфейса в меню настроек YouTube.'); return; } this.removeEventListener("touchend", ttend); checkdateMob(this); } }, false); } } function parseitemNew(jNode) { if (GM_config.get('option4') === true) { var spanlistpadd = txtlistpadd; } else { var spanlistpadd = ''; } var pNode = $(jNode).find("#header-author.ytd-comment-renderer")[0]; $(jNode).hover(function blockShow() { $(pNode).find("#t30sp").show(); }, function blockHide() { $(pNode).find("#t30sp").hide(); }); var userID = $(jNode).find("a")[0].href.split('/').pop(); var foundID = arrayERKY.indexOf(userID); var foundIDp1 = -1; var foundIDc1 = -1; var foundIDc2 = -1; var foundIDc3 = -1; if (GM_config.get('option4') === true) { if (arrayListP1 !== null) { foundIDp1 = arrayListP1.indexOf(userID); } if (typeof arrayListC1 !== 'undefined' && arrayListC1.length > 1) { foundIDc1 = arrayListC1.indexOf(userID); } if (typeof arrayListC2 !== 'undefined' && arrayListC2.length > 1) { foundIDc2 = arrayListC2.indexOf(userID); } if (typeof arrayListC3 !== 'undefined' && arrayListC3.length > 1) { foundIDc3 = arrayListC3.indexOf(userID); } } var comURL = $(jNode).find(".published-time-text")[0]; var t30span = document.createElement('span'); t30span.innerHTML = '\u2003<span id="about" style="cursor: pointer; ' + iconstyledef + '" title="Открыть страницу с датой регистрации">\u2753</span>\u2003<span id="top30" style="cursor: pointer" title="Найти другие комментарии автора с помощью агрегатора ТОП30"><font color="#7777fa">top</font><font color="#fa7777">30</font></span>' + spanlistpadd; t30span.id = 't30sp'; t30span.style = "display:none"; var newspan = document.createElement('span'); newspan.id = 'checksp'; if (foundID > -1) { sendAlert(jNode); console.log("[MetaBot for Youtube] user found in ERKY-db: " + userID); if (GM_config.get('option1') == 2) { foundIDp1 = -1; foundIDc1 = -1; foundIDc2 = -1; foundIDc3 = -1; var hidspan = document.createElement('span'); hidspan.innerHTML = 'Комментарий скрыт: пользователь найден в ЕРКЮ'; hidspan.classList.add('badge'); hidspan.classList.add('badge-style-type-simple'); hidspan.classList.add('ytd-badge-supported-renderer'); hidspan.style = 'margin: 0 0 10px 0;text-align:center'; $(jNode).parent().parent().after(hidspan); $(jNode).parent().parent().hide(); } else { markredNew($(pNode).parent(), arrayERKY[foundID + 1]); } $(comURL).append(t30span); $(newspan).attr('data-chan', $(jNode).find("a#author-text")[0].href); pNode.insertBefore(newspan, pNode.firstChild); } else { newspan.innerHTML = '<img id="checkbtn" src="' + checkb + '" title="Проверить дату регистрации" style="cursor: help" />'; $(newspan).attr('data-chan', $(jNode).find("a#author-text")[0].href); pNode.insertBefore(newspan, pNode.firstChild); t30span.innerHTML += '\u2003<span id="sendlink" style="cursor: pointer" title="Помогите пополнить список известных ботов - отправьте нам данные о подозрительном комментарии">\u27A4</span>'; $(comURL).append(t30span); $(jNode).find("#checkbtn")[0].addEventListener("click", function checkcommentNew() { checkdateNew($(pNode).parent()); }, false); $(jNode).find("#sendlink")[0].addEventListener("click", function displayinfoNew() { sendinfo(); }, false); } if (GM_config.get('option4') === true) { if (foundIDc1 > -1) { markcustomNew($(pNode).parent(), arrayListC1[foundIDc1 + 1], 1); } if (foundIDc2 > -1) { markcustomNew($(pNode).parent(), arrayListC2[foundIDc2 + 1], 2); } if (foundIDc3 > -1) { markcustomNew($(pNode).parent(), arrayListC3[foundIDc3 + 1], 3); } if (foundIDp1 > -1) { if ($(jNode).find("#checkbtn").length > 0) { $(jNode).find("#checkbtn")[0].remove(); } markpersonalNew($(pNode).parent(), arrayListP1[foundIDp1 + 1]); } $(jNode).find("#listpadd")[0].addEventListener("click", function addtolistNew() { if ($(pNode).find("span#bookmark").length > 0) { listpdelNew(pNode); $(jNode).find("#listpadd").html(iconsdef[0]); $(jNode).find("#listpadd")[0].title = 'Добавить в закладки'; } else { if ($(jNode).find("#checkbtn").length > 0) { $(jNode).find("#checkbtn")[0].remove(); } $(jNode).find("#listpadd").html('\u23F3'); getpage(listpaddNew, pNode, $(jNode).find("a")[0].href + '/about') } }, false); } $(jNode).find("#about")[0].addEventListener("click", function openaboutNew() { window.open($(jNode).find("a")[0].href + '/about'); }, false); $(jNode).find("#top30")[0].addEventListener("click", function opent30New() { window.open('https://www.t30p.ru/search.aspx?s=' + $(jNode).find("a")[0].href.split('/').pop()); }, false); this.addEventListener('yt-navigate-start', function wipeitemNewS() { this.removeEventListener('yt-navigate-start', wipeitemNewS); deleteitemNew(jNode, $(comURL).find("a")[0].href); }); this.addEventListener('yt-navigate-finish', function wipeitemNewF() { this.removeEventListener('yt-navigate-finish', wipeitemNewF); deleteitemNew(jNode, $(comURL).find("a")[0].href); }); } function recheckNew(jNode) { var checkre = $(jNode).find("#checksp")[0]; if (typeof checkre !== 'undefined') { if ($(checkre).attr('data-chan') !== $(jNode).find("a#author-text")[0].href) { $(jNode).find("#checksp").remove(); $(jNode).find("#t30sp").remove(); $(jNode).find("#botmark").remove(); var cNode = $(jNode).parent().parent().find("#content-text"); $(cNode).parent().removeAttr('style'); $(cNode).removeAttr('style'); $(jNode).find("ytd-toggle-button-renderer.ytd-comment-action-buttons-renderer:eq(1)").removeAttr('style'); parseitemNew(jNode); } } } function deleteitemNew(jNode, url) { if (url.length > 74) { $(jNode).parent().parent().remove(); } else { $(jNode).parent().parent().parent().remove(); } } function sendinfo() { var answer = confirm('Будет запущен Telegram.' + '\n\nПрисоединитесь к группе, отправьте ссылку на подозрительный' + '\nкомментарий (можно скопировать из даты публикации) и обоснуйте подозрения.\n\nПерейти к группе?'); if (answer) { window.open(reporturl); } } function listpadd(jNode, response, url) { window.tempHTML = document.createElement('html'); tempHTML.innerHTML = response; window.aboutSTAT = tempHTML.getElementsByClassName('about-stat'); var day = Dparse(aboutSTAT[aboutSTAT.length - 1].innerHTML); $('textarea#listpersonal')[0].value += url.substring(0, url.length - 6).split('/').pop() + '=' + day + '\n'; var tempArray = $('textarea#listpersonal')[0].value.split('\n'); var uniqArray = tempArray.reduce(function(a,b){ if (a.indexOf(b) < 0) a.push(b); return a; },[]); $('textarea#listpersonal')[0].value = uniqArray.join('\n'); GM_config.set('listp1', uniqArray.join('\n')); GM_config.save(); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); $(jNode).find("#listpadd").html('\u274C'); $(jNode).find("#listpadd")[0].title = 'Удалить из закладок'; markpersonal(jNode, day); console.log("[MetaBot for Youtube] Bookmarks (personal list) updated."); } function listpaddNew(jNode, response, url) { var matches = regexdate.exec(response); var day = Dparse(matches[3]); $('textarea#listpersonal')[0].value += url.substring(0, url.length - 6).split('/').pop() + '=' + day + '\n'; var tempArray = $('textarea#listpersonal')[0].value.split('\n'); var uniqArray = tempArray.reduce(function(a,b){ if (a.indexOf(b) < 0) a.push(b); return a; },[]); $('textarea#listpersonal')[0].value = uniqArray.join('\n'); GM_config.set('listp1', uniqArray.join('\n')); GM_config.save(); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); $(jNode).find("#listpadd").html('\u274C'); $(jNode).find("#listpadd")[0].title = 'Удалить из закладок'; markpersonalNew($(jNode).parent(), day); console.log("[MetaBot for Youtube] Bookmarks (personal list) updated."); } function listpdel(jNode) { $(jNode).find("span#bookmark").remove(); var tempArray = $('textarea#listpersonal')[0].value.split('\n'); var itemDel = arrayListP1.indexOf($(jNode).find("a")[0].href.split('/').pop()); tempArray.splice(itemDel / 2,1); $('textarea#listpersonal')[0].value = tempArray.join('\n'); GM_config.set('listp1', tempArray.join('\n')); GM_config.save(); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); $(jNode).next().css({ "background-image": "none", "border-right": "", "padding-right": "" }); console.log("[MetaBot for Youtube] Bookmarks (personal list) updated."); } function listpdelNew(jNode) { $(jNode).find("span#bookmark").remove(); var tempArray = $('textarea#listpersonal')[0].value.split('\n'); var itemDel = arrayListP1.indexOf($(jNode).find("a")[0].href.split('/').pop()); tempArray.splice(itemDel / 2,1); $('textarea#listpersonal')[0].value = tempArray.join('\n'); GM_config.set('listp1', tempArray.join('\n')); GM_config.save(); arrayListP1 = GM_config.get('listp1').match(/[^\r\n=]+/g); $(jNode).parent().parent().find("#content-text").parent().css({ "background-image": "none", "border-right": "", "padding-right": "" }); console.log("[MetaBot for Youtube] Bookmarks (personal list) updated."); } function checkdate(jNode) { if (['en', 'en-US', 'en-GB', 'ru', 'uk', 'be', 'bg'].indexOf(currentlang()) < 0) { alert('Функция поддерживается только на языках:\n \u2714 English\n \u2714 Русский\n \u2714 Українська\n \u2714 Беларуская \u2714 Български\nВы можете сменить язык интерфейса в меню настроек YouTube.'); return; } $(jNode).find("img")[0].remove(); getpage(procdate, jNode, $(jNode).find("a")[0].href + '/about'); } function checkdateMob(jNode) { var channelURL = $(jNode).find("a")[0].href + '/about?ajax=1'; var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { var response = request.responseText; if (response !== "") { console.log("[MetaBot for Youtube] XMLHttpRequest done."); var matches = regexdatemob.exec(response); var testday = Dparse(decodeURIComponent(JSON.parse('"' + matches[3] + '"'))); $(jNode).parent().find("div.erb").find("a")[0].innerHTML = $(jNode).parent().find("div.erb").find("a")[0].innerHTML + ' <img src="' + minf + '" title="Дата регистрации:" /> ' + testday; $(jNode).parent().find("div.zqb").css({ "background": "rgba(170,170,170,0.3)", "border-left": "3px solid rgba(170,170,170,0.3)", "padding-left": "3px" }); } else { console.log("[MetaBot for Youtube] XMLHttpRequest failed."); } } } }; request.open("GET", channelURL, true); request.send(null); } function checkdateNew(jNode) { if (['en', 'en-US', 'en-GB', 'ru', 'uk', 'be', 'bg'].indexOf(currentlang()) < 0) { alert('Функция поддерживается только на языках:\n \u2714 English\n \u2714 Русский\n \u2714 Українська\n \u2714 Беларуская \u2714 Български\nВы можете сменить язык интерфейса в меню настроек YouTube.'); return; } $(jNode).find("#checkbtn")[0].remove(); var userID = $(jNode).find("a")[0].href.split('/').pop(); var foundID = arrayERKY.indexOf(userID); if (foundID > -1) { console.log("[MetaBot for Youtube] user found in ERKY-db: " + userID); markredNew(jNode, arrayERKY[foundID + 1]); } else { getpage(procdateNew, jNode, $(jNode).find("a")[0].href + '/about'); } } function procdate(jNode, response, url) { window.tempHTML = document.createElement('html'); tempHTML.innerHTML = response; window.aboutSTAT = tempHTML.getElementsByClassName('about-stat'); var testday = Dparse(aboutSTAT[aboutSTAT.length - 1].innerHTML); var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = ' <img src="' + minf + '" title="Дата регистрации:" /> ' + testday; $(jNode).find("a.comment-author-text").after(newspan); $(jNode).next().css({ "background": "rgba(170,170,170,0.3)", "border-left": "3px solid rgba(170,170,170,0.3)", "padding-left": "3px" }); delete window.aboutSTAT; delete window.tempHTML; } function procdateNew(jNode, response, url) { var matches = regexdate.exec(response); var testday = Dparse(matches[3]); var aNode = $(jNode).find("#author-text")[0]; var cNode = $(jNode).parent().find("#content-text")[0]; var newspan = document.createElement('span'); newspan.id = 'botmark'; var checkBadge = $(aNode).parent().find('span#author-comment-badge')[0]; newspan.innerHTML = '<img src="' + minf + '" title="Дата регистрации:" /> ' + testday; $(aNode).append(newspan); if ($(checkBadge).length > 0) { $(checkBadge).attr('hidden', ''); $(aNode).removeAttr('hidden'); } $(cNode).parent().css({ "background": "rgba(170,170,170,0.3)", "border-left": "3px solid rgba(170,170,170,0.3)", "padding-left": "3px" }); aNode = $(jNode).find("#checksp"); aNode.attr('data-chan', $(jNode).find("a#author-text")[0].href); aNode.hide(); } function markred(jNode, day) { var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = ' <img src="' + mred + '" title="- пользователь найден в #ЕРКЮ, дата регистрации -" /> ' + day; $(jNode).find("a.comment-author-text").after(newspan); $(jNode).next().css({ "background": "rgba(255,50,50,0.3)", "border-left": "3px solid rgba(255,50,50,0.3)", "padding-left": "3px" }); if (GM_config.get('option2') === true) { requestDislike(jNode, false); } } function markredMob(jNode, day) { $(jNode).parent().find("div.erb").find("a")[0].innerHTML = $(jNode).parent().find("div.erb").find("a")[0].innerHTML + ' <img src="' + mred + '" title="Пользователь найден в ЕРКЮ" /> ' + day; $(jNode).parent().find("div.zqb").css({ "background": "rgba(255,50,50,0.3)", "border-left": "3px solid rgba(255,50,50,0.3)", "padding-left": "3px" }); } function markredNew(jNode, day) { var aNode = $(jNode).find("#author-text")[0]; var cNode = $(jNode).parent().find("#content-text")[0]; var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = '<img src="' + mred + '" title="- найден в #ЕРКЮ, дата регистрации -" /> ' + day; $(aNode).append(newspan); var checkBadge = $(aNode).parent().find('span#author-comment-badge')[0]; if ($(checkBadge).length > 0) { $(checkBadge).attr('hidden', ''); $(aNode).removeAttr('hidden'); } $(cNode).parent().css({ "background": "rgba(255,50,50,0.3)", "border-left": "3px solid rgba(255,50,50,0.3)", "padding-left": "3px" }); if (GM_config.get('option2') === true) { requestDislike(jNode, true); } } function markcustom(jNode, day, list) { switch (list) { case 1: var listname = Aparse(arrayListC1[0]); break case 2: var listname = Aparse(arrayListC2[0]); break case 3: var listname = Aparse(arrayListC3[0]); } var botmark = $(jNode).find("#botmark"); var rgbCustom = gmColor('colorc' + list, 1) + "," + gmColor('colorc' + list, 2) + "," + gmColor('colorc' + list, 3); var marktxt = ' <span style="' + iconstyledef + ' color: rgb(' + rgbCustom + '); font-size: 1.3em;" title="Найден в списке ' + listname + '">' + iconsdef[list] + '</span> '; if (botmark.length > 0) { $(botmark).prepend(marktxt); } else { $(jNode).find("#checkbtn")[0].remove(); var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = marktxt + day; $(jNode).find("a.comment-author-text").after(newspan); $(jNode).next().css({ "background": "rgba(" + rgbCustom + ",.3)", "border-left": "3px solid rgba(" + rgbCustom + ",0.3)", "padding-left": "3px" }); } } function markcustomNew(jNode, day, list) { switch (list) { case 1: var listname = Aparse(arrayListC1[0]); break case 2: var listname = Aparse(arrayListC2[0]); break case 3: var listname = Aparse(arrayListC3[0]); } var aNode = $(jNode).find("#author-text")[0]; var cNode = $(jNode).parent().find("#content-text")[0]; var checkBadge = $(aNode).parent().find('span#author-comment-badge')[0]; var botmark = $(cNode).parent().parent().parent().find("#botmark"); var rgbCustom = gmColor('colorc' + list, 1) + "," + gmColor('colorc' + list, 2) + "," + gmColor('colorc' + list, 3); var marktxt = '<span style="' + iconstyledef + ' color: rgb(' + rgbCustom + '); font-size: 1.3em;" title="Найден в списке ' + listname + '">' + iconsdef[list] + '</span> '; if (botmark.length > 0) { $(botmark).prepend(marktxt); } else { $(jNode).find("#checkbtn")[0].remove(); var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = marktxt + day; $(aNode).append(newspan); if ($(checkBadge).length > 0) { $(checkBadge).attr('hidden', ''); $(aNode).removeAttr('hidden'); } $(cNode).parent().css({ "background": "rgba(" + rgbCustom + ",.3)", "border-left": "3px solid rgba(" + rgbCustom + ",0.3)", "padding-left": "3px" }); } } function markpersonal(jNode, day) { $(jNode).find("#listpadd").html('\u274C'); $(jNode).find("#listpadd")[0].title = 'Удалить из закладок'; var botmark = $(jNode).parent().find("#botmark"); var rgbCustom = gmColor('colorp1', 1) + "," + gmColor('colorp1', 2) + "," + gmColor('colorp1', 3); var marktxt = ' <span id="bookmark" style="' + iconstyledef + ' color: rgb(' + rgbCustom + '); font-size: 1.3em;" title="Добавлен в закладки">' + iconsdef[0] + '</span> '; if (botmark.length > 0) { $(botmark).prepend(marktxt); $(jNode).next().css({ "background-image": "linear-gradient(230deg, rgba(" + rgbCustom + ",.4) 20%, rgba(0,0,0,0) 30%)" }); } else { var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = marktxt + day; $(jNode).find("a.comment-author-text").after(newspan); $(jNode).next().css({ "background": "linear-gradient(230deg, rgba(" + rgbCustom + ",.4) 20%, rgba(0,0,0,0) 30%)" }); } $(jNode).next().css({ "background-origin": "border-box", "border-right": "3px solid rgba(" + rgbCustom + ",.3)", "padding-right": "3px" }); } function markpersonalNew(jNode, day) { $(jNode).find("#listpadd").html('\u274C'); $(jNode).find("#listpadd")[0].title = 'Удалить из закладок'; var aNode = $(jNode).find("#author-text")[0]; var cNode = $(jNode).parent().find("#content-text")[0]; var checkBadge = $(aNode).parent().find('span#author-comment-badge')[0]; var botmark = $(cNode).parent().parent().parent().find("#botmark"); var rgbCustom = gmColor('colorp1', 1) + "," + gmColor('colorp1', 2) + "," + gmColor('colorp1', 3); var marktxt = '<span id="bookmark" style="' + iconstyledef + ' color: rgb(' + rgbCustom + '); font-size: 1.3em;" title="Добавлен в закладки">' + iconsdef[0] + '</span> '; if (botmark.length > 0) { $(botmark).prepend(marktxt); $(cNode).parent().css({ "background-image": "linear-gradient(230deg, rgba(" + rgbCustom + ",.4) 20%, rgba(0,0,0,0) 30%)" }); } else { var newspan = document.createElement('span'); newspan.id = 'botmark'; newspan.innerHTML = marktxt + day; $(aNode).append(newspan); if ($(checkBadge).length > 0) { $(checkBadge).attr('hidden', ''); $(aNode).removeAttr('hidden'); } $(cNode).parent().css({ "background": "linear-gradient(230deg, rgba(" + rgbCustom + ",.4) 20%, rgba(0,0,0,0) 30%)" }); } $(cNode).parent().css({ "background-origin": "border-box", "border-right": "3px solid rgba(" + rgbCustom + ",.3)", "padding-right": "3px" }); } function gmColor(gmVar, colpos) { return parseInt(parseColor(GM_config.get(gmVar), false).slice(colpos*2-1, colpos*2+1), 16) } function requestDislike(jNode, isNew) { var element; if (isNew) { element = $(jNode).parent().find("ytd-toggle-button-renderer.ytd-comment-action-buttons-renderer:not(.style-default-active)")[1]; } else { element = $(jNode).parent().find(".yt-uix-button.comment-action-buttons-renderer-thumb[aria-checked='false']")[1]; } if (element) orderedClicksArray.push(element); if (bDTaskSet == 0) { bDTaskSet = 1; setTimeout(scheduledDislike, minDCTime + Math.random() * (maxDCTime - minDCTime), isNew); } } function scheduledDislike(isNew) { if ( bDBlur || document.querySelector('paper-dialog.ytd-popup-container:not([style*="display:none"]):not([style*="display: none"])') || document.querySelector('div.yt-dialog-fg-content.yt-dialog-show-content') ) { setTimeout(scheduledDislike, minDCTime + Math.random() * (maxDCTime - minDCTime), isNew); } else { if (orderedClicksArray.length) { var element = orderedClicksArray.shift(); if ( (isNew && !(element.classList.contains("style-default-active"))) || (element.getAttribute("aria-checked") == "false") ) { $(element).css({"background": "rgba(255,50,50,0.3)"}); if (isNew) {$(element).css({"border-radius": "50%"});} element.click(); } else { setTimeout(scheduledDislike, 100, isNew); return; } setTimeout(scheduledDislike, minDCTime + Math.random() * (maxDCTime - minDCTime), isNew); } else { bDTaskSet = 0; } } } function Dparse(day) { day = day.replace(/Joined |Дата регистрации: |Ви приєдналися |Член от |Далучыўся(-лася) /i, ''); day = day.replace(/ янв\. | января | січ\. |\.01\./i, ' Jan, '); day = day.replace(/ февр\. | февраля | лют\. |\.02\./i, ' Feb, '); day = day.replace(/ мар\. | марта | бер\. |\.03\./i, ' Mar, '); day = day.replace(/ апр\. | апреля | квіт\. |\.04\./i, ' Apr, '); day = day.replace(/ мая\. | мая | трав\. |\.05\./i, ' May, '); day = day.replace(/ июн\. | июня | черв\.|\.06\./i, ' Jun, '); day = day.replace(/ июл\. | июля | лип\. |\.07\./i, ' Jul, '); day = day.replace(/ авг\. | августа | серп\. |\.08\./i, ' Aug, '); day = day.replace(/ сент\. | сентября | вер\. |\.09\./i, ' Sep, '); day = day.replace(/ окт\. | октября | жовт\. |\.10\./i, ' Oct, '); day = day.replace(/ нояб\. | ноября | лист\. |\.11\./i, ' Nov, '); day = day.replace(/ дек\. | декабря | груд\. |\.12\./i, ' Dec, '); day = day.replace(/ г\.| р\./i, ''); return day; } function Aparse(text) { if (ytmode === 1) { var isNew = true; } else { var isNew = false; } text = text.replace(/&/g, '&'); text = text.replace(/</g, '<'); text = text.replace(/>/g, '>'); text = text.replace(/\r\n/g, '<br>'); if (isNew) { text = text.replace(/\[(.+?)\]\((.+?)\)/g, '<a href="$2" target="_blank" style="color:rgba(39,147,230,1);">$1</a>'); } else { text = text.replace(/\[(.+?)\]\((.+?)\)/g, '<a href="$2" target="_blank">$1</a>'); } text = text.replace(/\*\*(.*?)\*\*/g, '<b>$1</b>'); text = text.replace(/\*(.*?)\*/g, '<i>$1</i>'); text = text.replace(/__(.*?)__/g, '<u>$1</u>'); return text; } function currentlang() { return regexlang.exec(document.body.innerHTML)[1]; } function currentlangmob() { return document.documentElement.lang; } function getURLParameter(name, link) { return decodeURIComponent((new RegExp('[?|&]' + name + '=([^&;]+?)(&|#|;|$)').exec(link) || [null, ''])[1].replace(/\+/g, '%20')) || null; } function ytOldDesign() { var getDesignCookie = function (cookie) { var prefs = cookie.split("; ").filter(function (v) { return v.indexOf("PREF=") === 0; })[0]; if (!prefs) { return "PREF=f6=8"; } var entries = prefs.substr(5).split('&'); var set = false; for (var i = 0; i < entries.length; i++) { if (entries[i].indexOf("f6=") === 0) { set = true; entries[i] = "f6=8"; } } if (!set) { entries.push("f6=8"); } return "PREF=" + entries.join('&'); }; document.cookie = getDesignCookie(document.cookie) + ";domain=.youtube.com;path=/"; } function ytNewDesign() { var requestSw = new XMLHttpRequest(); requestSw.open("POST", "https://www.youtube.com/new?optin=true", true); requestSw.send(null); } function parseColor(color, toNumber) { if (toNumber === true) { if (typeof color === 'number') { return (color | 0); } if (typeof color === 'string' && color[0] === '#') { color = color.slice(1); } return parseInt(color, 16); } else { color = '#' + ('00000' + (color | 0).toString(16)).substr(-6); return color; } } $(window).focus(function() { bDBlur = 0; }); $(window).blur(function() { bDBlur = 1; }); function getpage(callback, jNode, url) { var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { if (request.responseText !== "") { console.log("[MetaBot for Youtube] XMLHttpRequest done: " + url); callback(jNode, request.responseText, url); } } } }; request.open("GET", url, true); request.send(null); } function getlist(callback, numArr, url) { if (typeof GM_xmlhttpRequest !== 'undefined') { GM_xmlhttpRequest({ method: "GET", url: url, onload: function(response) { callback(numArr, response.responseText, response.status, url); } }); } else if (typeof GM !== 'undefined') { GM.xmlHttpRequest({ method: "GET", url: url, onload: function(response) { callback(numArr, response.responseText, response.status, url); } }); } else { console.log("[MetaBot for Youtube] Unable to get supported cross-origin XMLHttpRequest function."); } } function waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector) { var targetNodes, btargetsFound; if (typeof iframeSelector == "undefined") targetNodes = $(selectorTxt); else targetNodes = $(iframeSelector).contents().find(selectorTxt); if (targetNodes && targetNodes.length > 0) { btargetsFound = true; targetNodes.each(function() { var jThis = $(this); var alreadyFound = jThis.data('alreadyFound') || false; if (!alreadyFound) { var cancelFound = actionFunction(jThis); if (cancelFound) btargetsFound = false; else jThis.data('alreadyFound', true); } }); } else { btargetsFound = false; } var controlObj = waitForKeyElements.controlObj || {}; var controlKey = selectorTxt.replace(/[^\w]/g, "_"); var timeControl = controlObj[controlKey]; if (btargetsFound && bWaitOnce && timeControl) { clearInterval(timeControl); delete controlObj[controlKey]; } else { if (!timeControl) { timeControl = setInterval(function() { waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector); }, 300); controlObj[controlKey] = timeControl; } } waitForKeyElements.controlObj = controlObj; }