Advertisement
Guest User

Scrypt BTC Spinner

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