Advertisement
Guest User

Eggbot

a guest
Mar 31st, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  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. var time = $('#egg-clock-text')
  6. var actions = $('.egg-action')
  7. function vote() {
  8. if (time.text() != '1')
  9. return
  10. var votes = [], buttons = []
  11. actions.each(function() {
  12. var t = $(this)
  13. votes.push(parseInt(t.find('.egg-action-tally').attr('title')) | 0)
  14. buttons.push(t.find('button'))
  15. })
  16. var maxIndex = 0
  17. for(var i = 0; i < votes.length; i++) {
  18. if (votes[i] > votes[maxIndex])
  19. maxIndex = i
  20. }
  21. console.log('Voted for ' + buttons[maxIndex].text())
  22. buttons[maxIndex].click()
  23. }
  24. vote()
  25. egger = setInterval(vote, 500)
  26. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement