tatata

WAWA

  1. // ==UserScript==
  2. // @name tatata
  3. // @namespace TATATA 2.2
  4. // @description WAWA
  5. // @author EMY PAYASA
  6. // @include http://*.ogame.*/*
  7. // @exclude http://*.ogame.fr/game/index.php?page=fleet*
  8. // @exclude http://*.ogame.fr/game/index.php?page=galaxy*
  9. // @exclude http://*.ogame.fr/game/index.php?page=messages*
  10. // @exclude http://*.ogame.fr/game/index.php?page=traderOverview*
  11. // @exclude http://*.ogame.fr/game/index.php?page=preferences
  12. // @exclude http://uni122.ogame.fr/game/index.php?page=alliance*
  13. // @history 2.2 Busca eventos
  14. // @history 2.2 Version new
  15. // @history 2.2 version
  16. // @version 0.0.1.20150303214036
  17. // ==/UserScript==
  18.  
  19. var sMIN = getVar("sMIN",75);
  20. var sMAX = getVar("sMAX",240);
  21. var autofresh = getVar("autof",'OFF');
  22. var alrt_mess = getVar("stt_alrt_mess",'OFF');
  23. var alrt_atak = getVar("stt_alrt_atak",'OFF');
  24. var s_h_snd2 = getVar("s_h_snd2",0);
  25. var s_h_snd = getVar("s_h_snd",0);
  26. var body = document;
  27. var a = 1;
  28. var p,h,n1,n2,n3;
  29. var sURL = unescape(window.location);
  30. var url = location.href;
  31. var serveur = url.split('/')[2];
  32.  
  33.  
  34. {//Division OAN div_oan
  35. p = document.getElementById("menuTable");
  36. h = document.createElement("div");
  37. h.id = "div_oan";
  38. h.setAttribute('style',';position:relative;width:170px;text-align:center;');
  39. n1 = "<br>";
  40. n1 += '<span id="div_rfr" width="170px"></span>';
  41. n1 += '<span id="div_alrt_mess"></span>';
  42. n1 += '<span id="div_alrt_atak"></span>';
  43. n1 += '<span id="div_timer"></span>';
  44. n1 += '';
  45. h.innerHTML = n1 ;
  46. p.appendChild(h);
  47. }//Division OAN
  48.  
  49. {//Division Bouton ON OFF refresh bt_sttrfr in div_rfr
  50. p = document.getElementById("div_rfr");
  51. h = document.createElement("div");
  52. h.id = "b_stop";
  53. h.setAttribute('style',';width:145px;border: 1px outset black;color: #6f9fc8;background-color: #0d1014;text-align:center;padding-top: 5px;padding-bottom: 5px;');
  54. if ( getVar("autof")=="ON"){
  55. h.innerHTML = 'Refresh : <input type="hidden" id="autofresh" value="'+autofresh+'"><font color="green">[ON]</font> - <font color="red">OFF </font> ';
  56. }else {
  57. h.innerHTML = 'Refresh : <input type="hidden" id="autofresh" value="'+autofresh+'"><font color="red">ON</font> - <font color="green">[OFF]</font> ';
  58. }
  59. h.addEventListener("click",function(){
  60. b_stop();
  61. },false);
  62. p.appendChild(h);
  63.  
  64. function b_stop(){
  65. var autof = document.getElementById("autofresh").value;
  66. if ( getVar("autof")=="ON"){
  67. setVar("autof",'OFF');
  68. }
  69. else{
  70. setVar("autof","ON");
  71. }
  72. reload();
  73. }
  74. }//Division Bouton ON OFF refresh
  75.  
  76. {//Division Bouton ON OFF alerte messages bt_alrt_mess in div_alrt_mes
  77. p = document.getElementById("div_alrt_mess");
  78. h = document.createElement("div");
  79. h.id = "bt_alrt_mess";
  80. h.setAttribute('style',';width:145px;margin-top : 5px;padding-top: 5px;padding-bottom: 5px;border-top: 1px outset black;border-left: 1px outset black;border-right: 1px outset black;color: #6f9fc8;background-color: #0d1014;text-align:center;');
  81. if ( getVar("stt_alrt_mess")=="ON"){
  82. h.innerHTML = 'Son Message : <br><input type="hidden" id="alrt_mess" value="'+alrt_mess+'"><font color="green">[ON]</font> - <font color="red">OFF </font> ';
  83. }else {
  84. h.innerHTML = 'Son Message : <br><input type="hidden" id="alrt_mess" value="'+alrt_mess+'"><font color="red">ON</font> - <font color="green">[OFF]</font> ';
  85. }
  86. h.addEventListener("click",function(){
  87. b_alrt_mess();
  88. },false);
  89. p.appendChild(h);
  90.  
  91. function b_alrt_mess(){
  92. var stt_alrt_mess = document.getElementById("alrt_mess").value;
  93. if ( getVar("stt_alrt_mess")=="ON"){
  94. setVar("stt_alrt_mess",'OFF');
  95. }
  96. else{
  97. setVar("stt_alrt_mess","ON");
  98. }
  99. reload();
  100. }
  101. }//Division Bouton ON OFF alerte messages
  102.  
  103. {//Division Bouton ON OFF alerte atak bt_alrt_atak in div_alrt_atak
  104. p = document.getElementById("div_alrt_atak");
  105. h = document.createElement("div");
  106. h.id = "bt_alrt_atak";
  107. h.setAttribute('style',';width:145px;padding-top: 5px;padding-bottom: 5px;border-bottom: 1px outset black;border-left: 1px outset black;border-right: 1px outset black;color: #6f9fc8;background-color: #0d1014;text-align:center;');
  108. if ( getVar("stt_alrt_atak")=="ON"){
  109. h.innerHTML = 'Son Attaque : <br><input type="hidden" id="alrt_atak" value="'+alrt_atak+'"><font color="green">[ON]</font> - <font color="red">OFF </font> ';
  110. }else {
  111. h.innerHTML = 'Son Attaque : <br><input type="hidden" id="alrt_atak" value="'+alrt_atak+'"><font color="red">ON</font> -<font color="green">[OFF]</font> ';
  112. }
  113. h.addEventListener("click",function(){
  114. b_alrt_atak();
  115. },false);
  116. p.appendChild(h);
  117.  
  118. function b_alrt_atak(){
  119. var stt_alrt_atak = document.getElementById("alrt_atak").value;
  120. if ( getVar("stt_alrt_atak")=="ON"){
  121. setVar("stt_alrt_atak",'OFF');
  122. }
  123. else{
  124. setVar("stt_alrt_atak","ON");
  125. }
  126. reload();
  127. }
  128. }//Division Bouton ON OFF alerte atak
  129.  
  130. {//Division timer stt_timer
  131. p = document.getElementById("div_timer");
  132. h = document.createElement("div");
  133. h.id = "stt_timer";
  134. h.setAttribute('style',';width:140px;margin-bottom : 5px;margin-top : 5px;border: 1px outset black;color: #6f9fc8;background-color: #0d1014;text-align:left;padding-top: 5px;padding-bottom: 5px;padding-left: 5px;');
  135. n1 = '';
  136. n1 += 'Refresh ';
  137. n1 += '<input id="Smin" name="Smin" type=\"input\" size=\"1\" value=\"'+sMIN+'\"> sec mini<br>';
  138. n1 += 'Refresh ';
  139. n1 += '<input id="Smax" name="Smax" type=\"input\" size=\"1\" value=\"'+sMAX+'\"> sec maxi';
  140. n1 += '<div id="bt_save"></div>';
  141. n1 += '';
  142. h.innerHTML = n1 ;
  143. p.appendChild(h);
  144.  
  145. {//Boutton Sauvegarder bt_save
  146. p = document.getElementById("bt_save");
  147. h = document.createElement("div");
  148. h.id = "save_time";
  149. h.setAttribute('style',';text-align:center;padding-top: 5px;');
  150. h.innerHTML = '<input type="button" value="save" title="" class="btn_blue" >';
  151. h.addEventListener("click",function(){save_timer();},false);
  152. p.appendChild(h);
  153. }//Boutton Sauvegarder
  154.  
  155. }//Division timer
  156.  
  157. {//snd1 son message
  158. snd1 = document.getElementById("inhalt");
  159. h = document.createElement('div');
  160. h.id = "sndTable";
  161. h.setAttribute('style',';display:none;position:relative;clear:both;width:100%;float:left;border:0px;');
  162. snd1.appendChild(h);
  163. tabla ='';
  164. document.getElementById("sndTable").innerHTML = '';
  165. tabla += '<table border="0" width="100%" style="">';
  166. LineStyle = 'style="max-height:20px;min-width: 20px; max-width: 30px; overflow: hidden;font-weight:bold;"';
  167. tabla += '<tr style="max-height:20px;font-weight:bold;"><td><EMBED NAME=\'CS1224981463558\' SRC=\'http://xlx.ogame.free.fr/sons/sirene1.mp3\' LOOP=\'false\' AUTOSTART=\'true\' HIDDEN=\'true\' WIDTH=\'0\' HEIGHT=\'0\'></EMBED></td>';
  168. tabla +='</tr></table>';
  169. document.getElementById("sndTable").innerHTML = tabla;
  170. }//snd1 son message
  171. {//snd2 son attaque
  172. snd2 = document.getElementById("inhalt");
  173. h = document.createElement('div');
  174. h.id = "sndTable2";
  175. h.setAttribute('style',';display:none;position:relative;clear:both;width:100%;float:left;border:0px;');
  176. snd2.appendChild(h);
  177. tabla ='';
  178. document.getElementById("sndTable2").innerHTML = '';
  179. tabla += '<table border="0" width="100%" style="">';
  180. LineStyle = 'style="max-height:20px;min-width: 20px; max-width: 30px; overflow: hidden;font-weight:bold;"';
  181. tabla += '<tr style="max-height:20px;font-weight:bold;"><td><EMBED NAME=\'CS1224981463558\' SRC=\'http://www.coreybarksdale.com/Music/02-We-Want-War.mp3\' LOOP=\'\' AUTOSTART=\'true\' HIDDEN=\'true\' WIDTH=\'0\' HEIGHT=\'0\'></EMBED></td>';
  182. tabla +='</tr></table>';
  183. document.getElementById("sndTable2").innerHTML = tabla;
  184. }//snd2 son attaque
  185.  
  186. {//Boutton Option
  187. p = document.getElementById("playerName");
  188. h = document.createElement("a");
  189. h.id = "bopt";
  190. if( getVar("s_h_oan")==0){
  191. h.innerHTML = 'Emy';
  192. document.getElementById("div_oan").style.display="none";
  193. }
  194. else{
  195. h.innerHTML = 'VeoVeo';
  196. document.getElementById("div_oan").style.display="inline";
  197. }
  198. h.addEventListener("click",function(){
  199. f_s_h_oan();
  200. },false);
  201. p.appendChild(h);
  202.  
  203. }//Boutton Option
  204.  
  205. {//BOUTON AFFICHER REGLAGE
  206. p = document.getElementById("menuTable");
  207. h = document.createElement("a");
  208. h.id = "b_s_h_oan";
  209. if ( getVar("s_h_oan")==0){ h.innerHTML = '<li><a class="menubutton" href="javascript:void(0)" accesskey="" target="_self"><span class="textlabel">Abrirrr</span></a></li>'; document.getElementById("div_oan").style.display="none"; }
  210. else { h.innerHTML = '<li><a class="menubutton" href="javascript:void(0)" accesskey="" target="_self"><span class="textlabel">CERRAR</span></a></li>'; document.getElementById("div_oan").style.display="inline"; }
  211. h.addEventListener("click",function(){f_s_h_oan();},false);
  212. p.appendChild(h);
  213. }//BOUTON AFFICHER REGLAGE
  214.  
  215.  
  216. function save_timer(){
  217. var sMIN = document.getElementById("Smin").value;
  218. var sMAX = document.getElementById("Smax").value;
  219. setVar("sMIN",sMIN);
  220. setVar("sMAX",sMAX);
  221. reload();
  222. document.getElementById("save_time").innerHTML = '<br>Fait';
  223. }
  224.  
  225. function f_s_h_oan(){
  226. if ( getVar("s_h_oan")==1){
  227. setVar("s_h_oan",0);
  228. reload();
  229. document.getElementById("div_oan").style.display="none";
  230. }
  231. else{
  232. setVar("s_h_oan",1);
  233. reload();
  234. document.getElementById("div_oan").style.display="inline";
  235. }
  236. }
  237.  
  238. function getVar(varname, vardefault) {
  239. var res = GM_getValue(document.location.host+varname);
  240. if (res == undefined) {
  241. return vardefault;
  242. }
  243. return res;
  244. }
  245.  
  246. function setVar(varname, varvalue) {
  247. GM_setValue(document.location.host+varname, varvalue);
  248. }
  249.  
  250. function getRefreshTime() {
  251. return (parseInt(sMIN) + Math.round(Math.random() * (sMAX - sMIN))) * 1000;
  252. };
  253.  
  254. if ( autofresh == 'ON' ){
  255. setInterval(reload, getRefreshTime());
  256. }//
  257.  
  258. function reload() {
  259. window.location.replace( sURL );
  260. };//setTimeout(document.location.reload()) ;
  261.  
  262. if ( alrt_mess == 'ON' ){
  263. if (['message-wrapper' ].some(function(e) {
  264. if (document.evaluate('.//a[@class="tooltip js_hideTipOnMobile "]', document.getElementById(e), null, 8, null).singleNodeValue) return true;
  265. })) document.getElementById("sndTable").style.display="inline";
  266. }
  267.  
  268. if ( alrt_atak == 'ON' ){
  269. if (['message-wrapper' ].some(function(e) {
  270. if (document.evaluate('.//div[@class="tooltip eventToggle soon"]', document.getElementById(e), null, 8, null).singleNodeValue) return true;
  271. })) document.getElementById("sndTable2").style.display="inline" ;
  272. }
  273.  
  274. if ( a == 1 ){
  275. if (['eventHostile' ].some(function(e) {
  276. if (document.evaluate('.//value[@0]', document.getElementById(e), null, 8, null).singleNodeValue) return true;
  277. })) document.getElementById("sndTable2").style.display="inline" ;
  278. }