Jump to content

Resetting seed


Badical

Recommended Posts

  • 8 months later...

@Skelecan you teach how to do it?

Link to comment
Share on other sites

so you can further extract this to fit your use case but this would reset the seed for Limbo

 

async function ResetSeed()
{
	var nextSeedResult = await fetch("https://bc.game/api/single/game/seed/Limbo/next-hash/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": null,
	  "method": "GET",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

	var currentSeed = nextSeedResult.data.currentSeedHash;
	var nextSeedId = nextSeedResult.data.nextSeedHash;
	
	await DoSeedChange(nextSeedId.clientSeed, "Limbo", nextSeedId.seedId);
}


async function DoSeedChange(clientseed, gameName, nextSeedId)
{
	fetch("https://bc.game/api/single/game/seed/change/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"content-type": "application/json",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": "{\"clientSeed\":\""+ clientseed +"\",\"gameName\":\""+ gameName +"\",\"nextSeedId\":" + nextSeedId + "}",
	  "method": "POST",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

}

 

So after adding those two methods you would just have to call ResetSeed(); and it will reset. 

Link to comment
Share on other sites

  • 2 weeks later...
On 3/21/2022 at 10:41 AM, Skele said:

so you can further extract this to fit your use case but this would reset the seed for Limbo

 

async function ResetSeed()
{
	var nextSeedResult = await fetch("https://bc.game/api/single/game/seed/Limbo/next-hash/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": null,
	  "method": "GET",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

	var currentSeed = nextSeedResult.data.currentSeedHash;
	var nextSeedId = nextSeedResult.data.nextSeedHash;
	
	await DoSeedChange(nextSeedId.clientSeed, "Limbo", nextSeedId.seedId);
}


async function DoSeedChange(clientseed, gameName, nextSeedId)
{
	fetch("https://bc.game/api/single/game/seed/change/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"content-type": "application/json",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": "{\"clientSeed\":\""+ clientseed +"\",\"gameName\":\""+ gameName +"\",\"nextSeedId\":" + nextSeedId + "}",
	  "method": "POST",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

}

 

So after adding those two methods you would just have to call ResetSeed(); and it will reset. 

can this be done in hash dice?

Link to comment
Share on other sites

anything with the reset the seed functionality you would have to look and replace the URLs were appropriate.  Just at a quick glance i see 3 such places in there where it references limbo by name and will likely need to be changed to whatever hash dice uses.

 

Link to comment
Share on other sites

On 4/1/2022 at 2:04 AM, Hopp said:

can this be done in hash dice?

Can you post what you used to reset dice if you did infact get that to work 

Please 

Link to comment
Share on other sites

the only URL I found is this one https://bcgame-project.github.io/verify/hashdice 

Link to comment
Share on other sites

then your looking in the wrong spot. 

fetch("https://bc.game/api/single/game/seed/HashDice/next-hash/", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "en-US,en;q=0.9",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin"
  },
  "referrer": "https://bc.game/set_seed/HashDice",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "include"
});

fetch("https://bc.game/api/single/game/seed/change/", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "en-US,en;q=0.9",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "pragma": "no-cache",
    "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin"
  },
  "referrer": "https://bc.game/set_seed/HashDice",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"clientSeed\":\"knkGR6eie1P\",\"gameName\":\"HashDice\",\"nextSeedId\":10377705}",
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
});

 

These can be found on the network tab of the developer panel at least in edge, and you can filter it down to just Fetch/XHR  They are easy to identify because the first one is the only thing that shows up when you lick on the seed button, and the second is the only thing that shows up when you click reset seed.

I of course got it to work and i have it doing to for limbo as well they are essentially the same code, honestly though. If you can't take what has been given which is almost the entire solution minus swaping a few words, and make it work, then you put 0 effort into it, and don't deserve the final answer.  So just replace the obvious spots, and yes it does work its using the exact same calls that are made when you push the seed button and then the reset button.

Link to comment
Share on other sites

its just another input into the hash algorithm sometimes after a bad losing streak or maybe after a large winning streak turning into a losing streak some poeple feel you can sort of reboot everything by resetting the seed.  I personally haven't noticed a difference when i do it, that being said i still do it fairly regularly. I don't know if there is any strategy behind using a specific client seed that you specify or not.  I have also done this and didn't notice a difference.  Maybe someone else has some ideas with more evidence behind them.

 

As for my experience i setup limbo to reset the seed after 4 losses in a row, and let it run, and in my instance it did significantly worse than if i had just left it.  I am sure this was just a random fluke and there is probably no difference but just stating my experience.

Link to comment
Share on other sites

  • 4 weeks later...
On 3/21/2022 at 10:41 AM, Skele said:

so you can further extract this to fit your use case but this would reset the seed for Limbo

 

async function ResetSeed()
{
	var nextSeedResult = await fetch("https://bc.game/api/single/game/seed/Limbo/next-hash/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": null,
	  "method": "GET",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

	var currentSeed = nextSeedResult.data.currentSeedHash;
	var nextSeedId = nextSeedResult.data.nextSeedHash;
	
	await DoSeedChange(nextSeedId.clientSeed, "Limbo", nextSeedId.seedId);
}


async function DoSeedChange(clientseed, gameName, nextSeedId)
{
	fetch("https://bc.game/api/single/game/seed/change/", {
	  "headers": {
		"accept": "application/json, text/plain, */*",
		"accept-language": "en-US,en;q=0.9",
		"content-type": "application/json",
		"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Microsoft Edge\";v=\"99\"",
		"sec-ch-ua-mobile": "?0",
		"sec-ch-ua-platform": "\"Windows\"",
		"sec-fetch-dest": "empty",
		"sec-fetch-mode": "cors",
		"sec-fetch-site": "same-origin"
	  },
	  "referrer": window.location.href,
	  "referrerPolicy": "strict-origin-when-cross-origin",
	  "body": "{\"clientSeed\":\""+ clientseed +"\",\"gameName\":\""+ gameName +"\",\"nextSeedId\":" + nextSeedId + "}",
	  "method": "POST",
	  "mode": "cors",
	  "credentials": "include"
	}).then(res => res.clone().json());

}

 

So after adding those two methods you would just have to call ResetSeed(); and it will reset. 

image.png.cea26b9be6f4cf35038b49e4bb5c7758.png

I'm trying to use this script to reset the seed but keep getting this error, any ideas why would that be?

Link to comment
Share on other sites

well then i know you did it wrong.  This cannot be used in the sandbox environment. Read the full posts for best results.  In order to use this you would have to use like the dev console or a user script plugin.

 

or you could try looking at the sites call and replacing the window.,href.location with the url of the page you calling it from.  This is the problem with just willy nilly using scripts that you don't understand what they do.  

In the scripting sandbox they give you you are essentially cut off from all other storage and variables except those passed to you using the sendmessage method.  So you can't access the DOM or localstorage, or global variables that aren't defined within that scope.

 

Window incase you are confused is part of the DOM and represents the current infocus window.

Link to comment
Share on other sites

How do you even use a script on limbo?

Link to comment
Share on other sites

well its a webpage those are driven somehow right generally javascript. Which happens to be clientside and easily injectable or usable with the dev console.  Plus it was not that long ago that Limbo had the same sandboxed built in support for scripts as hashdice does.  The hooks are still there are still there in the code. its only the UI that has been removed.

Link to comment
Share on other sites

Thank you for the tip. Will now figure it out now. Thanks a lot man. If it's not a hassle for you to send any more sample scripts I will reward kindly.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...