Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Keyboard Shortcuts for Omerta on Chrome
- // @namespace keyboardshortcuts.barafranca.com
- // @version 0.1
- // @description Re-Enables keyboard shortcuts broken with latest Chrome updates
- // @include http://*.barafranca.com/*
- // @include https://*.barafranca.com/*
- // @include http://barafranca.com/*
- // @include https://barafranca.com/*
- // @include http://*.barafranca.nl/*
- // @include https://*.barafranca.nl/*
- // @include http://barafranca.nl/*
- // @include https://barafranca.nl/*
- // @include http://*.barafranca.us/*
- // @include https://*.barafranca.us/*
- // @include http://barafranca.us/*
- // @include https://barafranca.us/*
- // @include http://*.barafranca.gen.tr/*
- // @include https://*.barafranca.gen.tr/*
- // @include http://barafranca.gen.tr/*
- // @include https://barafranca.gen.tr/*
- // @include http://omerta.com.tr/*
- // @include https://omerta.com.tr/*
- // @include http://*.omerta.com.tr/*
- // @include https://*.omerta.com.tr/*
- // @include http://*.omerta.dm/*
- // @include https://*.omerta.dm/*
- // @include http://omerta.dm/*
- // @include https://omerta.dm/*
- // @include http://*.omerta.pt/*
- // @include https://*.omerta.pt/*
- // @include http://omerta.pt/*
- // @include https://omerta.pt/*
- // @include https://*.omerta.land*
- // @exclude http://*/game-register.php*
- // @exclude https://*/game-register.php*
- // @copyright 2015, MurderInc
- // @grant unsafeWindow
- // ==/UserScript==
- var shortcutKeys = {
- "74": "J",
- "65": "A",
- "67": "C",
- "78": "N",
- "83": "S",
- "84": "T",
- "71": "G",
- "77": "M",
- "66": "B",
- "70": "R"
- };
- unsafeWindow.onkeydown = function(e) {
- if (e.keyCode == 192) {
- $("input[name='buymeout']").click();
- }
- if ($(e.target).is('input, textarea') || e.ctrlKey || e.metaKey) {
- return;
- }
- if (shortcutKeys[e.keyCode]) {
- $("a[accesskey='" + shortcutKeys[e.keyCode] + "']").click();
- e.preventDefault();
- }
- if (e.keyCode == 81) {
- $("input[name='buymeout']").click();
- }
- if (e.keyCode == 88) {
- unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
- }
- if (e.keyCode == 82) {
- unsafeWindow.omerta.GUI.container.loadPage('/races.php');
- }
- if (e.keyCode == 87) {
- unsafeWindow.omerta.GUI.container.loadPage('/allusers.php?start=0&order=lastrank&sort=DESC&dead=HIDE');
- }
- if (e.keyCode == 90) {
- unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Spots');
- }
- if (e.keyCode == 72) {
- unsafeWindow.omerta.GUI.container.loadPage('BeO/webroot/index.php?module=Heist');
- }
- if (e.keyCode == 86) {
- unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Bodyguards');
- }
- if (e.keyCode == 69) {
- unsafeWindow.omerta.GUI.container.loadPage('/obay.php');
- }
- if (e.keyCode == 75) {
- unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Detectives');
- }
- if (e.keyCode == 76) {
- unsafeWindow.omerta.GUI.container.loadPage('/logout.php');
- }
- if (e.keyCode == 80) {
- unsafeWindow.omerta.GUI.container.loadPage('/BeO/webroot/index.php?module=Poker');
- }
- if (e.keyCode == 49) {
- unsafeWindow.omerta.GUI.container.loadPage('/family.php?fam=1');
- }
- if (e.keyCode == 50) {
- unsafeWindow.omerta.GUI.container.loadPage('/family.php?fam=3');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement