Advertisement
Iuykza

s0urce.io auto-typing

Jun 16th, 2017
2,498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const $targetRead  = $('#tool-type');
  2. const $form        = $('#tool-type-form');
  3. const $input       = $('#tool-type-word');
  4. const $sendMessage = $('#targetmessage-button-send');
  5.  
  6. let enableAutoHack = false;
  7. const hackSpeed = 30;
  8.  
  9.  
  10.  
  11. function init() {
  12.     let $button = $('<input id="auto-hack" type="checkbox">');
  13.     let $labelHack  = $('<label for="auto-hack">Auto-hack</label>');
  14.  
  15.     $button.css({
  16.         'min-width': '100px'
  17.     });
  18.  
  19.     $button.change( function() {
  20.         enableAutoHack = $(this).is(':checked');
  21.     });
  22.  
  23.     $form
  24.     .parent()
  25.     .append($button)
  26.     .append($labelHack);
  27.  
  28.     $input.attr('autocomplete', 'on');
  29. }
  30.  
  31. function hack() {
  32.     const typeThis = $targetRead.text();
  33.  
  34.     if(!typeThis || typeThis.length <= 1){
  35.         $sendMessage.click();
  36.         return;
  37.     }
  38.    
  39.     $input.val(typeThis);
  40.     $form.submit();
  41. }
  42.  
  43.  
  44. init();
  45.  
  46. setInterval( () => {
  47.     if(enableAutoHack){
  48.         hack();
  49.     }
  50. }, hackSpeed);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement