Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Keyboard Shortcuts for Omerta on Chrome
  3. // @namespace keyboardshortcuts.barafranca.com
  4. // @version 0.1
  5. // @description Re-Enables keyboard shortcuts broken with latest Chrome updates
  6. // @include http://*.barafranca.com/*
  7. // @include https://*.barafranca.com/*
  8. // @include http://barafranca.com/*
  9. // @include https://barafranca.com/*
  10. // @include http://*.barafranca.nl/*
  11. // @include https://*.barafranca.nl/*
  12. // @include http://barafranca.nl/*
  13. // @include https://barafranca.nl/*
  14. // @include http://*.barafranca.us/*
  15. // @include https://*.barafranca.us/*
  16. // @include http://barafranca.us/*
  17. // @include https://barafranca.us/*
  18. // @include http://*.barafranca.gen.tr/*
  19. // @include https://*.barafranca.gen.tr/*
  20. // @include http://barafranca.gen.tr/*
  21. // @include https://barafranca.gen.tr/*
  22. // @include http://omerta.com.tr/*
  23. // @include https://omerta.com.tr/*
  24. // @include http://*.omerta.com.tr/*
  25. // @include https://*.omerta.com.tr/*
  26. // @include http://*.omerta.dm/*
  27. // @include https://*.omerta.dm/*
  28. // @include http://omerta.dm/*
  29. // @include https://omerta.dm/*
  30. // @include http://*.omerta.pt/*
  31. // @include https://*.omerta.pt/*
  32. // @include http://omerta.pt/*
  33. // @include https://omerta.pt/*
  34. // @include https://*.omerta.land*
  35. // @exclude http://*/game-register.php*
  36. // @exclude https://*/game-register.php*
  37. // @copyright 2015, MurderInc
  38. // @grant unsafeWindow
  39. // ==/UserScript==
  40.  
  41. var shortcutKeys = {
  42. "74": "J",
  43. "65": "A",
  44. "67": "C",
  45. "78": "N",
  46. "83": "S",
  47. "84": "T",
  48. "71": "G",
  49. "77": "M",
  50. "66": "B",
  51. "70": "R"
  52. };
  53.  
  54. unsafeWindow.onkeydown = function(e) {
  55. if (e.keyCode == 192) {
  56. $("input[name='buymeout']").click();
  57. }
  58.  
  59. if ($(e.target).is('input, textarea') || e.ctrlKey || e.metaKey) {
  60. return;
  61. }
  62.  
  63. if (shortcutKeys[e.keyCode]) {
  64. $("a[accesskey='" + shortcutKeys[e.keyCode] + "']").click();
  65. e.preventDefault();
  66. }
  67.  
  68. if (e.keyCode == 81) {
  69. $("input[name='buymeout']").click();
  70. }
  71.  
  72. if (e.keyCode == 88) {
  73. unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
  74. }
  75.  
  76. if (e.keyCode == 82) {
  77. unsafeWindow.omerta.GUI.container.loadPage('/races.php');
  78. }
  79.  
  80. if (e.keyCode == 87) {
  81. unsafeWindow.omerta.GUI.container.loadPage('/allusers.php?start=0&order=lastrank&sort=DESC&dead=HIDE');
  82. }
  83.  
  84. if (e.keyCode == 90) {
  85. unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Spots');
  86. }
  87.  
  88. if (e.keyCode == 72) {
  89. unsafeWindow.omerta.GUI.container.loadPage('BeO/webroot/index.php?module=Heist');
  90. }
  91.  
  92. if (e.keyCode == 86) {
  93. unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Bodyguards');
  94. }
  95.  
  96. if (e.keyCode == 69) {
  97. unsafeWindow.omerta.GUI.container.loadPage('/obay.php');
  98. }
  99.  
  100. if (e.keyCode == 75) {
  101. unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Detectives');
  102. }
  103.  
  104. if (e.keyCode == 76) {
  105. unsafeWindow.omerta.GUI.container.loadPage('/logout.php');
  106. }
  107.  
  108. if (e.keyCode == 80) {
  109. unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Poker');
  110. }
  111.  
  112. if (e.keyCode == 49) {
  113. unsafeWindow.omerta.GUI.container.loadPage('/family.php?fam=1');
  114. }
  115.  
  116. if (e.keyCode == 50) {
  117. unsafeWindow.omerta.GUI.container.loadPage('/family.php?fam=3');
  118. }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement