Wings.io auto respawn (evergreen)

Auto respawn + Autofire + Dark Theme / Night Mode + Hide Leaderboard / Fireflies + Remember Settings and more!

当前为 2016-07-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Wings.io auto respawn (evergreen)
  3. // @namespace wingsiomodrawr
  4. // @description Auto respawn + Autofire + Dark Theme / Night Mode + Hide Leaderboard / Fireflies + Remember Settings and more!
  5. // @version 11
  6. // @author condoriano
  7. // @icon http://i.imgur.com/pECyZov.png
  8. // @include http://wings.io/*
  9. // @include https://wings.io/*
  10. // @run-at document-start
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. if(window.self != window.top) return;
  15.  
  16. if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1) {
  17. var scriptChanged = false;
  18. window.addEventListener('beforescriptexecute', function(e) {
  19. if(e.target.innerHTML.length > 100000 && !scriptChanged) {
  20. e.preventDefault();
  21. e.stopPropagation();
  22. scriptChanged = true;
  23. e.target.remove();
  24. var oriScript = e.target.innerHTML;
  25. var httpReq = new XMLHttpRequest();
  26. httpReq.open('GET', 'http://gf.qytechs.cn/scripts/20020-wingsiomod/code/wingsiomod.js', false);
  27. httpReq.onreadystatechange = function() {
  28. if(httpReq.readyState == 4 && httpReq.status == 200) {
  29. var modScript = httpReq.responseText.trim().replace(/^function.*{|}$/g, '');
  30. var finalScript = combineScript(oriScript, modScript);
  31. var elem = document.createElement('script');
  32. elem.innerHTML = finalScript;
  33. document.body.appendChild(elem);
  34. }
  35. };
  36. httpReq.send();
  37. }
  38. if(scriptChanged) window.removeEventListener(e.type, arguments.callee, true);
  39. }, true);
  40. }
  41. else {
  42. var httpReq = new XMLHttpRequest();
  43. httpReq.open('GET', 'http://wings.io/', true);
  44. httpReq.onreadystatechange = function() {
  45. if(httpReq.readyState == 4 && httpReq.status == 200) {
  46. var tempDOM = document.createElement('div');
  47. tempDOM.innerHTML = httpReq.responseText;
  48. for(var i = 0; i < tempDOM.children.length; i++) {
  49. if(tempDOM.children[i].tagName.toUpperCase() == 'SCRIPT' && tempDOM.children[i].innerHTML.length > 100000) {
  50. var oriScript = tempDOM.children[i].innerHTML;
  51. var httpReq2 = new XMLHttpRequest();
  52. httpReq2.open('GET', 'http://gf.qytechs.cn/scripts/20020-wingsiomod/code/wingsiomod.js', true);
  53. httpReq2.onreadystatechange = function() {
  54. if(httpReq2.readyState == 4 && httpReq2.status == 200) {
  55. var modScript = httpReq2.responseText.trim().replace(/^function.*{|}$/g, '');
  56. var finalScript = combineScript(oriScript, modScript);
  57. tempDOM.children[i].innerHTML = finalScript;
  58. document.open();
  59. document.write(tempDOM.innerHTML);
  60. document.close();
  61. }
  62. };
  63. httpReq2.send();
  64. break;
  65. }
  66. }
  67. }
  68. };
  69. httpReq.send();
  70. }
  71.  
  72. function combineScript(a, b) {
  73. a = a.replace('"#62bae2"', 'handleColors("#62bae2")'); // solid bg when 'disable gradient' enabled
  74. a = a.replace(/("rgba\("\+parseInt\(.\)\+",145,202,1\.0\)")/, 'handleColors($1)'); // sky
  75. a = a.replace(/("rgba\("\+parseInt\(.\)\+",231,252,1\.0\)")/, 'handleColors($1)'); // sky
  76. a = a.replace(/("rgba\(9,188,255,1\.0\)")/g, 'handleColors($1)'); // water lv 1
  77. a = a.replace(/("rgba\(8,164,254,1\.0\)")/g, 'handleColors($1)'); // waterlv 2
  78. a = a.replace(/("rgba\(7,142,252,1\.0\)")/g, 'handleColors($1)'); // waterlv 3
  79. a = a.replace(/("rgba\(0,132,232,1\.0\)")/g, 'handleColors($1)'); // waterlv 4
  80. a = a.replace(/("rgba\(0,90,190,1\.0\)")/g, 'handleColors($1)'); // waterlv 5
  81. a = a.replace('["wing",770,203,27,27,.5,.5]', '["wing",770,203,27,27,.5,.5],["none",0,0,1,1,1,1]'); // add empty sprite array
  82. a = a.replace('"cannonshoot",', '"cannonshoot",ZzZz="",'); // add empty sound array
  83. a = a.replace(/trailEffect\(\),(.)=(..)/, 'trailEffect(),$1=document.getElementById("optnNoFireflies").checked?ZzZz:$2'); // if enabled, play empty sound
  84. a = a.replace(/(.)\=(.)\.frames\.wing/, '$1=document.getElementById("optnNoFireflies").checked?$2.frames.none:$2.frames.wing'); // if enabled, draw empty sprite // b=p.frames.wing
  85. a = a.replace(/(.\.width=.);(.\.height=.);(.=.\+"px)/, '$1;$2+30;$3'); // fix leaderboard cut off at bottom // c.width=V;c.height=L;k=h+"px
  86. a = a.replace(/(,.\.height\=.),/, '$1+30,'); // fix 'you' label cut off at bottom // ,s.height=b,
  87. a = a.replace(/this\.drawLeaderboard\=function\((a)\){/, 'this.drawLeaderboard=function($1){if(document.getElementById("optnNoLeaderboard").checked)return;'); // if enabled, hide leaderboard // this.drawLeaderboard=function(a){
  88. a = a.replace(/(.\.drawImage\(.,.),(.\+5\))/, '$1,document.getElementById("optnNoLeaderboard").checked?10:$2'); // if enabled, move 'you' label to top // a.drawImage(t,e,k+5)
  89. a = a.replace(/\(function\((.....)\){/i, '(function($1){' + b);
  90. return a;
  91. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址