Skip to content

Instantly share code, notes, and snippets.

@yjroot
Created June 14, 2014 01:30
Show Gist options
  • Save yjroot/a2bcad20ff426ac052af to your computer and use it in GitHub Desktop.
Save yjroot/a2bcad20ff426ac052af to your computer and use it in GitHub Desktop.
Auto fork
function GetForkButton(uid)
{
return document.getElementById('poke_live_item_' + uid).firstChild.firstChild.nextSibling.firstChild.nextSibling.firstChild.nextSibling.firstChild.firstChild
}
function AutoFork(uid){
fork_button = GetForkButton(uid)
if (fork_button.tagName != 'A'){
setTimeout(function(){AutoFork(uid)}, (5000+Math.random()*5000))
return 0;
}
function PressButton(){
GetForkButton(uid).click()
}
setTimeout(function(){console.log('aaa');setTimeout(function(){AutoFork(uid)}, (5000+Math.random()*5000));}, (5000+Math.random()*5000))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment