1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { blob } from "https://esm.town/v/std/blob";
import BetSession from "npm:auto-bet-session";
import axios from "npm:axios";
const DEFAULT_BETAMOUNT = 0.0001000;
const DEFAULT_MULTIPLIER = 1.94;
const DEFAULT_OPTION = "higher";
const DEFAULT_INCREASE = 107;
const VAL_URL = "https://cyrilos-tronpickloop.web.val.run";
// handle incoming requests
export default async function(req) {
const PLATFORM = "tronpick.io";
const cookies = await blob.getJSON("platforms");
const COOKIES = cookies.tronpick.cookies;
var session = new BetSession(PLATFORM, COOKIES);
var body;
try {
/**
* {
* initialBetAmount,
* initialMultiplier,
* currentBetAmount,
* currentMultiplier,
* option,
* increase,
* winStreak,
* lossStreak
* }
*/
body = await req.json();
}
catch {
body = {
initialBetAmount: DEFAULT_BETAMOUNT,
initialMultiplier: DEFAULT_MULTIPLIER,
currentBetAmount: DEFAULT_BETAMOUNT,
currentMultiplier: DEFAULT_MULTIPLIER,
option: DEFAULT_OPTION,
increase: DEFAULT_INCREASE,
winStreak: 0,
lossStreak: 0,
};
}
// apply strategy
session.onWin(() => {
session.resetBetAmount();
});
session.onLoss(() => {
if (session.lossStreak < 15)
session.increaseBetAmount(body.increase);
else
session.decreaseBetAmount(50);
});
session.onStreakOfLoss(10, () => {
session.randomizeSeed();
// session.switchOverUnder();
});
// run val during 40s only then recall the val
setTimeout(async () => {
var url = VAL_URL;
var payload = {
initialBetAmount: session.initialBetAmount,
initialMultiplier: session.initialMultiplier,
currentBetAmount: session.currentBetAmount,
currentMultiplier: session.currentMultiplier,
option: session.currentOption,
increase: DEFAULT_INCREASE,
winStreak: session.winStreak,
lossStreak: session.lossStreak,
};
session.stopAutoBet();
await axios({
method: "post",
url: url,
headers: {
"Content-Type": "application/json",
},
data: payload,
})
.then(response => {
console.log(response.data);
})
.catch(err => {
console.log(err);
});
}, 40000);
// set variable and play game
session.onBet(() => {
if (session.count <= 1) {
session.currentProfit = 0;
session.initialBetAmount = body.initialBetAmount;
session.initialMultiplier = body.initialMultiplier;
session.currentBetAmount = body.currentBetAmount;
session.currentMultiplier = body.currentMultiplier;