There's two main ways to make a delay in javascript - the setInterval(function, delay) and setTimeout(function, delay) functions. We could do a while loop and have it run forever, but it's nice to have a little bit of a delay. It works! So now we need to automate this. Now we try something else: document.getElementById("bigCookie").click() That should return the html that we saw above. Go to the console and type: document.getElementById("bigCookie") So we know the id, and now we want to get the actual element. If we right click the cookie in Chrome, and hit 'Inspect Element', it will give us the HTML that represents the cookie, or at least a little bit of it. To do that, we need to find the name of the cookie, or some kind of identifier that will let us automate clicking. But what we want is to automate clicking. You'll be able to see everything about the website - where all the data came from, what's all running, when things get painted, what the source is, how the website interacts with the backend (get requests for json data, loading images). That will pop up a blank console that you can use to interact with the website. If you hop into a chrome / firefox console (chrome is ctrl+shift+i, or menu -> tools -> javascript console). Bottom line - If you're trying to automate a game that isn't flash, it's likely easier to use javascript to interact with the website. This also assumes you want to automate cookie clicker, but I'll give an outline for how to get what you need to automate an html game.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |