SHARE
TWEET

remap pubs

a guest Jan 25th, 2020 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Remap Your Keys!
  3. // @namespace     github.com/karlding
  4. // @description   Allows you to map your own custom keys in Tagpro!
  5. // @include       https://tagpro.koalabeast.com/game
  6. // @match         *://*.koalabeast.com/game
  7. // @license       GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  8. // @author        Karl Ding
  9. // @copyright     2014+, 0K
  10. // @version       0.2
  11. // ==/UserScript==
  12.  
  13. tagpro.ready(function(){
  14.     // arrow keys (default controls)
  15.     var leftarrow = 37;
  16.     var uparrow = 38;
  17.     var rightarrow = 39;
  18.     var downarrow = 40;
  19.  
  20.     // navigation keys
  21.     var pgdown = 33;
  22.     var pgup = 34;
  23.     var end = 35;
  24.     var home = 36;
  25.     var ins = 45;
  26.     var del = 46;
  27.  
  28.     // a-z keys
  29.     var a = 65;
  30.     var b = 66;
  31.     var c = 67;
  32.     var d = 68;
  33.     var e = 69;
  34.     var f = 70;
  35.     var g = 71;
  36.     var h = 72;
  37.     var i = 73;
  38.     var j = 74;
  39.     var k = 75;
  40.     var l = 76;
  41.     var m = 77;
  42.     var n = 78;
  43.     var o = 79;
  44.     var p = 80;
  45.     var q = 81;
  46.     var r = 81;
  47.     var s = 83;
  48.     var t = 84;
  49.     var u = 85;
  50.     var v = 86;
  51.     var w = 87;
  52.     var x = 88;
  53.     var y = 89;
  54.     var z = 90;
  55.  
  56.     // alphanumeric
  57.     var backspace = 8;
  58.     var tab = 9;
  59.     var enter = 13;
  60.     var shift = 16;
  61.     var capslock = 20;
  62.     var space = 32;
  63.     var semicolon = 186;
  64.     var equals = 187;
  65.     var comma = 188;
  66.     var dash = 189;
  67.     var period = 190;
  68.     var forwardslash = 191;
  69.     var graveaccent = 192;
  70.     var openbracket = 219;
  71.     var backslash = 220;
  72.     var closebracket = 221;
  73.     var singlequote = 222;
  74.  
  75.     // numpad
  76.     var num0 = 96;
  77.     var num1 = 97;
  78.     var num2 = 98;
  79.     var num3 = 99;
  80.     var num4 = 100;
  81.     var num5 = 101;
  82.     var num6 = 102;
  83.     var num7 = 103;
  84.     var num8 = 104;
  85.     var num9 = 105;
  86.     var star = 106;
  87.     var add = 107;
  88.     var subtract = 109;
  89.     var decimal = 110;
  90.     var divide = 111;
  91.     var numlock = 144;
  92.  
  93.     // function keys
  94.     var f1 = 112;
  95.     var f2 = 113;
  96.     var f3 = 114;
  97.     var f4 = 115;
  98.     var f6 = 117;
  99.     var f7 = 118;
  100.     var f8 = 119;
  101.     var f9 = 120;
  102.     var f10 = 121;
  103.     var f11 = 122;
  104.     var f12 = 123;
  105.  
  106.     // control keys
  107.     var ctrl = 17;
  108.     var alt = 18;
  109.     var pausebreak = 19;
  110.     var esc = 27;
  111.     var leftwindows = 91;
  112.     var rightwindows = 92;
  113.     var select = 93;
  114.     var scrolllock = 145;
  115.  
  116.  
  117.     /*
  118.      * Movement Configuration:
  119.      * Change the following 4 variables below to whatever keys you'd like for movement.
  120.      *   Note: This ADDS these keys in addition to the standard wasd/arrow keys
  121.      *    * override_keys (bool): whether to override defaults, or simply extend (true, false)
  122.      *    * direction_up_key (int): the key you'd like to use to move UP
  123.      *    * direction_down_key (int): the key you'd like to use to move DOWN
  124.      *    * direction_left_key (int): the key you'd like to use to move LEFT
  125.      *    * direction_right_key (int): the key you'd like to use to move RIGHT
  126.      * Example: The current setup OVERRIDES wasd/arrow keys, and uses ijkl
  127.      */
  128.     var override_default_keys = true;
  129.  
  130.     var direction_up_key = p;
  131.     var direction_left_key = l;
  132.     var direction_down_key = semicolon;
  133.     var direction_right_key = singlequote;
  134.  
  135.     /*
  136.      * Misc:
  137.      * You can ignore this section's configuration if you only want to remap movement
  138.      *    * chat_cancel_key: hides the chat box
  139.      *    * chat_to_all_key: set chat recipients to all
  140.      *    * chat_to_team_key: set chat recipients to team
  141.      *    * chat_to_group_key: set chat recipients to group
  142.      *    * chat_send_key: send the message
  143.      *    * show_options_key: show the team stats
  144.      */
  145.     var chat_cancel_key = esc;
  146.     var chat_to_all_key = tab;
  147.     var chat_to_team_key = t;
  148.     var chat_to_group_key = g;
  149.     var chat_send_key = enter;
  150.     var show_options_key = esc;
  151.  
  152.  
  153.     /*
  154.      * ===========================================================
  155.      * DO NOT MODIFY BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING
  156.      * MODIFY AT YOUR OWN RISK, I AM NOT TO BE HELD ACCOUNTABLE
  157.      * HALT! HERE BE DRAGONS
  158.      * ===========================================================
  159.      */
  160.     tagpro.keys.cancelChat = [chat_cancel_key];
  161.     tagpro.keys.chatToAll = [chat_to_all_key];
  162.     tagpro.keys.chatToTeam = [chat_to_team_key];
  163.     tagpro.keys.chatToGroup = [chat_to_group_key, 103];
  164.     tagpro.keys.sendChat = [chat_send_key];
  165.     tagpro.keys.showOptions = [show_options_key];
  166.  
  167.     if (override_default_keys)
  168.     {
  169.         tagpro.keys.up = [direction_up_key];
  170.         tagpro.keys.left = [direction_left_key];
  171.         tagpro.keys.down = [direction_down_key];
  172.         tagpro.keys.right = [direction_right_key];
  173.     }
  174.     else {
  175.         tagpro.keys.up.push(direction_up_key);
  176.         tagpro.keys.left.push(direction_left_key);
  177.         tagpro.keys.down.push(direction_down_key);
  178.         tagpro.keys.right.push(direction_right_key);
  179.     }
  180. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top