Skip to content

Instantly share code, notes, and snippets.

@Xyvyrianeth
Created February 22, 2017 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xyvyrianeth/38b283f3fd682d8f4d7ae415719191a8 to your computer and use it in GitHub Desktop.
Save Xyvyrianeth/38b283f3fd682d8f4d7ae415719191a8 to your computer and use it in GitHub Desktop.
$("body #bottom .relative").append('<div id="mousepos" class="ugly-button 1_btn" style="position:fixed; bottom:7px; left:660px; width:110px; text-align:left; font-family:Lucida Sans Typewriter; border-style:inset; border-width:2px ; background-color:#000000;">Loading...</div>'); $("#1-btn");
mouse = setInterval( () => {
x = getSelf().x;
y = getSelf().y;
x = Math.round(getSelf().x * 10) / 10;
y = Math.round(getSelf().y * 10) / 10;
x0 = '';
y0 = '';
x1 = '';
y1 = '';
if (x < 100) {
if (x < 10) {
x0 = '00';
} else {
x0 = '0';
}
}
if ((x0 + x).length < 5) {
x1 = ".0";
}
if (y < 100) {
if (y < 10) {
y0 = '00';
} else {
y0 = '0';
}
}
if ((y0 + y).length < 5) {
y1 = ".0";
}
x2 = x0 + x + x1;
y2 = y0 + y + y1;
$("#mousepos").html("X:" + x2 + " Y:" + y2);
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment