BTCSpinner.io Script


SUBMITTED BY: ma3340

DATE: Nov. 13, 2018, 6:02 a.m.

FORMAT: Text only

SIZE: 3.3 kB

HITS: 7045

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

comments powered by Disqus