Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. var dhost = 'https://crigl.com/webscripts/cgL-grepolis/';
  2. var worldprefix = 'pt67';
  3.  
  4.  
  5. /*FUNCS*/
  6.  
  7. function setCookie(cname, cvalue, exdays) {
  8. var d = new Date();
  9. d.setTime(d.getTime() + (exdays*24*60*60*1000));
  10. var expires = "expires="+ d.toUTCString();
  11. document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  12. }
  13.  
  14. function getCookie(cname) {
  15. var name = cname + "=";
  16. var decodedCookie = decodeURIComponent(document.cookie);
  17. var ca = decodedCookie.split(';');
  18. for(var i = 0; i <ca.length; i++) {
  19. var c = ca[i];
  20. while (c.charAt(0) == ' ') {
  21. c = c.substring(1);
  22. }
  23. if (c.indexOf(name) == 0) {
  24. return c.substring(name.length, c.length);
  25. }
  26. }
  27. return "";
  28. }
  29.  
  30.  
  31. //Dude gtfo my script.. what are you trying to do here?
  32. $("body").append ( ' \ \
  33. \
  34. <!-- MAIN MENU --> \
  35. \
  36. \
  37. <div id="menucriglbt" style="top:30%;left:30%;position:absolute;z-index:5000;background-color: black;" > \
  38. <button id="maximizbut2" type="button">cLG-Bot</button> \
  39. <div id="inneroh2"> \
  40. <center><img src="https://crigl.com/img/logo.png"></center> \
  41. <small><p style="color:white">&nbsp; Bem-vindo ao seu bot Nasaki: &nbsp;</p><p id="statusmess2" style="color:darkgreen">---- </p> </small> &nbsp; <br>\
  42. <!--<span style="color:white">CrigL ID:</span><br>&nbsp;&nbsp;<input style="text-align:center;background-color : #d1d1d1; " type="text" size="30"id="cgluser" name="cgluser" placeholder="username"> &nbsp;&nbsp;<br> --> \
  43. <!--<span style="color:white">CrigL Password:</span><br>&nbsp;&nbsp;<input style="text-align:center;background-color : #d1d1d1; " type="password" size="30"id="cglpass" name="cglpass" placeholder="password"> &nbsp;&nbsp;<br> --> \
  44. &nbsp;&nbsp;<span style="color:white"><a href="https://crigl.com/forum/showthread.php?tid=42">Obtenha um trial grátis clicando aqui! :)</a></span> &nbsp;&nbsp;<br> \
  45. &nbsp;&nbsp;<input style="text-align:center;" type="text" size="50"id="serialkey2" name="serialkey" placeholder="xxxxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"> &nbsp;&nbsp;<br> \
  46. <button id="advbot" value="Install">Instalar</button><br><span style="color:white">Problemas a instalar o bot? Clique <a href="https://crigl.com/forum/showthread.php?tid=143" target="_blank">aqui</a> para ler os possiveis problemas.<br>Se nao conseguir resolver contacte o nosso support <a href="https://crigl.com/?p=livesupport" target="_blank">aqui</a></span><!--<button id="loginbot">Login</button> <button id="registerbot">New Account</button> --> <br> \
  47. <iframe id="listener2" src="" style="display:none;"></iframe> \
  48. \
  49. <small><p id="footer2" style="color:white">&nbsp; 14.1 &nbsp; <br> &nbsp; www.CrigL.com &nbsp;</p> </small> <br> \
  50. \
  51. \
  52. \
  53. \
  54. <button id="minimizbut2" type="button">-</button> \
  55. <form> <!-- For true form use method="POST" action="YOUR_DESIRED_URL" --> \
  56. </form> \
  57. </div> \
  58. </div> \
  59. \
  60. \
  61. \
  62. \
  63. ' );
  64.  
  65.  
  66.  
  67. $("#maximizbut2").hide ();
  68.  
  69. $( "#menucriglbt" ).draggable();
  70.  
  71. $("#minimizbut2").click ( function () {
  72. $("#inneroh2").hide ();
  73. $("#maximizbut2").show ();
  74. } );
  75.  
  76. $("#loginbot").click ( function () {
  77.  
  78.  
  79.  
  80. var xhr = new XMLHttpRequest();
  81. var url = dhost + "bot/ajaxv2/service.php";
  82. xhr.open("POST", url, true);
  83. xhr.setRequestHeader("Content-type", "text/plain");
  84. xhr.onreadystatechange = function () {
  85. if (xhr.readyState === 4 && xhr.status === 200) {
  86. var json = JSON.parse(xhr.responseText);
  87. if(json.status == "ok"){
  88. alert(' resultado ok ');
  89. }else{
  90. alert('nao tem ok ');
  91.  
  92. }
  93. }
  94. };
  95.  
  96.  
  97. var username = document.getElementById("cgluser").value;
  98. var password = document.getElementById("cglpass").value;
  99. var data = JSON.stringify({"method": "loginbot", "user": username,"password":password});
  100. xhr.send(data);
  101. } );
  102.  
  103.  
  104. $("#maximizbut2").click ( function () {
  105. $("#inneroh2").show ();
  106. $("#maximizbut2").hide ();
  107. } );
  108.  
  109. var canreloadpage2 = true;
  110. function reloadpage(){
  111. if( canreloadpage2){
  112. canreloadpage2 = false;
  113. console.log("nerror k87");
  114. location.reload();
  115.  
  116. }
  117. }
  118.  
  119. function refreshafterload() {
  120.  
  121. // Get a handle to the iframe element
  122. var iframe = document.getElementById('listener');
  123. var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
  124.  
  125. // Check if loading is complete
  126. if ( iframeDoc.readyState == 'complete' ) {
  127. //iframe.contentWindow.alert("Hello");
  128. iframe.contentWindow.onload = function(){
  129. alert("I am loaded");
  130. };
  131. // The loading is complete, call the function we want executed once the iframe is loaded
  132. afterLoading();
  133. return;
  134. }
  135.  
  136. // If we are here, it is not loaded. Set things up so we check the status again in 100 milliseconds
  137. window.setTimeout('checkIframeLoaded();', 100);
  138. }
  139.  
  140.  
  141. function afterLoading(){
  142. var xaasz = true;
  143. if(xaasz){
  144. xaasz = false;
  145. console.log("error 764");
  146. location.reload();
  147. }
  148. }
  149.  
  150. function initchecker(){
  151. alert(window.frames.length);
  152. }
  153.  
  154. $("#advbot").click ( function () {
  155. $('#advbot').attr('disabled','disabled');
  156. var serialnumber = document.getElementById("serialkey2").value;
  157. serialnumber = serialnumber.replace(/ /g, "");
  158. var setframelistener = document.getElementById("listener2");
  159.  
  160. setframelistener.setAttribute('src', "" + dhost + "bot/scriptsync.php?serialkey=" + serialnumber + "&world=" + worldprefix + "&lockplayername=" + Game.player_id);
  161.  
  162. var xhr = new XMLHttpRequest();
  163. var url = dhost + "bot/protector.php?nocache=" + Math.random();
  164. xhr.open("POST", url, true);
  165. xhr.setRequestHeader("Content-type", "text/plain");
  166. xhr.onreadystatechange = function () {
  167. if (xhr.readyState === 4 && xhr.status === 200) {
  168.  
  169.  
  170.  
  171. var resposta = xhr.responseText;
  172.  
  173. if(resposta.indexOf("SayHelloToMyLittleFriend") !=-1) {
  174. //eval(resposta);
  175. setTimeout(reloadpage, 5000);
  176. var elemento = document.getElementById('menucriglbt');
  177. elemento.style.display = 'none';
  178. }else{
  179. //alert('Failed... reloading...');
  180. setTimeout(reloadpage, 5000);
  181. }
  182.  
  183. }
  184. };
  185.  
  186.  
  187.  
  188. var data = JSON.stringify({"method": "connect", "the_serial": serialnumber});
  189. xhr.send(data);
  190.  
  191.  
  192.  
  193.  
  194. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement