Advertisement
Guest User

Бруткодовский версия 2

a guest
Dec 9th, 2013
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        codeFarm
  3. // @namespace   wtBlock
  4. // @include     http://worldoftanks.ru/*
  5. // @include     http://worldofwarplanes.ru/*
  6. // @version     2
  7. // @grant       none
  8. // @run-at document-end
  9. // ==/UserScript==
  10.  
  11. var your_url='http://pastebin.com/dhKt1ztV';//сюда вписываем адрес pastebin с использованными кодами
  12.  
  13. jQuery.ajax = (function(_ajax){
  14.  
  15.     var protocol = location.protocol,
  16.         hostname = location.hostname,
  17.         exRegex = RegExp(protocol + '//' + hostname),
  18.         YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
  19.         query = 'select * from html where url="{URL}" and xpath="*"';
  20.  
  21.     function isExternal(url) {
  22.         return !exRegex.test(url) && /:\/\//.test(url);
  23.     }
  24.  
  25.     return function(o) {
  26.  
  27.         var url = o.url;
  28.  
  29.         if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {
  30.  
  31.             // Manipulate options so that JSONP-x request is made to YQL
  32.  
  33.             o.url = YQL;
  34.             o.dataType = 'json';
  35.  
  36.             o.data = {
  37.                 q: query.replace(
  38.                     '{URL}',
  39.                     url + (o.data ?
  40.                         (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
  41.                     : '')
  42.                 ),
  43.                 format: 'xml'
  44.             };
  45.  
  46.             // Since it's a JSONP request
  47.             // complete === success
  48.             if (!o.success && o.complete) {
  49.                 o.success = o.complete;
  50.                 delete o.complete;
  51.             }
  52.  
  53.             o.success = (function(_success){
  54.                 return function(data) {
  55.  
  56.                     if (_success) {
  57.                         // Fake XHR callback.
  58.                         _success.call(this, {
  59.                             responseText: data.results[0]
  60.                                 // YQL screws with <script>s
  61.                                 // Get rid of them
  62.                                 .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
  63.                         }, 'success');
  64.                     }
  65.  
  66.                 };
  67.             })(o.success);
  68.  
  69.         }
  70.  
  71.         return _ajax.apply(this, arguments);
  72.  
  73.     };
  74.  
  75. })(jQuery.ajax);
  76.  
  77. function waitForJquery(){
  78.     if (typeof unsafeWindow.jQuery == 'undefined') {  
  79.         window.setTimeout(waitForJquery, 100);
  80.     } else {
  81.         $ = unsafeWindow.jQuery;
  82.         //your code here
  83.     }
  84. }
  85. waitForJquery();
  86.  
  87.     var count=0,
  88.         format='',
  89.         runTimes=0,
  90.         codes={},
  91.         letters=['F', 'G','C','R','T','Y', 'U', 'P', 'A', 'S', 'D', 'F', 'G', 'H',  'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M']
  92.     ;
  93.    
  94.     $('body').bind('code:generate', function(e){
  95.         if(format=='')
  96.             format=$('#id_code').val();
  97.             var
  98.                 regLet=new RegExp("n{1}"),
  99.                 regDig=new RegExp("x{1}")
  100.             ;
  101.             testcode=format;
  102.             var tempcodes={}, tmp='';
  103.             while(regLet.test(testcode)){
  104.                 tmp=letters[Math.floor(Math.random()*(letters.length))];
  105.                 if(tempcodes[tmp]!=true){
  106.                     tempcodes[tmp]=true;
  107.                     testcode=testcode.replace(regLet, tmp);
  108.                 }
  109.             }
  110.                
  111.             var tempcodes={}, tmp='';
  112.             while(regDig.test(testcode)){
  113.                 tmp=(2+Math.floor(Math.random()*8)).toString();
  114.                 if(tempcodes[tmp]!=true){
  115.                     tempcodes[tmp]=true;
  116.                     testcode=testcode.replace(regDig, tmp);
  117.                 }
  118.             }
  119.             if(typeof(codes[testcode])=='undefind'||codes[testcode]!=true){
  120.                 codes[testcode]==true;
  121.                 $('#id_code').val(testcode);
  122.                 $('body').append(testcode+'<br>');
  123.                 //$('body').prepend(testcode+' ');//нахуй переносы
  124.             }
  125.     });
  126.     $('body').bind('code:send', function(e){
  127.         $("#button-submit").click();
  128.         $("#js-edit-bonuscode-form").submit();
  129.     });
  130.     $('body').bind('code:clear', function(e){
  131.         $('#id_code').val('');
  132.     });
  133.     $('body').bind('code:wait10min', function(e){
  134.         //$('body').prepend('waiting 10 min<br>'); //нахуй
  135.         //сообщение о паузе
  136.         $('#ui-dialog-title-js-edit-bonuscode-form-dialog').text('Проверено '+count+'. Пауза 10 минут.');
  137.         setTimeout(function(){
  138.             $('body').trigger('code:gen5codes');
  139.         }, (10*1000*60+2000));
  140.         $('#id_code').val('');
  141.     });
  142.     $('body').bind('code:gen5codes', function(){
  143.         if(runTimes>4){
  144.             $('body').trigger('code:wait10min');
  145.             runTimes=0;
  146.             return true;
  147.         }else
  148.             runTimes++;
  149.         $('#ui-dialog-title-js-edit-bonuscode-form-dialog').text('Проверено '+count+'. Попытка '+runTimes+' из 5');//инфа о попытках
  150.         $('body').trigger('code:generate');
  151.         if ($('body').html().split($('#id_code').val()).length - 1 >1) {$('body').trigger('code:generate');};
  152.         $('body').trigger('code:send');
  153.         count++;//счетчик проверенных
  154.        
  155.         setTimeout(function(){
  156.             $('body').trigger('code:clear');
  157.             $('body').trigger('code:gen5codes');
  158.         }, 3400);
  159.        
  160.     });
  161.     $('body').dblclick(function(){
  162.         var used_codes = '';
  163.         if (your_url.length>0){
  164.             $.ajax({url: your_url,type: 'GET',success: function(res) {var text = res.responseText;used_codes = text;
  165.                 used_codes = used_codes.substring(used_codes.indexOf('catchTab(this,event)">')+22, used_codes.indexOf('</textarea>'));
  166.                 var arr = used_codes.split('\n');
  167.                 arr.forEach(function(str) {
  168.                     $('body').append(str+'<br>');
  169.                 });
  170.                 $('body').trigger('code:gen5codes');
  171.             }});
  172.         } else {$('body').trigger('code:gen5codes');};
  173.         //$('body').trigger('code:gen5codes');
  174.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement