rungxanhlv Posted April 4, 2022 Share Posted April 4, 2022 Hi guys! I try to make a script auto bet trenball but can't set bet amount in chrome console. I have tried: document.querySelector('input[type="text"]').value = "0.1"; but not success. Please help me! Thanks all. Link to comment Share on other sites More sharing options...
Skele Posted April 5, 2022 Share Posted April 5, 2022 so all of the overrides for bet take both an amount and a payout if you want to pass them, i generally will go through the and see what intellisense says is in that object, or grab it and run out all of the keys. The game object for crash is 'crash' i am assuming for trendball this is also the case i don't play trend often enough to know. Also for grabbing the bet i have found you can just use like crash.amount. Now what this doesn't do is give you the correct value if if you have programatically just replaced the value in the input element instead. But there is crash.setamount etc... I haven'ty be able yo figure out exactly what it wants object wise even looking at how the it is using the values i am still not sure on the object type it wants, also not sure of the actual type name being used in like crash.amount. It looks to me to get a representation in like base, and then scientific notation or something but i have looked at it hard enough to know for sure. Link to comment Share on other sites More sharing options...
rungxanhlv Posted April 5, 2022 Author Share Posted April 5, 2022 44 minutes ago, Skele said: so all of the overrides for bet take both an amount and a payout if you want to pass them, i generally will go through the and see what intellisense says is in that object, or grab it and run out all of the keys. The game object for crash is 'crash' i am assuming for trendball this is also the case i don't play trend often enough to know. Also for grabbing the bet i have found you can just use like crash.amount. Now what this doesn't do is give you the correct value if if you have programatically just replaced the value in the input element instead. But there is crash.setamount etc... I haven'ty be able yo figure out exactly what it wants object wise even looking at how the it is using the values i am still not sure on the object type it wants, also not sure of the actual type name being used in like crash.amount. It looks to me to get a representation in like base, and then scientific notation or something but i have looked at it hard enough to know for sure. Thank for yeur reply! I know "crash.setamount" but i don't know how to use it. i'm trying to learn about it and this is a simple code for who want to control trenball. I'm not a coder :(( console.log("Auto Trenball BC.game by Rungxanhlv - v1.0"); console.log("Auto start betting on next game. Please wait..."); var last_gameID = crash.gameId; newGame(); function newGame(){ game_Interval = setInterval( function(){ if (crash.gameId == last_gameID+1) { console.log("Game ID: " + crash.gameId); last_gameID = crash.gameId; clearInterval(game_Interval); makebet(); } }, 100); } function makebet(){ if (crash.status == 1) { console.log(" Place a bet") } if (crash.status == 2) { console.log(" Game is running") } wait_Interval = setInterval( function(){ console.log(" Wait..."); if (crash.status == 3) { console.log(" Game end"); console.log(" crash: " + crash.rate); console.log(" Hash: " + crash.hash); clearInterval(wait_Interval); newGame(); }; }, 100); } Link to comment Share on other sites More sharing options...
Skele Posted April 5, 2022 Share Posted April 5, 2022 why aren't you subscribing to the events on the crash object? like crash._events.betStart crash._events.betEnd etc... you really only need the betStart i think then you can use the asyn syntactical sugar to wait for the bet to finish. also since you are using client side you can get the lst 30 games history (i don't know if you have a need or interest in that) as well as other players placed bets. that way you wouldn't be relying on a fast loop or else run the risk of missing a game just because of timing. Link to comment Share on other sites More sharing options...
rungxanhlv Posted April 6, 2022 Author Share Posted April 6, 2022 I will optimize according to your suggestion. but which i need at the moment is how to place bet in my script. Please suggest if you have any ideas. Have a nice day! (sorry for my weak english) Link to comment Share on other sites More sharing options...
Skele Posted April 6, 2022 Share Posted April 6, 2022 Your english is fine enough for me to understand it that is all that matters to me. I am still trying to figure out the easiest way for your to programatically bet I was looking at their existing code and i will be trying a few things out today to see what will actually work. If you want to change payouts there are handle methods for that at least. Link to comment Share on other sites More sharing options...
rungxanhlv Posted April 11, 2022 Author Share Posted April 11, 2022 have any update @Skele? Link to comment Share on other sites More sharing options...
Skele Posted April 29, 2022 Share Posted April 29, 2022 no i need to revisit this but no as of yet Link to comment Share on other sites More sharing options...
rungxanhlv Posted May 3, 2022 Author Share Posted May 3, 2022 i found a solution: var bet_amount = 0.1; function setbetValue(element, value) { let lastValue = element.value; element.value = value; let event = new Event("input", { target: element, bubbles: true }); // React 15 event.simulated = true; // React 16 let tracker = element._valueTracker; if (tracker) { tracker.setValue(lastValue); } element.dispatchEvent(event); } setbetValue(document.querySelector('input'), bet_amount); document.querySelector('input').dispatchEvent(new Event('focusin', { bubbles: true })); document.querySelector('input').dispatchEvent(new Event('focusout', { bubbles: true })); document.querySelectorAll('.game-control-panel .button-inner')[0].click(); // bet red Link to comment Share on other sites More sharing options...
Skele Posted May 4, 2022 Share Posted May 4, 2022 I think what they are doing in their code is using decimal.js var newInput = New Decimal(value); Link to comment Share on other sites More sharing options...
Jamiekson Posted July 18, 2022 Share Posted July 18, 2022 Thank you for this... Do either of you know how to do this and set the bet amount based on a % of your balance? Link to comment Share on other sites More sharing options...
Skele Posted July 19, 2022 Share Posted July 19, 2022 ok so to reliably set the amount for the bet on anygame on here. I am doing something kind of hackey here but it work. I am taking the amount of the current bet, multiplying it by 0, then adding whatever value i want and it returns it as the Decimal class that i can't seem to find access to. dg.setAmount(dg.amount.mul(0).add(0.02)) and for a percentage of your money let betAmount = ss.wallet.dict[ss.wallet.current].amount * percentageAsDecimal dg.setAmount(dg.amount.mul(0).add(betAmount)) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.