Advertisement
Guest User

StackEgg Ditto Bot modified

a guest
Apr 1st, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //StackEgg JS bot
  2. //paste into your browser console (probably F12 to open), definitely works in Chrome
  3. //stop with clearInterval(egger)
  4. (function() {
  5.     function vote() {
  6.         var time = $('#egg-clock-text')
  7.         var actions = $('.egg-action')
  8.         if (time.text() != '2')
  9.             return
  10.         var votes = [], buttons = []
  11.         actions.each(function() {
  12.             var t = $(this)
  13.             var id = t.attr('id');
  14.             id = id.substr(id.lastIndexOf('-')+1);
  15.             if(id == 'restart' || id == 'nothing' || id == 'close' || id == 'flagformoderator')
  16.                 return;
  17.             votes.push(parseInt(t.find('.egg-action-tally').attr('title')) | 0)
  18.             buttons.push(t.find('button'))
  19.         })
  20.         var maxIndex = 0
  21.         for(var i = 0; i < votes.length; i++) {
  22.             if (votes[i] > votes[maxIndex])
  23.                 maxIndex = i
  24.         }
  25.         console.log('Voted for ' + buttons[maxIndex].text())
  26.         buttons[maxIndex].click()
  27.     }
  28.     vote()
  29.     egger = setInterval(vote, 500)
  30. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement