// ==UserScript==

// @name TagPro Alternate Group Chat

// @version 0

// @description Another way to send messages to group chat while in-game.

// @include http://*.koalabeast.com:*

// @include http://*.jukejuice.com:*

// @include http://*.newcompte.fr:*

// @author Zagd

// ==/UserScript==

// How it works:

// Type your desired group chat message into either all chat or team chat in-game.

// Instead of pressing Enter, press the alternate group chat key. The default is F2.

// Read below if you would like to change the alternate group chat key.

document. addEventListener ( 'keydown' , function ( e ) {

var groupKeyCode = 113 ; // 113 is F2. Change 113 to another number to change which key sends group chat.

// If you want to use a different key, go to http://keycode.info/, press the key you would rather use, and

// replace 113 with the number it tells you.

var key = e. keyCode ;

if ( key == groupKeyCode && $ ( "#chat" ) . css ( "display" ) != "none" ) {

tagpro. group . socket . emit ( "chat" , $ ( '#chat' ) . val ( ) ) ;

$ ( '#chat' ) . val ( "" ) ;

$ ( "#chat" ) . trigger ( $. Event ( "keydown" , { keyCode : 13 , which : 13 } ) ) ;

$ ( "#chat" ) . trigger ( $. Event ( "keyup" , { keyCode : 13 , which : 13 } ) ) ;

}