Igmss Posted October 8, 2022 Share Posted October 8, 2022 Hello members I need help as the title I have script but it's stop because the payout is invalid I need to reconnect and start the script if it's stop 1 Link to comment Share on other sites More sharing options...
Igmss Posted October 12, 2022 Author Share Posted October 12, 2022 Any one can help? Link to comment Share on other sites More sharing options...
Advent Posted November 11, 2022 Share Posted November 11, 2022 Post from rungxanhlv said: function Auto_bet(){ var Run_btn = document.documentElement.innerHTML.includes('Run Script'); if(Run_btn == true ){ document.querySelectorAll('div.button-inner')[2].click(); var find_btn = "Confirm"; var haystack = document.getElementsByClassName("button-inner"); var i; for (i = 0; i < haystack.length; i++) { if(haystack[i].innerHTML == find_btn){ console.log("Auto Start"); haystack[i].click(); } } } } var Start_Auto_bet = setInterval(Auto_bet,1000); To cancel interval run this code or refesh your browser" Link to comment Share on other sites More sharing options...
Skele Posted December 7, 2022 Share Posted December 7, 2022 setInterval(function(){ if(!crash.script.isRunning) crash.script.start(); }, 5000); 2 Link to comment Share on other sites More sharing options...
AnneMae1258 Posted December 21, 2022 Share Posted December 21, 2022 Thanks so much Link to comment Share on other sites More sharing options...
Darklights Posted December 1 Share Posted December 1 hdg.script.run and hdg.script.isRunning nőt work today :( Link to comment Share on other sites More sharing options...
9527 Posted December 4 Share Posted December 4 (edited) On 12/2/2023 at 2:25 AM, Darklights said: hdg.script.run and hdg.script.isRunning nőt work today hdg, lbg, cd are not defined now @Skele please help, how can I reuse the script in the console. Thanks You Edited December 4 by 9527 Link to comment Share on other sites More sharing options...
Skele Posted December 4 Share Posted December 4 Most likely will take some investigating to figure it out. My guess is that it is all now being done in a service worker, so you would have to figure out the correct message and send it. But I don't know for sure. I guess the other way you can do it is to automate through the actual UI, as in actually call click on the button etc.. The problem here is that they do something funky with the bet amount field so that even if you set it programatically it won't persist unless you click into the field. My guess as to what they are doing there is they are checking for a property on events that will tell you if it is actually a user event. Unfortunately you can't fake this in a client side script. You can however fake it in a browser plugin. Link to comment Share on other sites More sharing options...
Sjjmhwpenyb Posted December 5 Share Posted December 5 19 hours ago, Skele said: Most likely will take some investigating to figure it out. My guess is that it is all now being done in a service worker, so you would have to figure out the correct message and send it. But I don't know for sure. I guess the other way you can do it is to automate through the actual UI, as in actually call click on the button etc.. The problem here is that they do something funky with the bet amount field so that even if you set it programatically it won't persist unless you click into the field. My guess as to what they are doing there is they are checking for a property on events that will tell you if it is actually a user event. Unfortunately you can't fake this in a client side script. You can however fake it in a browser plugin. DISCLAIMER: I am an amateur, not a professional coder. Use this at your own risk. @Skele Hope this helps. - Haven't bothered with any of the animations, but the core functionality is similar to hdg. const source = document.location.hostname; let i1 = import("https://" + source + "/modules/games/Game-85ea9a2f.js").then(res => i_hdg = res); let i2 = import("https://" + source + "/modules/games/AllPlayers-cd388afe.js").then(res => i_bet = res); let i3 = import("https://" + source + "/modules/games/bc_external-24a959e1.js").then(res => i_externals = res); await Promise.all([i1, i2, i3]); var core_configer = (e, i, l) => i in e ? Object.defineProperty(e, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[i] = l; var core_initer = (e, i) => { for (var l in i || (i = {})) Object.prototype.hasOwnProperty.call(i, l) && core_configer(e, l, i[l]); if (Object.getOwnPropertySymbols) for (var l of Object.getOwnPropertySymbols(i)) Object.prototype.propertyIsEnumerable.call(i, l) && core_configer(e, l, i[l]); return e; }; var core_setter = (e, i, l) => (core_configer(e, typeof i != "symbol" ? i + "" : i, l), l); const c_bet = i_externals._.socket.encode(i_bet.$.roots.default.Bet); const c_init = i_externals._.socket.decode(i_bet.$.roots.default.Init); const c_betvalue = i_externals._.socket.encode(i_bet.$.roots.gameHashdice.BetValue); const c_decimal = i_externals._.Decimal.clone({precision: 9}); const myhdg = class myhdg extends i_hdg.default{ constructor(l, o, s) { super(l, o, core_initer({ allBets: [], myBets: [], autoType: "Preset" }, s)); this.socket.on("b", i_externals._.utils.intervalQueue(i_externals._.socket.decodeBind(r => { if (r.userId == i_externals._.accountStore.state.userId) { this.cacheNickName = r.nickName; return; } this.formatBetLog(r) }, i_bet.$.roots.default.BetLog), 500)), this.socket.on("j-change", i_externals._.socket.decodeBind(r => r.infos.forEach(this.setJackpot), i_bet.J)) } async bet(l, o = 0) { try { let s = this.betRequest(l, c_betvalue(this.mybetvalue), o); this.onBetRequest && (s = this.onBetRequest(s)); let r = await s; this.addresult(r); return this.addMyBet(r), this.emit("betEnd", { amount: new c_decimal(r.betAmount), odds: r.odds, currencyName: r.currencyName }), r; } catch (s) { throw s } } async betRequest(l, o, s = 0) { let r = await this.socketRequest("bet", c_bet({ frontgroundId: this.txId, currencyName: ss.wallet.current, betAmount: l.toString(), betValue: o, scriptId: s })).then(this.betResultDecoder); return this.getBetlog(r) } mypayout = (p) => { return new c_decimal(p).mul(this.oddsScale).toNumber(); }; mybetvalue = i_bet.$.roots.gameHashdice.BetValue.create({ payout: this.mypayout(2), isHigh: "true" }); addresult(result) { let x = document.querySelector("#game-HashDice > div > div.game-view > div.g1k8hpak.game-recent > div > div"); if(x !== null) { if(result.winAmount > 0) { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-win \">" + result.gameValue.gameValue + "</div></div>"; } else { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-lose \">" + result.gameValue.gameValue + "</div></div>"; } x.removeChild(x.firstChild); } } } class data { constructor() { this.wagered = 0; this.profit = 0; this.winNum = 0; this.lossNum = 0; this.profits = [0]; } clearData() { this.wagered = 0, this.profit = 0, this.winNum = 0, this.lossNum = 0, this.profits = [0] } addData(a, o) { let n = new c_decimal(o).sub(1).mul(a).toNumber(); this.wagered = new c_decimal(this.wagered).add(a).toNumber(); this.profit = new c_decimal(this.profit).add(n).toNumber(); o >= 1 ? this.winNum++ : this.lossNum++; this.profits = this.profits.concat(this.profit); window["@bc/core"].livestats.wagered = this.wagered; window["@bc/core"].livestats.profit = this.profit; window["@bc/core"].livestats.winNum = this.winNum; window["@bc/core"].livestats.lossNum = this.lossNum; window["@bc/core"].livestats.profits = window["@bc/core"].livestats.profits.concat(this.profit); } } let x = new myhdg() let qwe = new data() x.addListener("betEnd", t => qwe.addData(t.amount, t.odds)); window["@bc/core"].livestats.currencyName = ss.wallet.current; The highlighted bits do change from time to time and need to be updated. Link to comment Share on other sites More sharing options...
Skele Posted December 5 Share Posted December 5 (edited) Dude this is pretty awesome. And yes the Hashes on the files will change whenever they update. Thanks for this though. Edited December 5 by Skele Link to comment Share on other sites More sharing options...
Sjjmhwpenyb Posted December 5 Share Posted December 5 The only downside of having to create a new instance of the class is that it won't interact with any of the UI. Not a big deal for me, but I'm not sure if there is a better way to do this. The benefit of extending the class is that you can inject what ever methods or variables you need. Before the most recent update all the stuff I'm using existed in the chunks, so even if they take away the modules, it should be possible to just find everything where ever they move it to. I haven't tried, but I also assume it would be fairly trivial to implement the same thing for lbg or crash since I'm using their constructors and build in methods. Link to comment Share on other sites More sharing options...
Skele Posted December 5 Share Posted December 5 (edited) yeah it interacting with the UI doesn't matter to me either, i already recreate limbo's UI for when i am on shuffle. so it wouldn't be hard at all actually to just reuse that stuff. And this method should work for all the games i would imagine. Except for maybe beauties. Hit me up on TG. @skele69 @Sjjmhwpenyb Edited December 5 by Skele Link to comment Share on other sites More sharing options...
Sjjmhwpenyb Posted Wednesday at 08:05 AM Share Posted Wednesday at 08:05 AM (edited) Update: Added sections that: 1. manually sets the 'roll' value on bet outcome 2. manually sets high / low button selected and value on bet Now has all the useful GUI, I think. Still no animations, that just wastes time. const source = document.location.hostname; let i1 = import("https://" + source + "/modules/games/Game-85ea9a2f.js").then(res => i_hdg = res); let i2 = import("https://" + source + "/modules/games/AllPlayers-cd388afe.js").then(res => i_bet = res); let i3 = import("https://" + source + "/modules/games/bc_external-24a959e1.js").then(res => i_externals = res); await Promise.all([i1, i2, i3]); var core_configer = (e, i, l) => i in e ? Object.defineProperty(e, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[i] = l; var core_initer = (e, i) => { for (var l in i || (i = {})) Object.prototype.hasOwnProperty.call(i, l) && core_configer(e, l, i[l]); if (Object.getOwnPropertySymbols) for (var l of Object.getOwnPropertySymbols(i)) Object.prototype.propertyIsEnumerable.call(i, l) && core_configer(e, l, i[l]); return e; }; var core_setter = (e, i, l) => (core_configer(e, typeof i != "symbol" ? i + "" : i, l), l); const c_bet = i_externals._.socket.encode(i_bet.$.roots.default.Bet); const c_init = i_externals._.socket.decode(i_bet.$.roots.default.Init); const c_betvalue = i_externals._.socket.encode(i_bet.$.roots.gameHashdice.BetValue); const c_decimal = i_externals._.Decimal.clone({precision: 9}); const c_hdg = class c_hdg extends i_hdg.default{ constructor(l, o, s) { super(l, o, core_initer({ allBets: [], myBets: [], autoType: "Preset" }, s)); core_setter(this, "gameUnique", "HashDice"); this.socket.on("b", i_externals._.utils.intervalQueue(i_externals._.socket.decodeBind(r => { if (r.userId == i_externals._.accountStore.state.userId) { this.cacheNickName = r.nickName; return; } this.formatBetLog(r) }, i_bet.$.roots.default.BetLog), 500)), this.socket.on("j-change", i_externals._.socket.decodeBind(r => r.infos.forEach(this.setJackpot), i_bet.J)) } async dobet(amount, payout, ishigh, id = 0) { try { let bet = this.betRequest(amount, c_betvalue(this.mybetvalue(payout, ishigh)), id); this.addpayout(payout, ishigh) //this.onBetRequest && (bet = this.onBetRequest(bet)); let outcome = this.getBetlog(await bet); this.addMyBet(outcome); this.emit("betEnd", { amount: new c_decimal(outcome.betAmount), odds: outcome.odds, currencyName: outcome.currencyName }); this.addresult(outcome); return outcome; } catch (error) { throw new Error(error); } } async betRequest(amount, betvalue, id = 0) { return this.socketRequest("bet", c_bet({ frontgroundId: this.txId, currencyName: ss.wallet.current, betAmount: amount.toString(), betValue: betvalue, scriptId: id })).then(this.betResultDecoder); } mypayout = (p) => { return new c_decimal(p).mul(this.oddsScale).toNumber(); }; mybetvalue = (payout, isHigh) => i_bet.$.roots.gameHashdice.BetValue.create({ payout: this.mypayout(payout), isHigh: isHigh }); addpayout(odds, ishigh) { let x = document.querySelector("#game-HashDice > div > div.game-view > div.wklevwm.game-box.n17cpum0 > div > div.m18yg54v"); if(x !== null) { if(ishigh) { x.childNodes[0].className = "high-btn active"; x.childNodes[1].className = "low-btn"; } else { x.childNodes[0].className = "high-btn"; x.childNodes[1].className = "low-btn active"; } let payout = 100000 / odds * 0.99; x.childNodes[0].firstChild.innerHTML = "High > " + (99999 - payout).toFixed(); x.childNodes[1].firstChild.innerHTML = "Low < " + payout.toFixed(); } } addresult(result) { let x = document.querySelector("#game-HashDice > div > div.game-view > div.g1k8hpak.game-recent > div > div"); if(x !== null) { if(result.winAmount > 0) { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-win \">" + result.gameValue.gameValue + "</div></div>"; } else { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-lose \">" + result.gameValue.gameValue + "</div></div>"; } x.removeChild(x.firstChild); } let n = document.querySelector("#game-HashDice > div > div.game-view > div.wklevwm.game-box.n17cpum0 > div > div.nknc1ws > div > div > div.lottery-numb"); if(n !== null) { let height = Math.floor(n.firstChild.firstChild.clientHeight / 11); let strres = result.gameValue.gameValue.toString(); for (let z = 0; z < strres.length; z++) { n.childNodes[z].firstChild.style.cssText = "background-position-y: -" + parseInt(strres[z]) * height + "px;" } } } } class data { constructor() { this.wagered = 0; this.profit = 0; this.winNum = 0; this.lossNum = 0; this.profits = [0]; } clearData() { this.wagered = 0, this.profit = 0, this.winNum = 0, this.lossNum = 0, this.profits = [0] } addData(a, o) { let n = new c_decimal(o).sub(1).mul(a).toNumber(); this.wagered = new c_decimal(this.wagered).add(a).toNumber(); this.profit = new c_decimal(this.profit).add(n).toNumber(); o >= 1 ? this.winNum++ : this.lossNum++; this.profits = this.profits.concat(this.profit); window["@bc/core"].livestats.wagered = this.wagered; window["@bc/core"].livestats.profit = this.profit; window["@bc/core"].livestats.winNum = this.winNum; window["@bc/core"].livestats.lossNum = this.lossNum; window["@bc/core"].livestats.profits = window["@bc/core"].livestats.profits.concat(this.profit); } } let myhdg = new c_hdg(); let mydata = new data(); myhdg.addListener("betEnd", res => mydata.addData(res.amount, res.odds)); window["@bc/core"].livestats.currencyName = ss.wallet.current; myhdg.socket.connect(); myhdg.init(); myhdg.initPms; myhdg.active(); Edited Wednesday at 08:11 AM by Sjjmhwpenyb **replaced variable defined elsewhere** Link to comment Share on other sites More sharing options...
Thghnvyhvxrtgb Posted Wednesday at 09:37 AM Share Posted Wednesday at 09:37 AM 1 hour ago, Sjjmhwpenyb said: Update: Added sections that: 1. manually sets the 'roll' value on bet outcome 2. manually sets high / low button selected and value on bet Now has all the useful GUI, I think. Still no animations, that just wastes time. const source = document.location.hostname; let i1 = import("https://" + source + "/modules/games/Game-85ea9a2f.js").then(res => i_hdg = res); let i2 = import("https://" + source + "/modules/games/AllPlayers-cd388afe.js").then(res => i_bet = res); let i3 = import("https://" + source + "/modules/games/bc_external-24a959e1.js").then(res => i_externals = res); await Promise.all([i1, i2, i3]); var core_configer = (e, i, l) => i in e ? Object.defineProperty(e, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[i] = l; var core_initer = (e, i) => { for (var l in i || (i = {})) Object.prototype.hasOwnProperty.call(i, l) && core_configer(e, l, i[l]); if (Object.getOwnPropertySymbols) for (var l of Object.getOwnPropertySymbols(i)) Object.prototype.propertyIsEnumerable.call(i, l) && core_configer(e, l, i[l]); return e; }; var core_setter = (e, i, l) => (core_configer(e, typeof i != "symbol" ? i + "" : i, l), l); const c_bet = i_externals._.socket.encode(i_bet.$.roots.default.Bet); const c_init = i_externals._.socket.decode(i_bet.$.roots.default.Init); const c_betvalue = i_externals._.socket.encode(i_bet.$.roots.gameHashdice.BetValue); const c_decimal = i_externals._.Decimal.clone({precision: 9}); const c_hdg = class c_hdg extends i_hdg.default{ constructor(l, o, s) { super(l, o, core_initer({ allBets: [], myBets: [], autoType: "Preset" }, s)); core_setter(this, "gameUnique", "HashDice"); this.socket.on("b", i_externals._.utils.intervalQueue(i_externals._.socket.decodeBind(r => { if (r.userId == i_externals._.accountStore.state.userId) { this.cacheNickName = r.nickName; return; } this.formatBetLog(r) }, i_bet.$.roots.default.BetLog), 500)), this.socket.on("j-change", i_externals._.socket.decodeBind(r => r.infos.forEach(this.setJackpot), i_bet.J)) } async dobet(amount, payout, ishigh, id = 0) { try { let bet = this.betRequest(amount, c_betvalue(this.mybetvalue(payout, ishigh)), id); this.addpayout(payout, ishigh) //this.onBetRequest && (bet = this.onBetRequest(bet)); let outcome = this.getBetlog(await bet); this.addMyBet(outcome); this.emit("betEnd", { amount: new c_decimal(outcome.betAmount), odds: outcome.odds, currencyName: outcome.currencyName }); this.addresult(outcome); return outcome; } catch (error) { throw new Error(error); } } async betRequest(amount, betvalue, id = 0) { return this.socketRequest("bet", c_bet({ frontgroundId: this.txId, currencyName: ss.wallet.current, betAmount: amount.toString(), betValue: betvalue, scriptId: id })).then(this.betResultDecoder); } mypayout = (p) => { return new c_decimal(p).mul(this.oddsScale).toNumber(); }; mybetvalue = (payout, isHigh) => i_bet.$.roots.gameHashdice.BetValue.create({ payout: this.mypayout(payout), isHigh: isHigh }); addpayout(odds, ishigh) { let x = document.querySelector("#game-HashDice > div > div.game-view > div.wklevwm.game-box.n17cpum0 > div > div.m18yg54v"); if(x !== null) { if(ishigh) { x.childNodes[0].className = "high-btn active"; x.childNodes[1].className = "low-btn"; } else { x.childNodes[0].className = "high-btn"; x.childNodes[1].className = "low-btn active"; } let payout = 100000 / odds * 0.99; x.childNodes[0].firstChild.innerHTML = "High > " + (99999 - payout).toFixed(); x.childNodes[1].firstChild.innerHTML = "Low < " + payout.toFixed(); } } addresult(result) { let x = document.querySelector("#game-HashDice > div > div.game-view > div.g1k8hpak.game-recent > div > div"); if(x !== null) { if(result.winAmount > 0) { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-win \">" + result.gameValue.gameValue + "</div></div>"; } else { x.innerHTML += "<div class=\"recent-item\" style=\"width: 11.1111%;\"><\div class=\"item-wrap is-lose \">" + result.gameValue.gameValue + "</div></div>"; } x.removeChild(x.firstChild); } let n = document.querySelector("#game-HashDice > div > div.game-view > div.wklevwm.game-box.n17cpum0 > div > div.nknc1ws > div > div > div.lottery-numb"); if(n !== null) { let height = Math.floor(n.firstChild.firstChild.clientHeight / 11); let strres = result.gameValue.gameValue.toString(); for (let z = 0; z < strres.length; z++) { n.childNodes[z].firstChild.style.cssText = "background-position-y: -" + parseInt(strres[z]) * height + "px;" } } } } class data { constructor() { this.wagered = 0; this.profit = 0; this.winNum = 0; this.lossNum = 0; this.profits = [0]; } clearData() { this.wagered = 0, this.profit = 0, this.winNum = 0, this.lossNum = 0, this.profits = [0] } addData(a, o) { let n = new c_decimal(o).sub(1).mul(a).toNumber(); this.wagered = new c_decimal(this.wagered).add(a).toNumber(); this.profit = new c_decimal(this.profit).add(n).toNumber(); o >= 1 ? this.winNum++ : this.lossNum++; this.profits = this.profits.concat(this.profit); window["@bc/core"].livestats.wagered = this.wagered; window["@bc/core"].livestats.profit = this.profit; window["@bc/core"].livestats.winNum = this.winNum; window["@bc/core"].livestats.lossNum = this.lossNum; window["@bc/core"].livestats.profits = window["@bc/core"].livestats.profits.concat(this.profit); } } let myhdg = new c_hdg(); let mydata = new data(); myhdg.addListener("betEnd", res => mydata.addData(res.amount, res.odds)); window["@bc/core"].livestats.currencyName = ss.wallet.current; myhdg.socket.connect(); myhdg.init(); myhdg.initPms; myhdg.active(); where am i gonna add all this codes? in console? i feel lost Link to comment Share on other sites More sharing options...
Sjjmhwpenyb Posted Wednesday at 12:17 PM Share Posted Wednesday at 12:17 PM (edited) 2 hours ago, Thghnvyhvxrtgb said: where am i gonna add all this codes? in console? i feel lost I suppose you could technically just dump it all into the console and it would work, not sure how you intend to actually use it from there though. Probably better to modify it to suit your needs then include it in the .js with the rest of your script or a separate .js that you import to your script. I think with javascript injection scripts like this, it is probably quite important to have a pretty good idea of what the code is doing and how it works before implementing it, especially if it was written by someone who doesn't have enough experience to be giving advise (like me). The purpose of this was more just to see if it was possible, and because I thought it was quite unkind for BC to just take away hdg without any notice or warning, not to thoroughly test its implementation. Edited Wednesday at 12:23 PM by Sjjmhwpenyb Link to comment Share on other sites More sharing options...
Skele Posted Wednesday at 03:21 PM Share Posted Wednesday at 03:21 PM @Sjjmhwpenyb hit me up on telegram. Link to comment Share on other sites More sharing options...
Recommended Posts
You need to be a member in order to leave a comment
Sign up for a new account in our community. It's easy!
Register a new accountAlready have an account? Sign in here.
Sign In Now