Sequel to /IsaacKing/code-golf-will-someone-post-72-char
Post Javascript code in the market comments. I will run each piece of code that's 70 characters or less and doesn't use fetch() or another way of bringing in external code in my JS console on this page. (Including from comments.) If this results in this market resolving to YES, so be it. If the market is still unresolved by the close date, it resolves to NO.
If I suspect that your code will do something that I do not want it to do, such as resolve this market to NO or send you all of my mana, I will not run it. (And if that fails, I reserve the right to resolve this market N/A.)
As a change from previous markets, I am now in full cooperation with the golfers in attempting to resolve this market YES. I will provide any relevant information they ask for, such as my browser environment and any error messages or other results of running a certain code snippet. And I will no longer try to foil their plans, such as by resizing the window to change the page layout. (I do however reserve the right to refuse certain requests, such as a request to buy or sell shares in order to change what buttons exist.)
@IsaacKing Hasn't done anything bad for me! If you want to double-check you can check that $$(".ring-inset").at(-4).innerText
returns "Resolve" and likewise for the rest of the values (-4, -6, -2, -1, 0 in that order, after clicking the corresponding buttons) to make sure the buttons it picks don't do anything problematic.
@IsaacKing It runs past the end of the array and hits undefined. (Previous iterations had a check to prevent that, but I ran out of characters this time and it's not strictly necessary)
@levifinkelstein Sure! It sets a timer for every 9 milliseconds. On every tick of the timer, it gets the next element of the array of button positions (in backwards order, for no particular reason), and clicks the button at that index. We use negative indices so that it counts backwards from the end of the button list, which makes it stable regardless of whether the SELL button appears, and we select the buttons using the "ring-inset" CSS class since that excludes the comment menu drop down.
Happy to clarify more if there's a specific section of the code you're wondering about!
@A Ah wait maybe it does, I think maybe it depends whether anyone has positions in the market and whether you've previously traded in the market? Anyways I guess since we're cooperating this time you might as well give it a try and we can adjust the offsets as needed.
If you're trying to validate that it won't do anything crazy before you officially run it, you might want to change the timeout interval from 9 to 3000 or something for testing purposes. I've been doing it that way sometimes -- it makes it way easier to catch it when something is going wrong before it does something crazy.