--- iWings --- Wings.io Mods / Script

Auto Respawn + Autofire + Dark Theme / Night Mode + Macros / Shortcuts + Hide Leaderboard & Fireflies + More!

当前为 2016-09-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name --- iWings --- Wings.io Mods / Script
  3. // @namespace wingsiomodrawr
  4. // @description Auto Respawn + Autofire + Dark Theme / Night Mode + Macros / Shortcuts + Hide Leaderboard & Fireflies + More!
  5. // @version 15
  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. (function() {
  15.  
  16. if(window.top != window.self || (window.iWings && window.iWings.enabled)) { if(window.iWings && window.iWings.versions) window.iWings.versions.push('script v15'); return; }
  17. if(!window.iWings) window.iWings = { enabled: true, versions: ['script v15'] }; var isFirefox = /Firefox/.test(navigator.userAgent);
  18.  
  19. if(isFirefox) {
  20. var scriptChanged = false;
  21. window.addEventListener('beforescriptexecute', function(e) {
  22. if(e.target.innerHTML.length > 100000 && !scriptChanged) {
  23. e.preventDefault();
  24. e.stopPropagation();
  25. scriptChanged = true;
  26. e.target.remove();
  27. var oriScript = e.target.innerHTML;
  28. var httpReq = new XMLHttpRequest();
  29. httpReq.open('GET', 'http://gf.qytechs.cn/scripts/20020-wingsiomod/code/wingsiomod.js', false);
  30. httpReq.onreadystatechange = function() {
  31. if(httpReq.readyState == 4 && httpReq.status == 200) {
  32. var modScript = httpReq.responseText.trim().replace(/^function.*{|}$/g, '');
  33. var finalScript = combineScript(oriScript, modScript);
  34. var elem = document.createElement('script');
  35. elem.innerHTML = finalScript;
  36. document.body.appendChild(elem);
  37. }
  38. };
  39. httpReq.send();
  40. }
  41. if(scriptChanged) window.removeEventListener(e.type, arguments.callee, true);
  42. }, true);
  43. }
  44. else {
  45. var httpReq = new XMLHttpRequest();
  46. httpReq.open('GET', 'http://wings.io/', true);
  47. httpReq.onreadystatechange = function() {
  48. if(httpReq.readyState == 4 && httpReq.status == 200) {
  49. var tempDOM = document.createElement('div');
  50. tempDOM.innerHTML = httpReq.responseText;
  51. for(var i = 0; i < tempDOM.children.length; i++) {
  52. if(tempDOM.children[i].tagName.toUpperCase() == 'SCRIPT' && tempDOM.children[i].innerHTML.length > 100000) {
  53. var oriScript = tempDOM.children[i].innerHTML;
  54. var httpReq2 = new XMLHttpRequest();
  55. httpReq2.open('GET', 'http://gf.qytechs.cn/scripts/20020-wingsiomod/code/wingsiomod.js', true);
  56. httpReq2.onreadystatechange = function() {
  57. if(httpReq2.readyState == 4 && httpReq2.status == 200) {
  58. var modScript = httpReq2.responseText.trim().replace(/^function.*{|}$/g, '');
  59. var finalScript = combineScript(oriScript, modScript);
  60. tempDOM.children[i].innerHTML = finalScript;
  61. document.open();
  62. document.write(tempDOM.innerHTML);
  63. document.close();
  64. }
  65. };
  66. httpReq2.send();
  67. break;
  68. }
  69. }
  70. }
  71. };
  72. httpReq.send();
  73. }
  74.  
  75. function combineScript(a, b) {
  76. a = a.replace('"#62bae2"', 'handleColors("#62bae2")'); // solid bg when 'disable gradient' enabled
  77. a = a.replace(/("rgba\("\+parseInt\(.\)\+",145,202,1\.0\)")/, 'handleColors($1)'); // sky
  78. a = a.replace(/("rgba\("\+parseInt\(.\)\+",231,252,1\.0\)")/, 'handleColors($1)'); // sky
  79. a = a.replace(/("rgba\(9,188,255,1\.0\)")/g, 'handleColors($1)'); // water lv 1
  80. a = a.replace(/("rgba\(8,164,254,1\.0\)")/g, 'handleColors($1)'); // waterlv 2
  81. a = a.replace(/("rgba\(7,142,252,1\.0\)")/g, 'handleColors($1)'); // waterlv 3
  82. a = a.replace(/("rgba\(0,132,232,1\.0\)")/g, 'handleColors($1)'); // waterlv 4
  83. a = a.replace(/("rgba\(0,90,190,1\.0\)")/g, 'handleColors($1)'); // waterlv 5
  84. 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
  85. a = a.replace('"cannonshoot",', '"cannonshoot",ZzZz="",'); // add empty sound array
  86. a = a.replace(/trailEffect\(\),(.)=(..)/, 'trailEffect(),$1=document.getElementById("optnNoFireflies").checked?ZzZz:$2'); // if enabled, play empty sound
  87. 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
  88. 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
  89. a = a.replace(/(,.\.height\=.),/, '$1+30,'); // fix 'you' label cut off at bottom // ,s.height=b,
  90. 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){
  91. 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)
  92. a = a.replace(/\(function\((.....)\){/i, '(function($1){' + b);
  93. return a;
  94. }
  95.  
  96. })();

QingJ © 2025

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