Created
February 1, 2016 22:19
-
-
Save keratagpro/9c7cd927e52f9c262df9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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