5 ms·
Play automatically: setInterval(function(){ $("a").click() }, 100) (Edit: Yes, this leads you through a very fast, very bad life. Play manually and have a
by jffry 13y ago
Play automatically:
setInterval(function(){ $("a").click() }, 100)
(Edit: Yes, this leads you through a very fast, very bad life. Play manually and have a better life.)
- caio1982 13y agoI think you missed the point here, but nice trick :-)
- parasight 13y agoDrowning in problems? Automation is the solution ;)
- wingerlang 13y agoAnd now you have N+1 problem.
- err4nt 13y agoAmen to that
- shawnz 13y agoHilariously, this gets stuck buying "Stuff" over and over and doesn't seem to ever complete the game
- jffry 13y agoFor me it ended in my death, with no hope left. It might be a slight timing problem (e.g. play around with the interval and see what happens)
- joshlegs 13y agoI died with hope!! Also, I noticed that something compounded to solve if you had more of them, notably stress. When you only had 1, it was instantaneous to solve. If you had more than one, the percent counter took time
- jsmeaton 13y agoNoticed that too - thought it was pretty significant.
- JumpCrisscross 13y agoIt is appropriate that relying on a static heuristic to point one's path leaves you unfulfilled, bitter, and dead.
- elinchrome 13y agoI wasn't aware that clicking different things in different orders affected the outcome. I have just been clicking solve every time it comes up and not reading the captions.
- fcatalan 13y agoSo now stop a bit. Reread what you wrote, think about what you did and the outcome. Harrowing isn't it?
- CyberShadow 13y ago> I wasn't aware that clicking different things in different orders affected the outcome. I don't think it does. Here's the relevant part of the (dart2js'd but slightly cleaned-up) code: https://gist.github.com/CyberShadow/11329584 https://gist.github.com/CyberShadow/11329584 Edit: I made a full graph of the entire game: https://news.ycombinator.com/item?id=7652770 https://news.ycombinator.com/item?id=7652770
- hmgibson23 13y ago- Integrity for using jQuery? Lol
- LukeB_UK 13y agoActually, the chrome dev tools allow you to use $(selector) even if the site doesn't have jQuery enabled. [0] [0] https://developers.google.com/chrome-developer-tools/docs/commandline-api#selector https://developers.google.com/chrome-developer-tools/docs/co...
- hmgibson23 13y agoDidn't know that. Nice point!
- sashasklar 13y agoSeriously? window.setInterval(function(){ Array.prototype.forEach.call(document.querySelectorAll('a'),function(i) {i.dispatchEvent(event)})},1000);
- jffry 13y agoI was going for quick and dirty. $(foo).click() was available so why not use it?
- hmgibson23 13y agoIt was a joke...
- sashasklar 13y agoKinda. I use jQuery when it makes sense, and when I'm working on someone else's dime and time. Use vanilla JS for stuff like this, because why lose an opportunity to learn?
- deleted 13y ago[deleted]
- hmgibson23 13y agoSeriously it was a joke
- cturhan 13y agonope, that wont work at all. Even if you add jquery manually, this won't work at all. The correct one should be fireEvent = function(element){ var event; // The custom event that will be created if (document.createEvent) { event = document.createEvent("HTMLEvents"); event.initEvent("click", true, true); } else { event = document.createEventObject(); event.eventType = "click"; } event.eventName = "name-of-custom-event"; if (document.createEvent) { element.dispatchEvent(event); } else { element.fireEvent("on" + event.eventType, event); } } setInterval(function(){ Array.prototype.forEach.call(document.querySelectorAll('a'),function(d){ fireEvent(d); }) }, 1000);
- deleted 13y ago[deleted]
- elliottkember 13y agoQuick to call someone stupid, aren't we? Did you even try his code? Go try it. Just because a site doesn't have jQuery, doesn't mean $ isn't assigned to anything.
- joshstrange 13y agoPretty sure cturhan did try jffry's code and that's why he wrote this code. The $ var on the page only returns the first instance that it matches so his code doesn't work. A less efficient but shorter way is: var interval = setInterval(function(){ var links = document.querySelectorAll('#problems a'); for(var z =0; z< links.length; z++) { $('#'+links[z].id).click(); } }, 1000); Also he never called him stupid he simply informed him that it didn't work.
- elliottkember 13y agoYou're right, sorry - it was the supercilious tone I objected to. In fact $() returns the first element and clicks it. Because it's in a setInterval, it continues to click the first <a> it finds every 100ms. Did you try it?
- 13y ago
- egeozcan 13y agoThe first thing I did after figuring out how the game works was typing this: setInterval(function({[].slice.call(document.querySelectorAll("a")).forEach(function(a){a.click()})},100) It feels great to know there are some more people who think of automating first, a better life second =)
- jaeh 13y agothis version of the script gets you through the game: https://github.com/jaeh/willyoudrown/blob/master/willyoudrown.js https://github.com/jaeh/willyoudrown/blob/master/willyoudrow... i am also thinking about writing some ifs into it that allow you to focus on "friends", "happy buddha", "people person", "wisdom", "early death" and maybe some other criteria, but that needs user interface and more time, which i dont have today ;)
- dennisgorelik 13y agoThis code: setInterval(function(){ $("a").click() }, 1000) leads to a very long life. Since "You need to learn." is at the bottom of task list, with 1s delay it never gets attention, so you don't learn, so you don't age. Here's what I've got: You have: Hope Body Life Love 309 Memory Integrity Job 180 Experience 53 Friend 4 Respect 216 Stuff 102 Broken Heart 6 Stress Knowledge Lover You are troubled. [Can't afford] -Integrity -Lost Ambition