rahul6280

BTCspinner 1700 rpm

Jan 31st, 2018
4,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1.  
  2. function mouseEvent(type, sx, sy, cx, cy) {
  3. var evt;
  4. var e = {
  5. bubbles: true,
  6. cancelable: (type != "mousemove"),
  7. view: window,
  8. detail: 0,
  9. screenX: sx,
  10. screenY: sy,
  11. clientX: cx,
  12. clientY: cy,
  13. ctrlKey: false,
  14. altKey: false,
  15. shiftKey: false,
  16. metaKey: false,
  17. button: 0,
  18. relatedTarget: undefined
  19. };
  20. if (typeof( document.createEvent ) == "function") {
  21. evt = document.createEvent("MouseEvents");
  22. evt.initMouseEvent(type,
  23. e.bubbles, e.cancelable, e.view, e.detail,
  24. e.screenX, e.screenY, e.clientX, e.clientY,
  25. e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
  26. e.button, document.body.parentNode);
  27. } else if (document.createEventObject) {
  28. evt = document.createEventObject();
  29. for (prop in e) {
  30. evt[prop] = e[prop];
  31. }
  32. evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button;
  33. }
  34. return evt;
  35. }
  36. var a = document.getElementsByClassName("spinner")[0],
  37. b = document.getElementById("speed");
  38. a.addEventListener("mousemove", function(e){console.log("clientX:" + e.clientX +", clientY:" + e.clientY +", screenX:" + e.screenX +", screenY:" + e.screenY +", movementX:" + e.movementX);});
  39.  
  40. function bootRot(x, y){
  41. a.dispatchEvent(mouseEvent("mousemove", x, y, x, y));
  42. }
  43.  
  44. function bootStart(){
  45. if ((b.innerHTML != "Dragging") && parseInt(b.innerHTML) < 1600){
  46. var xInicial = 0, yInicial = 0;
  47.  
  48. // "parseInt(b.innerHTML) < 1600": 1600 is the minimum value in RPMs from which the spinner rotates again.
  49. // This value can be edited!
  50.  
  51. for(var ofParent = a; ofParent; ofParent = ofParent.offsetParent){
  52. xInicial += ofParent.offsetLeft;
  53. yInicial += ofParent.offsetTop;
  54. }
  55.  
  56. var bootWidth = xInicial + a.offsetWidth,
  57. bootHeight = xInicial + a.offsetHeight;
  58.  
  59. var Xs = [xInicial, (bootWidth)/2, bootHeight, (bootWidth)/2], /*[462, 591, 729, 869],*/
  60. Ys = [(bootHeight)/2, yInicial, (bootHeight)/2, bootHeight], /*[77, 77, 77, 77],*/
  61. count = 0, speedBoot = 20;
  62.  
  63. // speedBoot = 20: Time in milliseconds that the mouse pointer would by points (Xs,Ys) forming a perfect circle.
  64. // This value can also be edited.
  65.  
  66. a.dispatchEvent(mouseEvent("mousedown", Xs[0], Ys[0], Xs[0], Ys[0]));
  67.  
  68. bootRot(Xs[0], Ys[0]);
  69.  
  70. setTimeout(function(){
  71. bootRot(Xs[1], Ys[1]);
  72. }, (count++)*speedBoot);
  73.  
  74. setTimeout(function(){
  75. bootRot(Xs[2], Ys[2]);
  76. }, (count++)*speedBoot);
  77.  
  78. setTimeout(function(){
  79. bootRot(Xs[3], Ys[3]);
  80. a.dispatchEvent(mouseEvent("mouseup", Xs[3], Ys[3], Xs[3], Ys[3]));
  81. }, (count++)*speedBoot);
  82. }
  83. }
  84.  
  85. var bootIntervalId = setInterval(bootStart, 1800);
  86.  
  87. // bootStart, 20: Time in milliseconds to swing reset after reaching the minimum RPM value.
  88. // This value can also be edited.
  89. // It is recommended that greater values for computers that do not have advanced hardware configuration!
  90.  
  91. function bootStop(){ // bootStop(): Command stops the execution of the script.
  92. clearInterval(bootIntervalId);
  93. }
Add Comment
Please, Sign In to add comment