0% found this document useful (0 votes)
35 views2 pages

New Text Document

The document describes creating and dispatching mouse events in JavaScript. It defines a mouseEvent function to create mouse events and sets up event listeners and intervals to simulate mouse movement and clicks at intervals to spin a target element.

Uploaded by

Asif Azeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

New Text Document

The document describes creating and dispatching mouse events in JavaScript. It defines a mouseEvent function to create mouse events and sets up event listeners and intervals to simulate mouse movement and clicks at intervals to spin a target element.

Uploaded by

Asif Azeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

function mouseEvent {type, sx, sy, cx, cy( {

var evt;
var e ={
bubbles: true,
cancelable: (type != "mousemove"),
view: window,
detail: 0
screenX: sx,
screenY: sy,
clientX: cx,
clientY: cy,
ctrlkey: flase,
ctrlkey: false,
altkey: false,
shiftkey: false,
merakey: false,
button: 0,
relatedTarget: undefined
};

if (typeof( document.createEvent )== ") {


evt = document.createEvent("MouseEvents")
evt = intmouseEvent(type,
e.bubbles, e.cancelable, e.view, e.detail,
e.screenX, e.screenY, e.clientX, e.clientY,
e.ctrlkey, e.atlkey, e.shiftkey, e.metakey,
e.button, document.body.parentNode);
} else if (document.createEventButton) {
evt = document.createEventButton();
for (prop in e({
evt[prop] = e[prop];
}
evt.button = {0:1, 1:4, 2:2 }[evt.button] || evt.button;
}
return evt;
}
var a = document.getElementByClassName("spin")[0]
b = document.getElementByClassName("lucky Number");
a.addEventListener("mousemove", function(e) {console.log("clientX:" + e.clientX +",
clientY:" e.clientY +", screenX:" +e.screenX +", screenY:" + e.screenY +",
movememtX:" + e.moventX);})

function bootRot(x, y){


a.dispatchEvent(mouseEvent("mousemove", x, y, x, y,));
}

function bootstart(){
if ((b.innerHTML. != "Dragging") && parseInt (b.innerHTML) < 2000({
var xIncial = 0, uIncial = 0;

for(var ofParent = a; ofParent; ofparent = ofParent.offsetParent({


}

a.dispatchEvent(mouseEvent("mousedown", Xs[0], Ys[0], Xs[0], Ys[0] ));

bootRot(Xs[0], Ys[0]);

setTimeout(function(){
bootRot(Xs[1], Ys[1];
setTimeout(function(){
bootRot(Xs[2], Ys[2];
setTimeout(function(){
bootRot(Xs[3], Ys[3];
a.dispatchEvent(mouseEvent("mouseup:, Xs[3], Ys[3], Xs[3], Ys[3] ));
}
}

var bootIntervalid = setInterval(bootStart, 2000);

function bootstop(){ // bootstop(): Command stop the execution of the Script.


clearInterval(bootIntervalid);
}

You might also like