The Official Unstable Vote Equilibrium Topic
-
Rules:
- If the post is at 1 or more, you must upvote that post.
- If the post is at -1 or less, you must downvote that post.
-
@Maciejasjmj Wouldn't this mean all posts stay at 0?
-
@coldandtired said in The Official Unstable Vote Equilibrium Topic:
@Maciejasjmj Wouldn't this mean all posts stay at 0?
You're not forbidden to vote for a post that's at 0.
-
Ugh... this means now I'll have to update my script; it lacks the capability to use the post's current score in deciding whether it should upvote or downvote.
edit: done. It's not too pretty, but it'll work...
...I could probably just use
dir = eval(dir)
there, but that seems slightly more WTF-y than what I did, by encapsulating it in a function and forcing it to be an expression...
-
@anotherusername said in The Official Unstable Vote Equilibrium Topic:
Ugh... this means now I'll have to update my script; it lacks the capability to use the post's current score in deciding whether it should upvote or downvote.
edit: done. It's not too pretty, but it'll work...
...I could probably just use
dir = eval(dir)
there, but that seems slightly more WTF-y than what I did, by encapsulating it in a function and forcing it to be an expression...Why not just put the function in the array directly?
-
@ben_lubar ... um, originally because I was passing that from inside GreaseMonkey's sandbox to outside GreaseMonkey's sandbox (most of the code in my userscript needs to run outside the sandbox, because trying to use the page's socket function from inside the sandbox causes security violations). And the only way that I could figure out to get it outside the sandbox when it was defined in the sandbox was by passing it in JSON form, and JSON doesn't much like functions.
Basically... this...
But now that I look... it actually doesn't look like I'm using it inside the sandbox, other than to pass it to the function that runs outside it.
I definitely thought I needed it somewhere, but I'm not seeing it now. So I could just move the definition a few lines down and then I could use a function there, no problem.
edit: now I remember... my previous inception of an upvote script ran in the sandbox. I deleted all that code, so it's not being used anywhere else now.
-
This is a strange idea for a thread
-
-
@Jaloopa said in The Official Unstable Vote Equilibrium Topic:
This is a strange idea for a thread
I don't think we have a strange ideas thread. But nothing is stopping you from making one!