Advertisement
Mdbook

Shellshock script 2

Nov 29th, 2017
1,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. var highCenter = document.createElement('center');
  2. highCenter.style = "width:100%;position:fixed;top:7%;font-size:18px;z-index:99999;color:white;";
  3. var highDiv = document.createElement('div');
  4. highDiv.style = "text-shadow:0em 0em .1em #000,0em .1em .2em #000;";
  5. highCenter.appendChild(highDiv);
  6. document.body.appendChild(highCenter);
  7. var playerList;
  8. var topPlayer;
  9. var topPlayerScore;
  10. var topPlayerName;
  11. var highScore = 0;
  12. var highName = "";
  13.  
  14. setInterval(function(){
  15. playerList = document.getElementById('playerList');
  16. if (playerList){
  17. topPlayer = playerList.getElementsByTagName('div')[0];
  18. topPlayerScore = topPlayer.getElementsByTagName('span')[1].innerHTML;
  19. topPlayerName = topPlayer.getElementsByTagName('span')[0].innerHTML;
  20. if (+topPlayerScore > highScore){
  21. highScore = topPlayerScore;
  22. highName = topPlayerName;
  23. highDiv.innerText = "Best Score: " + highScore + " by " + highName;
  24. }
  25. }
  26. }, 100);
  27.  
  28. var sight = document.createElement('div');
  29. var size = 6;
  30. sight.style.height = size + "px";
  31. sight.style.width = size + "px";
  32. sight.style.position = "fixed";
  33. sight.style.zIndex = 99999999;
  34. sight.style.backgroundColor = "white";
  35. sight.style.border = "1px solid black";
  36. sight.style.borderRadius = "2px";
  37. sight.style.top = ((window.innerHeight / 2) - ((size / 2))) + "px";
  38. sight.style.left = ((window.innerWidth / 2) - ((size / 2))) + "px";
  39.  
  40. document.body.appendChild(sight);
  41.  
  42. setInterval(function(){
  43. sight.style.top = ((window.innerHeight / 2) - ((size / 2))) + "px";
  44. sight.style.left = ((window.innerWidth / 2) - ((size / 2))) + "px";
  45. }, 1000);
  46.  
  47.  
  48.  
  49. document.addEventListener('keyup', function(e){
  50. if (e.keyCode == 189){
  51. size = size - 2;
  52. sight.style.height = size + "px";
  53. sight.style.width = size + "px";
  54. sight.style.top = ((window.innerHeight / 2) - ((size / 2))) + "px";
  55. sight.style.left = ((window.innerWidth / 2) - ((size / 2))) + "px";
  56. } else if (e.keyCode == 187) {
  57. size = size + 2;
  58. sight.style.height = size + "px";
  59. sight.style.width = size + "px";
  60. sight.style.top = ((window.innerHeight / 2) - ((size / 2))) + "px";
  61. sight.style.left = ((window.innerWidth / 2) - ((size / 2))) + "px";
  62. }
  63. });
  64. var toggleAid = 0;
  65. document.addEventListener('keyup', function(){
  66. if (event.keyCode == 81){
  67. if (toggleAid === 0){
  68. toggleAid = 1;
  69. sight.style.display = "none";
  70. } else {
  71. toggleAid = 0;
  72. sight.style.display = "block";
  73. }
  74.  
  75. }
  76. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement