Guest User

PD3 - Hotkeys

a guest
Oct 7th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // PrimeDice - Hotkeys
  2. // By: paradocks
  3. // CTRL + SHIFT + J
  4. // Paste in Dev Console + Press enter
  5.  
  6. // Copy Below This Line
  7. var basebet, bet,doublebet,halfbet;
  8.  
  9. // Edit the values in quotes (bet, multiplybet(x2), dividebet(/2) , basebet, setminbet) to suit your needs.
  10.  
  11. //Vars
  12. basebet = 0.00000010; // Your minimum bet
  13. bet = 'ctrl'; // ex. bet on ctrl
  14. setminbet = '1'; // reset to basebet on 1
  15. half = '2'; // ex. half on 2
  16. doublebet = '3'; // ex. double on D
  17. //
  18. basebet = basebet.toFixed(8);
  19. //jQuery HotKeys Lib
  20. (function(e){function t(t){if(typeof t.data==="string"){t.data={keys:t.data}}if(!t.data||!t.data.keys||typeof t.data.keys!=="string"){return}var n=t.handler,r=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)){return}var i=t.type!=="keypress"&&e.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),o="",u={};e.each(["alt","ctrl","shift"],function(e,n){if(t[n+"Key"]&&i!==n){o+=n+"+"}});if(t.metaKey&&!t.ctrlKey&&i!=="meta"){o+="meta+"}if(t.metaKey&&i!=="meta"&&o.indexOf("alt+ctrl+shift+")>-1){o=o.replace("alt+ctrl+shift+","hyper+")}if(i){u[o+i]=true}else{u[o+s]=true;u[o+e.hotkeys.shiftNums[s]]=true;if(o==="shift+"){u[e.hotkeys.shiftNums[s]]=true}}for(var a=0,f=r.length;a<f;a++){if(u[r[a]]){return n.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:true}};e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})})(jQuery||this.jQuery||window.jQuery);
  21.  
  22. // Disable Scrolldown on Space
  23. /*
  24. $(document).onkeydown = function(e) {
  25.     return !(e.keyCode == 32);
  26. };
  27. */
  28.  
  29. // Bet
  30. $(document).bind('keydown', bet, function(e) {  
  31.   $('#spinner').click();
  32. });
  33.  
  34. // Double Bet
  35. $(document).bind('keydown', doublebet, function(e) {  
  36.   $('.hero__main button:nth-child(2):first').click();
  37. });
  38.  
  39. // Half Bet
  40. $(document).bind('keydown', half, function(e) {  
  41.  $('.hero__main button:nth-child(1):first').click();
  42. });
  43. // Set Base
  44. $(document).bind('keydown', setminbet, function(e) {  
  45.  $('.hero__main input:first').val(basebet).trigger("change");
  46. });
Advertisement
Add Comment
Please, Sign In to add comment