Skip to content

Instantly share code, notes, and snippets.

@keratagpro
Created February 1, 2016 22:19
Show Gist options
  • Save keratagpro/9c7cd927e52f9c262df9 to your computer and use it in GitHub Desktop.
Save keratagpro/9c7cd927e52f9c262df9 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name TagPro Switch Teams
// @namespace http://blah.com
// @include http://tagpro-*.koalabeast.com:*
// @version 0.0.1
// ==/UserScript==
'use strict';
tagpro.ready(function() {
$(document.body).append('<a href="#" id="switchButton2">Switch teams</a>');
$("#switchButton2").click(switchTeams);
$(document).on('keyup', function(ev) {
if (ev.which === 88) {
switchTeams(ev);
}
});
});
function switchTeams(ev) {
console.log('switching teams');
ev.preventDefault();
tagpro.socket.emit('switch');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment