Joined: Jan '09
Location: Italy
Age: 53 (M)
Posts: 3871
Anyone here know how to use javascript?
Specifically I am trying to use a simple bot on a sort of betting/rolling dice site.
I want to have some fun testing this "bot" on the old loosing method of martingale system (with some sort of free money they give away hourly) and would like to change some variables to see how bot/site behave consequently.
My problem is I can't understand which command lines contain the variables I'd like to change.
If someone of you mobsters have the needed knowledge and want to spend some minutes for this let me know.
initialBalance = parseFloat($('#balance').html()); hilo = 'hi'; multiplier = 1; startTime = new Date().getTime(); rollDice = function() {
if ($('#double_your_btc_bet_lose').html() !== '') { $('#double_your_btc_2x').click(); multiplier++; if (bconfig.toggleHilo) toggleHiLo(); } else { setStartBet(); $('#double_your_btc_bet_win').html(''); var cmsg = { lose: $('#double_your_btc_bet_lose').html(), win: $('#double_your_btc_bet_win').html() }; cmsg = JSON.stringify(cmsg); }
if (multiplier > bconfig.alertMultiplier) { if (window.confirm("You have already lost " + (Math.pow(2, (multiplier - 1)) - 1) + " and you are about to lose " + Math.pow(2, (multiplier - 1)) + ". Click 'cancel' to reset the bet amount to 1 or 'ok' to take the risk?" ) {
initialBalance = parseFloat($('#balance').html()); hilo = 'hi'; multiplier = 1; startTime = new Date().getTime(); rollDice = function() {
if ($('#double_your_btc_bet_lose').html() !== '') { $('#double_your_btc_2x').click(); multiplier++; if (bconfig.toggleHilo) toggleHiLo(); } else { setStartBet(); $('#double_your_btc_bet_win').html(''); var cmsg = { lose: $('#double_your_btc_bet_lose').html(), win: $('#double_your_btc_bet_win').html() }; cmsg = JSON.stringify(cmsg); }
if (multiplier > bconfig.alertMultiplier) { if (window.confirm("You have already lost " + (Math.pow(2, (multiplier - 1)) - 1) + " and you are about to lose " + Math.pow(2, (multiplier - 1)) + ". Click 'cancel' to reset the bet amount to 1 or 'ok' to take the risk?" )) {
The bot I posted (don't know if bot is the right name for this commands) perform basically these simple following actions:
- bets 0.00000001 (min bet available) on HI - then roll the "dice" - if wins then bets 0.00000001 on LOW and roll the dice - if looses then double the bet on HI and roll the dice again
I would like to change the min bet amount to 0.00000002 (or 3 or 4 or 5 etc depending on my available balance but can't understand how to do it.
PS: there are also useful side features like: time counter, win/loose counters, pop up alert and so on but we may discuss about them eventually later on if you like
It seems to me that this script interacts with the page using jQuery. The page itself has an element that holds the initial stake: '#double_your_btc_stake'.
Joined: Jan '09
Location: Italy
Age: 53 (M)
Posts: 3871
Posted by marqis: Okay, some messy code here...
It seems to me that this script interacts with the page using jQuery. The page itself has an element that holds the initial stake: '#double_your_btc_stake'.
You could try adding a line like:
$('#double_your_btc_stake').val('0.00000002');
just before the last line... Good luck...
when you go to that page it has the min value bet (0.00000001) prefilled in the suitable field (hope it answers to your jQuery statement).
You could try a bit of debugging: - Open the page in chrome, and press f12 (this opens the developer tools) - Open the "console" tab - Enter the string I gave you $('#double_your_btc_stake').val('0.00000002'); at the prompt, and press enter. See if the value of the stake is changed from 0.00000001 to 0.00000002
If it's some other element's value you wish to adjust, just right click it and select "Inspect element", there you can see it's id, and you can set it by using the statement I gave you, replacing double_your_btc_stake with that id.
Or is that not the point? Hard to tell, since I don't know what's on the page...
Joined: Apr '09
Location: Australia
Age: 40 (M)
Posts: 6483
I think everywhere that is says "multiplier = 1"I would change it to "= 2". Since the setStartBet function sets the value to '1'.. That would be my guess.. Also - I don't think that's JQuery is it? It using JSON to send the webrequests..
------------ Although, Marqis is definitely right about using the debbuger.. You can 'trace/track'all the variables using the inbuilt Firefox debugger (IE and Chrome have debugger as well, FF is the best, although the latest version of IE has a pretty good one too).
------------
See this bit here: if (multiplier > bconfig.alertMultiplier) { if (window.confirm("You have already lost " + (Math.pow(2, (multiplier - 1)) - 1) + " and you are about to lose " + Math.pow(2, (multiplier - 1)) + ". Click 'cancel' to reset the bet amount to 1 or 'ok' to take the risk?" )) {
That's a pop-up window and it says press cancel to set bet amount to 1, then if you read the else block, which I think is what get's executed if you hit cancel, it sets the multiplier back to 1.. So I think you should set the value to '2'everywhere that you see it being set to 1.
------------ This:
if ($('#double_your_btc_bet_lose').html() !== '') { $('#double_your_btc_2x').click(); multiplier++;
Seems to be saying, if bet is lost then increase multiplier by 1 (multiplier++ is the same as multiplier = multiplier + 1)
Edited by jessthehuman (05 January 2014 @ 08:44 GMT)
Joined: Apr '09
Location: Australia
Age: 40 (M)
Posts: 6483
Ah right, I don't have a whole lot of JQuery experience.. I work full time as a software developer, but I mostly write application code (C#, C, SQL) - but I do a little bit of web dev work as well (mostly the ASP/C#/SQL back end - but a bit of HTML/CSS/JS too - a couple of the landing page templates we've been using have a bit of JQuery functionality, but it's definitely not my strong suit).
Also - I notice this code uses JSON - I've been writing a wrapper (DLL) recently using a third-party web-service API and the web service calls are made through JSON - so have to wrap the JSON requests in .NET objects and then send them off.. It's a really really ugly way of coding, I had to download a third-party restClient app that I can use to test the web requests (much quicker than having to recompile all my code during debug phase).
Joined: Jan '09
Location: Italy
Age: 53 (M)
Posts: 3871
just bump this thread to advise people with these skills I came to know of an offer for javascript coders where you may earn bitcoins if u are interested.