Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
October 10, 2012, 04:57:22 PM |
|
It's a Java application. Requires http://code.google.com/p/json-simple/ to build and parse JSON. // (c) 2012 Come-from-Beyond
import java.io.InputStream; import java.io.OutputStream; import java.net.Authenticator; import java.net.HttpURLConnection; import java.net.PasswordAuthentication; import java.net.URL; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue;
public final class SDMB { public static void main(String[] args) { try { Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication ("username", "password".toCharArray()); } }); while (true) { double bet=((double)(balance(1)/135))/100000000; if (bet<0.01) { Thread.sleep(1000); continue; } for (int i=0; i<7; i++) { final long balance1=balance(0); final JSONObject request=new JSONObject(); request.put("method", "sendtoaddress"); final JSONArray params; (params=new JSONArray()).add("1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp"); params.add(bet); request.put("params", params); sendRequest(request); final long balance2=balance(0); long balance3; do { Thread.sleep(1000); } while ((balance3=balance(0))<=balance2); if (balance3>=balance1) break; bet=bet+bet; } } } catch (final Exception e) { System.out.println(e.toString()); } } public static JSONObject sendRequest(final JSONObject request) throws Exception { final HttpURLConnection connection; (connection=(HttpURLConnection)(new URL("http://localhost:9876")).openConnection()).setRequestMethod("POST"); connection.setDoOutput(true); connection.connect(); final OutputStream outputStream; (outputStream=connection.getOutputStream()).write(request.toJSONString().getBytes("UTF-8")); outputStream.close(); final InputStream inputStream=connection.getInputStream(); final byte[] response=new byte[65536]; int ptr=0; int numberOfBytes; do { if ((numberOfBytes=inputStream.read(response, ptr, 65536-ptr))>=0) ptr+=numberOfBytes; } while (numberOfBytes>=0); inputStream.close(); connection.disconnect(); return (JSONObject)JSONValue.parse(new String(response, 0, ptr, "UTF-8")); } public static long balance(final int numberOfConfirmations) throws Exception { final JSONObject request=new JSONObject(); request.put("method", "listaccounts"); final JSONArray params; (params=new JSONArray()).add(numberOfConfirmations); request.put("params", params); return (long)(((Double)((JSONObject)sendRequest(request).get("result")).get("")).doubleValue()*100000000); } } It starts with 1/128 of current confirmed balance as an initial bet and then double amount if lose. I divide by 135, not 128, to have some BTC for tx fees: double bet=((double)(balance(1)/135))/100000000; if (bet<0.01) ...is used to avoid too low bets. I tested it on 2000 bets using "lessthen 32000". Went from 0 BTC to 14 BTC and back to 0 BTC. At the beginning I used my own bitcoins which were removed from the capital when I got 10 BTC from SatoshiDice. After my bitcoin-qt.exe had reached 1500 thx it started to lag much. After 2000 thx I became bored and made a couple of big bets manually until I lost all won money. Nothing surprising, but at least miners earned 1 BTC as fees. NB: In the long run SatoshiDice wins so don't miss a right moment to stop.
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
October 12, 2012, 05:06:18 PM |
|
I decided to add a compiled version of the bot for those who r unfamiliar with Java: http://www.4shared.com/file/UeCqpEXa/MartinBot.htmlHow to use1. Download and install Java Runtime Environment 7 (JRE): http://www.oracle.com/technetwork/java/javase/downloads/index.html2. Launch bitcoin-qt.exe in server mode: bitcoin-qt.exe -server -rpcport=9876 -rpcuser=MYUSERNAME -rpcpassword=MYPASSWORD -rpcallowip=127.0.0.1 3. Launch the bot: java -cp MartinBot.jar MartinBot http://127.0.0.1:9876 MYUSERNAME MYPASSWORD 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp 0.1 2.0 Last 2 parameters are starting bet (0.1) and quotient (2.0) for next bets in case of loss. To stop the bot press [CTRL]+[C].
|
|
|
|
SätöshiTable
Newbie
Offline
Activity: 28
Merit: 0
|
|
October 12, 2012, 06:01:47 PM |
|
nice job, maybe build some random delays into the bot, could help to win more
|
|
|
|
22bones
Newbie
Offline
Activity: 42
Merit: 0
|
|
October 13, 2012, 02:48:07 AM |
|
Nice work. I ran a slightly modified version of this just now, and eventually ran out of coins when it lost the 'less than 32000' game 14 times in a row! (on btcdice.com) Only lost a small amount of BTC but it was fun.
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
October 13, 2012, 05:51:15 AM |
|
it lost the 'less than 32000' game 14 times in a row!
WOW!
|
|
|
|
Gyrsur
Legendary
Offline
Activity: 2856
Merit: 1520
Bitcoin Legal Tender Countries: 2 of 206
|
|
October 13, 2012, 09:40:45 PM |
|
please don't play this all in any way. no chance at all. prevent loss from newbies.
|
|
|
|
|
🏰 TradeFortress 🏰
Bitcoin Veteran
VIP
Legendary
Offline
Activity: 1316
Merit: 1043
👻
|
|
October 14, 2012, 10:37:51 PM |
|
In addition, you will probably lose everything if you went on.
But thanks for making the bot - gambling it NOT A WAY TO GET BITCOINS, it's for entertainment.
|
|
|
|
squid
Member
Offline
Activity: 112
Merit: 10
|
|
October 14, 2012, 10:56:25 PM |
|
great, i'll have to throw away some money later
|
|
|
|
pyromaniac
|
|
October 30, 2012, 04:33:23 PM |
|
Here is my preset for this bot. Works much better than mining. About 0.5 BTC per hour with minimal risk. java -cp MartinBot.jar MartinBot http://127.0.0.1:9876 LOGIN PASSWORD 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp 0.003 3.3
|
|
|
|
jasinlee
|
|
November 02, 2012, 05:07:26 AM |
|
Attempted to test it but kept getting java.net.ConnectException: Connection refused: connect
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
November 02, 2012, 06:19:17 AM |
|
Attempted to test it but kept getting java.net.ConnectException: Connection refused: connect Have u launched bitcoin-qt.exe this way: bitcoin-qt.exe -server -rpcport=9876 -rpcuser=MYUSERNAME -rpcpassword=MYPASSWORD -rpcallowip=127.0.0.1 ?
|
|
|
|
jasinlee
|
|
November 02, 2012, 07:41:23 AM |
|
Yeah it worked without error after I made th .conf . Just the java is fighting me.
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
November 02, 2012, 08:18:33 AM |
|
Yeah it worked without error after I made th .conf . Just the java is fighting me.
Unfortunatelly, I have to work on ur computer to find the issue. Check firewall settings, I use MartinBot.jar by myself without any problems.
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
November 02, 2012, 08:25:54 AM |
|
please don't play this all in any way. no chance at all. prevent loss from newbies.
Actually, if you configure it correctly, you are muck more likely to win than to lose. The problem is, if you do lose, you lose much, much more than you tried to win. It's like a reverse lottery where 99.9% of the people get $1. But one out of 1,000 people get tortured to death. Of course, your "expected profit" is negative. However, you are more likely to win than to lose.
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
November 02, 2012, 08:40:43 AM |
|
please don't play this all in any way. no chance at all. prevent loss from newbies.
Actually, if you configure it correctly, you are muck more likely to win than to lose. The problem is, if you do lose, you lose much, much more than you tried to win. It's like a reverse lottery where 99.9% of the people get $1. But one out of 1,000 people get tortured to death. Of course, your "expected profit" is negative. However, you are more likely to win than to lose. I use such a strategy: In the morning I deposit 10 BTC and launch the bot. In the evening I shut the bot down.
Sometimes I see 0 BTC on the balance, but in most cases there are like 20 BTC.
|
|
|
|
Gilboa
|
|
November 02, 2012, 05:20:57 PM |
|
Here is my preset for this bot. Works much better than mining. About 0.5 BTC per hour with minimal risk. java -cp MartinBot.jar MartinBot http://127.0.0.1:9876 LOGIN PASSWORD 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp 0.003 3.3 Is that right? Was that 0.5 BTC per hour a typo? I plan to use these settings below as was suggested above: java -cp MartinBot.jar MartinBot http://127.0.0.1:9876 LOGIN PASSWORD 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp 0.003 3.3 Does this look good or would you all suggest better presets? Thanks for the app. I was going to use the martingale R app posted in the "How to Last Longer Thread" but I like the automated functionality of your bot better.
|
|
|
|
.............................. ╓╥███╖ ╥████╝╙████▄ ╓████▀ ████▄ ╥▄████ ████▄┐ ╓█████ ┌╗████████ ╨███╥ ╓╥████╜ ╓╥███▀ ╙████▄╖ ████╥╖ ╥████▀ ╓▄███╜ ╙████╖ ╙████╥ ╓████ ╓███╝ ╥████████╖ ╙████╖ ╙███ ███ ╓███▀ ╥███╜ ████╥ ███╖ ██ ███ ╓███ ╓████ ╙███╥ ╘███ ██ ███ ▐██ ╥███ ╓╦▄█████▄╥┐ ╙██╕ ███ ██ ███ ▐██ ╓███ ╓██╜ ╙██▄ ╘██ ███ ██ ███ ██ ▐██ ╒██ ╙██┐ ██ ▐██ ██ ███ ██ ▐█▌ ╒██ ▐██ ██ ▐██ ██ ███ ██ ▐█▌ ╒██ ▐██ ██ ▐██ ██ ███ ██ ▐█ ├█▌ ▐██ ██ ▐██ ██ ███ ██▌ ▐█ ╘██ ▐██ ██ ██ ██ ███ ██▌ ▐█ ╘██ ▐██ ██ ██ ██ ███ ███ ▐█╕ ██╖ ▄██ ██ ██ ██ ███ ███ ▐██┐ ╙██▄╥╖ ╓╥███ ╓███ ██ ██ ███ ██▌ ▀██▄ ╙█████╜ ╥███ ███ ██ ███ ▀██ ████╥╖ ╓███▀ ╥▄██ ██ ███ ███╖ ╙█████╖ ╥████ ╓███┘ ╔██ ╙███╥╖ ▀███╥╖ ╙███████▀ ╓▄███ ╓╥████╝ ╙████╦┐ ╙╨███╥ ╥███╜ ╓████╜ ████╖ ╙███╥ ╓▄██╜ ╓▄████ ╙███▄╗ ╙██████╙ ╓╦████ ████╖ ╥████ ╙████╥ ╥████▀ ▀███████╜ ╩▀┘ ..............................
| ....OPUS... Music decentralized | ..Beta-ready Blockchain based Music Streaming.. Website | Demo | Whitepaper | Coinmarketcap | Bitcointalk | Twitter | Facebook | ⧼ | Try the LIVE Ethereum & IPFS beta Join Us ✔ Telegram ✔ Discord | ⧽ |
|
|
|
pyromaniac
|
|
November 02, 2012, 05:42:26 PM |
|
Here is my preset for this bot. Works much better than mining. About 0.5 BTC per hour with minimal risk. java -cp MartinBot.jar MartinBot http://127.0.0.1:9876 LOGIN PASSWORD 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp 0.003 3.3 Is that right? Was that 0.5 BTC per hour a typo? Yep. Absolutely.
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
November 02, 2012, 11:19:19 PM |
|
I use such a strategy:
In the morning I deposit 10 BTC and launch the bot. In the evening I shut the bot down.
Sometimes I see 0 BTC on the balance, but in most cases there are like 20 BTC.
If you specifically configure it for double or nothing, you are much better off just placing a single bet. The Martingale strategy only works if you are trying to win an amount much smaller than the total amount you have to bet.
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
Gilboa
|
|
November 05, 2012, 08:46:28 PM |
|
Is the bot supposed to run continuously? After a loss the bot doesn't do anything. It also only submits a second bet if there's a win. I have 5 BTC in my wallet so that might be to low?
|
|
|
|
.............................. ╓╥███╖ ╥████╝╙████▄ ╓████▀ ████▄ ╥▄████ ████▄┐ ╓█████ ┌╗████████ ╨███╥ ╓╥████╜ ╓╥███▀ ╙████▄╖ ████╥╖ ╥████▀ ╓▄███╜ ╙████╖ ╙████╥ ╓████ ╓███╝ ╥████████╖ ╙████╖ ╙███ ███ ╓███▀ ╥███╜ ████╥ ███╖ ██ ███ ╓███ ╓████ ╙███╥ ╘███ ██ ███ ▐██ ╥███ ╓╦▄█████▄╥┐ ╙██╕ ███ ██ ███ ▐██ ╓███ ╓██╜ ╙██▄ ╘██ ███ ██ ███ ██ ▐██ ╒██ ╙██┐ ██ ▐██ ██ ███ ██ ▐█▌ ╒██ ▐██ ██ ▐██ ██ ███ ██ ▐█▌ ╒██ ▐██ ██ ▐██ ██ ███ ██ ▐█ ├█▌ ▐██ ██ ▐██ ██ ███ ██▌ ▐█ ╘██ ▐██ ██ ██ ██ ███ ██▌ ▐█ ╘██ ▐██ ██ ██ ██ ███ ███ ▐█╕ ██╖ ▄██ ██ ██ ██ ███ ███ ▐██┐ ╙██▄╥╖ ╓╥███ ╓███ ██ ██ ███ ██▌ ▀██▄ ╙█████╜ ╥███ ███ ██ ███ ▀██ ████╥╖ ╓███▀ ╥▄██ ██ ███ ███╖ ╙█████╖ ╥████ ╓███┘ ╔██ ╙███╥╖ ▀███╥╖ ╙███████▀ ╓▄███ ╓╥████╝ ╙████╦┐ ╙╨███╥ ╥███╜ ╓████╜ ████╖ ╙███╥ ╓▄██╜ ╓▄████ ╙███▄╗ ╙██████╙ ╓╦████ ████╖ ╥████ ╙████╥ ╥████▀ ▀███████╜ ╩▀┘ ..............................
| ....OPUS... Music decentralized | ..Beta-ready Blockchain based Music Streaming.. Website | Demo | Whitepaper | Coinmarketcap | Bitcointalk | Twitter | Facebook | ⧼ | Try the LIVE Ethereum & IPFS beta Join Us ✔ Telegram ✔ Discord | ⧽ |
|
|
|
|