Earler in my other thread, I said that maybe I'd make a plugin to screw with 999dice's potential cheat system. After all the crap this has caused, and the crap I'd have to put up with, and given the fact that there is most likely nothing to come of all this (some bad publicity which people will soon forget), I wrote this.
If you bet at 999dice, after the page loads, hit ctrl-shift-J to open the javascript console. Copy the code below and paste it in there and hit enter.
What the script does:
It rewrites the place bets high and low buttons, so that instead of placing a bet, first it sets a randomly generated client seed (you can turn this off, change the first line to = false), it then requests the server seed, waits for it to load, THEN places the bet.
By using this script when you access 999dice, every bet you make will pull the server seed before placing the bet. If everyone starts using this, he'll likely go broke, as he can't cheat anyone anymore.
I hope to add the ability to save the seeds, but I've never done any javascript with saving a file, so thats not added yet. Would love to see any contributions anyone can make.
I was also going to make the script validate Loss bets, but the actual server seed is not available on the main page. I can likely get it with some ajax calls, but thats a lot of work for today. For now, this is good enough to make sure he never scams YOU.
var want_me_to_do_the_client_seed = true;
var hash = "null";
var clickcounter = 0;
var interval_id = 0;
var check_id = 0;
var curr_secret = $("#LastBetInfoSecret").html();
$("#AccountTabManualSeed").prop('checked', true);
$(".ManualSeedControls").show();
function checkbet() {
var secret = $("#LastBetInfoSecret").html();
if(secret == curr_secret)
return;
curr_secret = secret;
clearInterval(check_id);
// Hope to add bet verification here soon
}
function fairclick(hilo) {
hash = $(".FairTabServerSeedHash").html();
if(hash == "null") {
clickcounter++;
if(clickcounter >= 8) {
clearInterval(interval_id);
clickcounter = 0;
alert('Error loading/finding server hash. Bet not placed. Try again?');
}
return;
}
clickcounter = 0;
clearInterval(interval_id);
last_hash = hash;
if(hilo == "Low")
view.controls.betLow();
else
view.controls.betHigh();
check_id = setInterval(checkbet, 250);
}
$("#BetLowButton").children(".BetControlTitle").html("Bet Low<br>(FAIRLY!)");
$("#BetLowButton").children(".BetControlTitle").css("font-size", 18);
$("#BetLowButton").unbind("click");
$("#BetLowButton").click(function() {
if(clickcounter)
return;
if(want_me_to_do_the_client_seed) {
var newseed = Math.floor(Math.random() * 999999999);
$(".ManualSeedControls:visible input").val(newseed);
$("#FairTabClientSeed").val(newseed);
view.controls.updateClientSeed();
}
hash = $(".FairTabServerSeedHash").html();
if(hash == "null")
$(".FairTabReveal").trigger("click");
interval_id = setInterval(fairclick, 250, "Low");
});
$("#BetHighButton").children(".BetControlTitle").html("Bet High<br>(FAIRLY!)");
$("#BetHighButton").children(".BetControlTitle").css("font-size", 18);
$("#BetHighButton").unbind("click");
$("#BetHighButton").click(function() {
if(clickcounter)
return;
if(want_me_to_do_the_client_seed) {
var newseed = Math.floor(Math.random() * 999999999);
$(".ManualSeedControls:visible input").val(newseed);
$("#FairTabClientSeed").val(newseed);
view.controls.updateClientSeed();
}
hash = $(".FairTabServerSeedHash").html();
if(hash == "null")
$(".FairTabReveal").trigger("click");
interval_id = setInterval(fairclick, 250, "High");
});