SHOW:
|
|
- or go back to the newest paste.
1 | // PrimeDice3 - Hotkeys | |
2 | // By: paradocks | |
3 | // CTRL + SHIFT + J | |
4 | // Paste in Dev Console + Press enter | |
5 | ||
6 | // Edit the values in quotes (bet, multiplybet(x2), dividebet(/2)) to suite your needs | |
7 | var bet, doublebet, halfbet, setbasebet, basebet, diceiconcolor; | |
8 | bet = '1'; // ex. bet on 1 key | |
9 | doublebet = '2'; // ex. double on 2 | |
10 | half = '3'; // ex. half on 3 | |
11 | setbasebet = '4'; // setbase on 4 | |
12 | ||
13 | // Change Color of Dice Icon | |
14 | diceiconcolor = "black"; | |
15 | ||
16 | basebet = prompt("What would you like your basebet to be?", "0.00000000"); | |
17 | if (basebet > 0) { | |
18 | $('.hero__main input:first').val(basebet).change(); | |
19 | alert('To change the value again, click the dice icon above "2x","1/2"&"Max"'); | |
20 | } | |
21 | ||
22 | //jQuery HotKeys Lib | |
23 | !function(e){function t(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var a=t.handler,s=t.data.keys.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!(/textarea|select/i.test(t.target.nodeName)||e.hotkeys.options.filterTextInputs&&e.inArray(t.target.type,e.hotkeys.textAcceptingInputTypes)>-1)){var r="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),n="",o={};e.each(["alt","ctrl","shift"],function(e,a){t[a+"Key"]&&r!==a&&(n+=a+"+")}),t.metaKey&&!t.ctrlKey&&"meta"!==r&&(n+="meta+"),t.metaKey&&"meta"!==r&&n.indexOf("alt+ctrl+shift+")>-1&&(n=n.replace("alt+ctrl+shift+","hyper+")),r?o[n+r]=!0:(o[n+i]=!0,o[n+e.hotkeys.shiftNums[i]]=!0,"shift+"===n&&(o[e.hotkeys.shiftNums[i]]=!0));for(var f=0,c=s.length;c>f;f++)if(o[s[f]])return a.apply(this,arguments)}}}}e.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],options:{filterTextInputs:!0}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery||this.jQuery||window.jQuery); | |
24 | // Disable Scrolldown on Space | |
25 | window.onkeydown = function(e) { | |
26 | if ($('.input--chat').is(":focus")) { | |
27 | ||
28 | } else { | |
29 | return !(e.keyCode == 32); | |
30 | } | |
31 | }; | |
32 | ||
33 | // Bet | |
34 | $(document).bind('keydown', bet, function(e) { | |
35 | if ($('.input--chat').is(":focus")) { | |
36 | ||
37 | } else { | |
38 | $('#spinner').click(); | |
39 | } | |
40 | }); | |
41 | ||
42 | // Double Bet | |
43 | - | $(document).bind('keydown', double, function(e) { |
43 | + | $(document).bind('keydown', doublebet, function(e) { |
44 | if ($('.input--chat').is(":focus")) { | |
45 | ||
46 | } else { | |
47 | $('.hero__main button:nth-child(2):first').click(); | |
48 | } | |
49 | }); | |
50 | ||
51 | // Half Bet | |
52 | $(document).bind('keydown', half, function(e) { | |
53 | if ($('.input--chat').is(":focus")) { | |
54 | ||
55 | } else { | |
56 | $('.hero__main button:nth-child(1):first').click(); | |
57 | } | |
58 | }); | |
59 | // Half Bet | |
60 | $(document).bind('keydown', setbasebet, function(e) { | |
61 | if ($('.input--chat').is(":focus")) { | |
62 | ||
63 | } else { | |
64 | $('.hero__main input:first').val(basebet).change(); | |
65 | } | |
66 | }); | |
67 | $('.icon--dice').click(function() { | |
68 | basebet = prompt("What would you like your basebet to be?", "0.00000000"); | |
69 | if (basebet > 0) { | |
70 | $('.hero__main input:first').val(basebet).change(); | |
71 | alert('To change the value again, click the dice icon that is above 2x, 1/2, and Max'); | |
72 | } | |
73 | ||
74 | }); | |
75 | ||
76 | $('div.hero > div > div > div:nth-child(2) > div > div.hero__ornament.is-small--hidden > span > i').css("color", diceiconcolor); |