// ==UserScript==
// @name TagPro Honk
// @description Press space to honk.
// @version 1.1
// @icon https://raw.githubusercontent.com/wilcooo/TagPro-ScriptResources/master/doot.png
// @supportURL https://www.reddit.com/message/compose/?to=Wilcooo
// @website https://www.reddit.com/r/TagPro/comments/6cn82i/modded_mod_honk_doot_doot/
// @match *://*.koalabeast.com/*
// @match *://*.jukejuice.com/*
// @match *://*.newcompte.fr/*
// @author CFlakes / Ballzilla / Ko
// @dootdoot Vermite
// @require https://greasyfork.org/scripts/371240/code/TagPro%20Userscript%20Library.js
// @grant GM_setValue
// @grant GM_getValue
// @namespace https://greasyfork.org/users/152992
// ==/UserScript==
var short_name = 'honk'; // An alphabetic (no spaces/numbers) distinctive name for the script.
var version = GM_info.script.version; // The version number is automatically fetched from the metadata.
tagpro.ready(function(){ if (!tagpro.scripts) tagpro.scripts = {}; tagpro.scripts[short_name]={version:version};});
console.log('START: ' + GM_info.script.name + ' (v' + version + ' by ' + GM_info.script.author + ')');
// SETTINGS
var settings = tpul.settings.addSettings({
id: 'honk',
title: "Configure the Honk script",
tooltipText: "Doot Doot",
icon: "https://raw.githubusercontent.com/wilcooo/TagPro-ScriptResources/master/doot.png",
fields: {
sprite: {
label: 'What visual effect should honking have?',
type: 'select',
options: ['nothing','icon on ball','stripes around ball'],
default: 'stripes around ball'
},
sound: {
label: 'What sound should honking make?',
type: 'select',
options: ['honk','doot'],
default: 'honk'
},
timeout: {
label: 'The time in milliseconds after which the sound will be repeated (recommended: 80 for honk, 300 for doot)',
type: 'int',
min: 10,
max: 5000,
default: 80
},
honkKey: {
label: 'Additional honk key',
section: ['','You will honk when pressing Up and Down simultaneously, but you could additionally have a dedicated honk key. Go to keycode.info to get the correct number for your key. The spacebar has keycode 32'],
type: 'int',
min: 0,
max: 255,
default: 32
}
},
events: {
save: updateSettings,
open: function(){
// Set the recommended timeout automatically after changing the sound
settings.fields.sound.node.onchange = function(){
if (this.value == 'honk') settings.fields.timeout.node.value = 80
if (this.value == 'doot') settings.fields.timeout.node.value = 300
}
}
}
});
var sprite = settings.get("sprite"),
sound = settings.get("sound"),
timeout = settings.get("timeout"),
honkKey = settings.get("honkKey");
var honkSound,
honkSprite;
function updateSettings(){
if (tpul.playerLocation != 'game') return;
console.log('updating settings')
sprite = settings.get("sprite")
sound = settings.get("sound")
timeout = settings.get("timeout")
honkKey = settings.get("honkKey")
switch (sound) {
case 'honk':
honkSound = new Audio("data:audio/mp3;base64,/4T0LVLSU1k69gAADSAAAAEbUZssTvHtyAAANIAAAAS45rVjIQU2fgwBJIre2H4M5tnzVSfbJmE0Y7W8Zc+exGI3+dJqJ8djznfzN8we+7Xl410zS1XH7t6Yp84vquqS/fg3p941rO8Uh+HfVKd7vTy9MVrvWby5pIAZbjcj76DJCANY4FZDCFsLYzDI0FH4oXGdC7sBQEA3iQAC+BkuSmNTmC/DtvIlqITwmLoO1BMBixELBO4N2IAFX8dtz9A49uXSu1QZ81c/l3/3I9f+nrgDXoJ18kDNlAM0q5kCo930VEDfI72Krtp/udS35kvHWPQ0bkyofXyzLLTXpVZzDBhC5SfWD3JgkaqE3e6t77lRm87S/GUdU+NaLpdiVsfrKroqI062rTfmsoAAAAFW6lcYTnBhYfp9nhJpj4a/jOjNCAHZYBMDfxlUQ4lEBGEBsDCREGHII/3jaVIS1BrC6GKc5lEnUMQBhowi9eOCIESafi1OZKul9poW4bpabtNV1lfyxfzeGW2jsyzvNij96yNEEkIK5NbPyOQ+ZM8d//uSZP+G9tBmyxOce3IAAA0gAAABFiGTOO3tbcgAADSAAAAEkK+PGJF1HW7vylt6KZahc/OkrkX51oj0yZOu3/2LOblXOPrWzZ/3rG0Hu1bnP1hNl4pW395fXOgx6zVdy1mdylKqLQONObF9qdkw1CQCAA7e0kbhwGgc6abjPa4BwMQPT2EC2CoEAodNBgyBwqGA8fFipR0EnbDDWrYHAzauwoGbmGA4yuXIutgu+TBt2C6AdDoEn7FO9cAbfuAuxTlJZm8d3OZ3JXv8PwcLu+1s316ofA8MirwJpMqd1f+q+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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==");
//mid: [1, 270]
break;
default:
break;
}
honkSound.preservesPitch = false;
honkSound.mozPreservesPitch = false;
honkSound.webkitPreservesPitch = false;
switch (sprite) {
case 'icon on ball':
honkSprite = PIXI.Texture.fromImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpi/P//PwMKaGBkwAoa/mOVY2LAD0Dy/WhiHEDcTYwBnEC8CogL0Fz2B4j9gdgInwEiQLwXiIPRxHmhBqyCGsLAgsPPx4BYFU0sBIgdgDgHiE8BcSrEAAhADklGLJpB4CEQW0HZN4FYnZhARAb3gVgOyn4OxBKkGvABiAWg7E/Q8CDJAHTwi1QDBKCuAAE+IP5MqgGKQPwIypYE4nfIBjAiYRC4g8UAeWj0MkBj4CZYI468AEpIm4HYAskCEOAB4i9A3AyN+jpcXngDxE5AvA5N/As07YQD8QZCYfAdiMOAeCI8N0IAyICNQHyOmED8C89MCPADiEthHIAAAwBEhjK+0yzwDgAAAABJRU5ErkJggg==");
break;
case 'stripes around ball':
honkSprite = PIXI.Texture.fromImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAACiUlEQVR4Xu3bMa7bQAwG4RwkZe5/s5zBiYoAgjFFJJPL1fgvPjxgDAjksn4/Xq/XV/n989ffP/ybEUar47j/vP9mhdEqB5bLgeVyYLkcWC4HlsuB5XJguRxYLgeWy4HlcmC5HFguB5bLgW940qM9ZdbKOTFecR6mYqBOT5jzPGPFnBiveB+oYqguu894nq9qToxXdQzWYef5zrNVzojxjq4Bq+041/u7Vc6I8a7OQa263wzjJ7oHNlnxVhg/tWLwp1v1RhgrrFrgiVa+DcYqKxd5itVvgrHS6oV2NvEWGKtNLLabqTfA2GFqwR1M7o6xy+SiU6Z3xthpctkJ0/ti7Da58GrTu2IMD4zhgTE8MIYHxvDAGB4YwwNjeGAMD4zhgTE8MIYHxvDAGB4YwwNjeGAMD4zhgTE8MIYHxvDAGB4YwwNjeGAMD4zhgTHmnP/V5VPH91o+GvfQe36q5aPvg8f/o/e86/hey0djHxjDA2N4YAwPjOGBMTwwhgfG8MAYHhjDA2N4YAwPjOGBMTwwhgfG8MAYHhjDA2N4YAwPjOGBMTwwhgfG8MAYHhjDA2N4YOz2Tf/qMr0rxk7nhaeWXml6X4xd3pedWHi16Z0xdphedNLk7hirTS64i6k3wFhparEdTbwFxioTC+1u9ZtgrLB6kSdZ+TYYP7Vygada9UYYP7FqcIMVb4XxrhUD23S/GcY7ugetsONMh/d3q5wT41WdA1bZebbDeb7KOTFe0TVYtd3nO5xnrJoV4xXVA3V5woyH85wVs2K8onKYTk+Z81A5K0ajykd7EoxGObBcDiyXA8vlwHI5sFwOLJcDy+XAcjmwXA4slwPL5cByObBcDvwFvu24r9frxx9ThG6n1YCdggAAAABJRU5ErkJggg==");
break;
default:
break;
}
}
if (tpul.playerLocation == 'game') {
tagpro.ready(function waitForId() {
if (!tagpro.playerId) return setTimeout(waitForId, 100);
var self = tagpro.players[tagpro.playerId];
updateSettings();
function getPlayers() {
requestAnimationFrame(getPlayers);
for (var id in tagpro.players) {
if (!tagpro.players.hasOwnProperty(id)) continue;
var player = tagpro.players[id];
if (player.up && player.down && player.draw && !player.dead) {
if (!player.isHonking) {
var startTime = Date.now();
player.isHonking = true;
$(document).trigger('honk',{state:true, id: player.id});
if (honkSprite) drawHonk(player);
honk(player, startTime);
}
} else {
if (player.isHonking) {
player.isHonking = false;
$(document).trigger('honk',{state:false, id: player.id});
if (honkSprite) drawHonk(player, true);
}
}
}
}
requestAnimationFrame(getPlayers);
function findCosAngle(self, player) {
var selfVector = {
x: player.x - self.x,
y: player.y - self.y
};
var playerVector = {
x: player.lx,
y: player.ly
};
var scalarProduct = (selfVector.x * playerVector.x) + (selfVector.y * playerVector.y);
var selfMagnitude = Math.sqrt(Math.pow(selfVector.x, 2) + Math.pow(selfVector.y, 2));
var playerMagnitude = Math.sqrt(Math.pow(playerVector.x, 2) + Math.pow(playerVector.y, 2));
return (-(scalarProduct / (selfMagnitude * playerMagnitude)));
}
function honk(player, startTime) {
if (!tagpro.sound || !honkSound) return;
if (player.isHonking && Date.now() - startTime < 4000) {
var last;
var distance = Math.sqrt(Math.pow(player.x - self.x, 2) + Math.pow(player.y - self.y, 2)),
volume = distance === 0 ? 1 : Math.max(1 - distance / 800, 0.1);
honkSound.volume = volume;
if (distance > 0) {
var playerSpeed = Math.sqrt(Math.pow(player.lx, 2) + Math.pow(player.ly, 2));
var cosAngle = findCosAngle(self, player);
var rate = playerSpeed * cosAngle;
rate = Math.pow(Math.exp(rate), 1 / 5);
honkSound.playbackRate = rate / 4 + 0.75;
} else honkSound.playbackRate = 1;
honkSound.play();
setTimeout(function() {
honk(player, startTime);
}, timeout);
} else {
if (player.sprites.honk) drawHonk(player, true);
}
}
function drawHonk(player, remove) {
if (!player.sprites.honk && !remove) {
player.sprites.honk = new PIXI.Sprite(honkSprite);
player.sprites.honk.x = -honkSprite.width/2 +20;
player.sprites.honk.y = -honkSprite.height/2 +20;
player.sprites.ball.addChild(player.sprites.honk);
} else {
if (player.sprites.honk && remove) {
player.sprites.ball.removeChild(player.sprites.honk);
player.sprites.honk = null;
}
}
}
var initKeyComm = function () { // DO NOT CHANGE THIS FUNCTION, AS IT CAN BREAK OTHER TP SCRIPTS
if (tagpro.KeyComm) return;
else tagpro.KeyComm = true;
tagpro.KeyComm = {
sentDir: {},
pressedDir: {},
keyCount: 1,
};
var tse = tagpro.socket.emit;
tagpro.socket.emit = function(event, args) {
if (event === 'keydown') {
tagpro.KeyComm.sentDir[args.k] = true;
args.t = tagpro.KeyComm.keyCount++;
}
if (event === 'keyup') {
tagpro.KeyComm.sentDir[args.k] = false;
args.t = tagpro.KeyComm.keyCount++;
}
tse(event, args);
};
tagpro.KeyComm.stop = function() {
var keys = ['up','down','left','right'];
for (var k in keys) {
if (!tagpro.KeyComm.pressedDir[keys[k]] && tagpro.KeyComm.sentDir[keys[k]])
tagpro.socket.emit('keyup', {k: keys[k]} );
}
};
tagpro.KeyComm.send = function(keys,short) {
for (var k in keys) {
if (!tagpro.KeyComm.sentDir[keys[k]])
tagpro.socket.emit('keydown', {k: keys[k]} );
}
if (short) setTimeout(tagpro.KeyComm.stop,20);
};
$(document).keydown(function(key) {
switch (key.which) {
case tagpro.keys.down[0]:
case tagpro.keys.down[1]:
case tagpro.keys.down[2]:
tagpro.KeyComm.pressedDir.down = true;
break;
case tagpro.keys.up[0]:
case tagpro.keys.up[1]:
case tagpro.keys.up[2]:
tagpro.KeyComm.pressedDir.up = true;
break;
case tagpro.keys.left[0]:
case tagpro.keys.left[1]:
case tagpro.keys.left[2]:
tagpro.KeyComm.pressedDir.left = true;
break;
case tagpro.keys.right[0]:
case tagpro.keys.right[1]:
case tagpro.keys.right[2]:
tagpro.KeyComm.pressedDir.right = true;
break;
}
});
$(document).keyup(function(key) {
switch (key.which) {
case tagpro.keys.down[0]:
case tagpro.keys.down[1]:
case tagpro.keys.down[2]:
tagpro.KeyComm.pressedDir.down = false;
break;
case tagpro.keys.up[0]:
case tagpro.keys.up[1]:
case tagpro.keys.up[2]:
tagpro.KeyComm.pressedDir.up = false;
break;
case tagpro.keys.left[0]:
case tagpro.keys.left[1]:
case tagpro.keys.left[2]:
tagpro.KeyComm.pressedDir.left = false;
break;
case tagpro.keys.right[0]:
case tagpro.keys.right[1]:
case tagpro.keys.right[2]:
tagpro.KeyComm.pressedDir.right = false;
break;
}
});
};
initKeyComm();
$(document).keydown(function(key) {
switch (key.which) {
case honkKey:
tagpro.KeyComm.send(['up','down']);
break;
}
});
$(document).keyup(function(key) {
switch (key.which) {
case honkKey:
tagpro.KeyComm.stop();
break;
}
});
});
}