Jump to content
AleksandarZ

[$800] PD Weekly Heroes Wk36

Recommended Posts

82.34

117,792,767,064 (https://primedice.com/?iid=house%3A117792767064&modal=bet)

This is a nice and straightforward one! If anyone wants a script for hunting roll number ranges, here you go - just paste it into your console, and make sure all the numbers are right before you run it:

// ==========================================
// Copy from here...

let stopContinousBetting = false;

function placeBet(rollUntilStop, betVariables){
	let token = localStorage["session"].replaceAll("\"", "");
	let query = {
		"operationName":"PrimediceRoll",
		"variables": betVariables,
		"query":"mutation PrimediceRoll($amount: Float!, $target: Float!, $condition: CasinoGamePrimediceConditionEnum!, $currency: CurrencyEnum!) {\n  primediceRoll(amount: $amount, target: $target, condition: $condition, currency: $currency) {\n    ...CasinoBetFragment\n    state {\n      ...PrimediceStateFragment\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment CasinoBetFragment on CasinoBet {\n  id\n  active\n  payoutMultiplier\n  amountMultiplier\n  amount\n  payout\n  updatedAt\n  currency\n  game\n  user {\n    id\n    name\n    __typename\n  }\n  __typename\n}\n\nfragment PrimediceStateFragment on CasinoGamePrimedice {\n  result\n  target\n  condition\n  __typename\n}\n"
	};

	fetch("https://primedice.com/_api/graphql", {
		method: "POST",
		headers: {
			"x-access-token": token,
			"x-language": "en",
			"x-lockdown-token": "",
			"content-type": "application/json",
			"content-length": query.length
		}, 
		body: JSON.stringify(query)
	}).then(response => {
		if (response.ok){
			return response.json();
		}
		else{
			console.log("Request failed!", response);
		}
	}).then((jsonBody) => {
		if (jsonBody.data.primediceRoll){
			let roll = jsonBody.data.primediceRoll;
			let condition = roll.state.condition;
			let target = roll.state.target;
			let rollNumber = +roll.state.result.toFixed(2);
			let won = condition === "above"
				? rollNumber > target
				: rollNumber < target;

			console.log (
				won ? "Win" : "Loss",
				rollNumber);

			if (rollUntilStop && !shouldStopBetting(won, rollNumber)){
				placeBet(rollUntilStop, betVariables);
			}
		}
		else{
			console.log("No roll returned!", jsonBody);
		}
	});
}

function shouldStopBetting(won, rollNumber){
	if (stopContinousBetting){
		console.log("Betting manually stopped!");
		stopContinousBetting = false;
		return true;
	}

	if (won
		&& rollNumber > 81.00
		&& rollNumber < 83.00) {
		console.log("Stop condition met!");
		return true;
	}
	return false;
}

function stopBetting(){
	stopContinousBetting = true;
}

// ...To here.
// ==========================================


// Run this only after you've input the exact bet parameters you want
placeBet(
	true,
	{
		"currency":"ltc",
		"amount":0.00035250,
		"target":80.19,
		"condition":"above"
	});


// Run this if you want to interrupt betting
stopBetting();

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×