Skip to content

Instantly share code, notes, and snippets.

@BitChop
Forked from ruzli/GA.js
Created August 21, 2019 16:20
Show Gist options
  • Save BitChop/3e432d02f53bf984a879755a4e67716e to your computer and use it in GitHub Desktop.
Save BitChop/3e432d02f53bf984a879755a4e67716e to your computer and use it in GitHub Desktop.
GoldenAssist - GA - Multiple targets playing - Safest script ever made
var config = {
RiskHeader: { label: "Risk Modificators", type: "noop" },
//**************************************************************** */
RISK_FACTOR: { label: "Risk Factor", type: "multiplier", value: 1 },
RISK_MULTIPLIER: { label: "Risk Multiplier", type: "multiplier", value: 0.001 },
RISK_BASE: { label: "Risk Base", type: "multiplier", value: 1.0 },
featuresHeader: { label: " Common Features", type: "noop" },
//**************************************************************** */
change_seed_next: { label: "Seed change", type: "number", value: 50000 },
game_sound: { label: "Game sound", type: "checkbox", value: true },
conditionHeader: { label: "Conditions", type: "noop" },
//**************************************************************** */
minProfit: { label: "minProfit", type: "balance", value: -500000 },
maxProfit: { label: "maxProfit", type: "balance", value: 500000 },
targetsHeader: { label: "Targets", type: "noop" },
//**************************************************************** */
target_1: { label: "Target play", type: "text", value: "2.36" },
bet_1: { label: "Bet", type: "balance", value: 400 },
target236: { label: "Target 2.36x", type: "checkbox", value: true },
target_2: { label: "Target play", type: "text", value: "4.72" },
bet_2: { label: "Bet", type: "balance", value: 300 },
target472: { label: "Target 4.72x", type: "checkbox", value: true },
target_3: { label: "Target play", type: "text", value: "9.44" },
bet_3: { label: "Bet", type: "balance", value: 100 },
target944: { label: "Target 9.44x", type: "checkbox", value: true },
target_4: { label: "Target play", type: "text", value: "15" },
bet_4: { label: "Bet", type: "balance", value: 100 },
target15: { label: "Target 15x", type: "checkbox", value: true },
target_5: { label: "Target play", type: "text", value: "30" },
bet_5: { label: "Bet", type: "balance", value: 200 },
target30: { label: "Target 30x", type: "checkbox", value: false },
target_6: { label: "Target play", type: "text", value: "60" },
bet_6: { label: "Bet", type: "balance", value: 200 },
target60: { label: "Target 60x", type: "checkbox", value: false },
target_7: { label: "Target play", type: "text", value: "100" },
bet_7: { label: "Bet", type: "balance", value: 100 },
target100: { label: "Target 100x", type: "checkbox", value: false },
CustomHeader: { label: "Custom Target", type: "noop" },
//**************************************************************** */
target_8: { label: "Target play", type: "number", value: 3 },
bet_8: { label: "Bet", type: "balance", value: 300 },
target_custom: { label: "Target", type: "checkbox", value: false },
}
var RISK_FACTOR = config.RISK_FACTOR.value /* Overall change for all situations to happen. */
var RISK_MULTIPLIER = config.RISK_MULTIPLIER.value /* Overall change for all bets size after lose bet */
var RISK_BASE = config.RISK_BASE.value /* Overall change for all targets base bet by multiple it, for now all targets starting with basebet = 1 */
var minProfit = config.minProfit.value / 100
var maxProfit = config.maxProfit.value / 100
var change_seed_next = config.change_seed_next.value
const LONGEST_DIFFCULTY = 16 /* STW calculated based on this formula */
const PLAY_IN_RANGE = 4 /* Seed numbers has 4 distances, early, mid, late, extra late */
function get_multiplier(target){
return (1 / ((target * ex.mul_target) - 1) + 1) + (RISK_MULTIPLIER * (1 / ((target * ex.mul_target) - 1) + 1))
}
function get_stw(target){
return Math.round((target * ex.mul_target) * LONGEST_DIFFCULTY / PLAY_IN_RANGE * RISK_FACTOR)
}
var ex = {
mul_target: 1.0,
no_waiting_time: false,
TARGET_2_36: config.target_1.value,
TARGET_4_72: config.target_2.value,
TARGET_9_44: config.target_3.value,
TARGET_15: config.target_4.value,
TARGET_30: config.target_5.value,
TARGET_60: config.target_6.value,
TARGET_100: config.target_7.value,
TARGET_CUSTOM: config.target_8.value,
}
var game_on_2_36 = {
game_2_36_enabled: config.target236.value,
basebet: Math.round(config.bet_1.value * RISK_BASE) / 100, bet: Math.round(config.bet_1.value * RISK_BASE) / 100,
target: ex.TARGET_2_36 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_2_36), STW: get_stw(ex.TARGET_2_36),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_4_72 = {
game_4_72_enabled: config.target472.value,
basebet: Math.round(config.bet_2.value * RISK_BASE) / 100, bet: Math.round(config.bet_2.value * RISK_BASE) / 100,
target: ex.TARGET_4_72 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_4_72), STW: get_stw(ex.TARGET_4_72),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_9_44 = {
game_9_44_enabled: config.target944.value,
basebet: Math.round(config.bet_3.value * RISK_BASE) / 100, bet: Math.round(config.bet_3.value * RISK_BASE) / 100,
target: ex.TARGET_9_44 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_9_44), STW: get_stw(ex.TARGET_9_44),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_15 = {
game_15_enabled: config.target15.value,
basebet: Math.round(config.bet_4.value * RISK_BASE) / 100, bet: Math.round(config.bet_4.value * RISK_BASE) / 100,
target: ex.TARGET_15 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_15), STW: get_stw(ex.TARGET_15),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_30 = {
game_30_enabled: config.target30.value,
basebet: Math.round(config.bet_5.value * RISK_BASE) / 100, bet: Math.round(config.bet_5.value * RISK_BASE) / 100,
target: ex.TARGET_30 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_30), STW: get_stw(ex.TARGET_30),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_60 = {
game_60_enabled: config.target60.value,
basebet: Math.round(config.bet_6.value * RISK_BASE) / 100, bet: Math.round(config.bet_6.value * RISK_BASE) / 100,
target: ex.TARGET_60 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_60), STW: get_stw(ex.TARGET_60),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_100 = {
game_100_enabled: config.target100.value,
basebet: Math.round(config.bet_7.value * RISK_BASE) / 100, bet: Math.round(config.bet_7.value * RISK_BASE) / 100,
target: ex.TARGET_100 * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_100), STW: get_stw(ex.TARGET_100),
LS: 0, PROFIT: 0, RUNS: 0,
}
var game_on_custom = {
game_custom_enabled: config.target_custom.value,
basebet: Math.round(config.bet_8.value * RISK_BASE) / 100, bet: Math.round(config.bet_8.value * RISK_BASE) / 100,
target: ex.TARGET_CUSTOM * ex.mul_target,
multiplier: get_multiplier(ex.TARGET_CUSTOM), STW: get_stw(ex.TARGET_CUSTOM),
LS: 0, PROFIT: 0, RUNS: 0,
}
const engine = this
var game_sounds = config.game_sound.value
var skip_enabled = true
var bust_text = ``
var bust_array = []
var last_strategy = "none"
async function sleep(ms = ex.interval_rolls) {
if (ms != 0) return new Promise(resolve => setTimeout(resolve, ms))
}
let skipStep = 1 // 0 = skip | 1 = bet
let nonce = 0, PROFIT = 0, TOTAL_BETS = 0, STREAK_ROLL = 0
engine.log(`Starting to gather information script made by by Ruzli(Baecoin) 1.07.1v, version with GUI`)
await sleep(2000)
/* Main loop is starting from here */
while (true) {
await gather_information()
if (game_on_2_36.game_2_36_enabled) {
await STR_2_36()
}
if (game_on_4_72.game_4_72_enabled) {
await STR_4_72()
}
if (game_on_9_44.game_9_44_enabled) {
await STR_9_44()
}
if (game_on_15.game_15_enabled) {
await STR_15()
}
if (game_on_30.game_30_enabled) {
await STR_30()
}
if (game_on_60.game_60_enabled) {
await STR_60()
}
if (game_on_100.game_100_enabled) {
await STR_100()
}
if (game_on_custom.game_custom_enabled) {
await STR_Custom()
}
}
async function gather_information() {
if (skip_enabled == true) {
const { multiplier } = await analyzeBet()
TOTAL_BETS++
await seed_checking()
await updateStreaks(multiplier)
if (skipStep == 0) {
if (multiplier > 1.00) {
PROFIT += 0.01
} else {
PROFIT -= 1
}
}
}
await updateLog()
if (game_on_2_36.LS >= game_on_2_36.STW || game_on_4_72.LS >= game_on_4_72.STW || game_on_9_44.LS >= game_on_9_44.STW || game_on_15.LS >= game_on_15.STW || game_on_30.LS >= game_on_30.STW || game_on_60.LS >= game_on_60.STW || game_on_100.LS >= game_on_100.STW || game_on_custom.LS >= game_on_custom.STW) {
return
}
}
async function seed_checking() {
nonce++
if (nonce >= change_seed_next) {
await generateSeed()
nonce = 0
}
}
async function analyzeBet() {
if (skipStep == 0) {
skipStep = 1
return await engine.skip(betSize(1), 1.01)
} else {
skipStep = 0
return await engine.bet(betSize(1), 1.01)
}
}
function increase_profit(game_target) {
return (betSize(game_target.bet) / 100) * (game_target.target - 1)
}
function decrease_profit(game_target) {
return betSize(game_target.bet) / 100
}
async function STR_Custom() {
let RETRY = true
if (game_on_custom.LS < game_on_custom.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_custom.LS = 0
gong()
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_custom.bet), game_on_custom.target)
TOTAL_BETS++
if (multiplier < game_on_custom.target) { // Loose
STREAK_ROLL++
PROFIT -= decrease_profit(game_on_custom)
game_on_custom.PROFIT -= decrease_profit(game_on_custom)
game_on_custom.bet *= game_on_custom.multiplier
} else { // Win
PROFIT += increase_profit(game_on_custom)
game_on_custom.PROFIT += increase_profit(game_on_custom)
game_on_custom.bet = game_on_custom.basebet
RETRY = false
}
last_strategy = `Strategy ${game_on_custom.target} with streak ${STREAK_ROLL}`
await updateStreaks(multiplier)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_custom.bet < minProfit) {
engine.stop()
}
}
}
async function STR_2_36() {
let RETRY = true
if (game_on_2_36.LS < game_on_2_36.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_2_36.LS = 0
game_on_2_36.RUNS++
gong()
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_2_36.bet), game_on_2_36.target)
TOTAL_BETS++
if (multiplier < game_on_2_36.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_2_36.bet) / 100
game_on_2_36.PROFIT -= betSize(game_on_2_36.bet) / 100
game_on_2_36.bet *= game_on_2_36.multiplier
} else { // Win
PROFIT += (betSize(game_on_2_36.bet) / 100) * (game_on_2_36.target - 1)
game_on_2_36.PROFIT += (betSize(game_on_2_36.bet) / 100) * (game_on_2_36.target - 1)
game_on_2_36.bet = game_on_2_36.basebet
RETRY = false
}
last_strategy = `Strategy ${game_on_2_36.target} with streak ${STREAK_ROLL}`
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_2_36.bet < minProfit) {
engine.stop()
}
}
}
async function STR_4_72() {
let RETRY = true
if (game_on_4_72.LS < game_on_4_72.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_4_72.LS = 0
game_on_4_72.RUNS++
gong()
last_strategy = `Strategy ${game_on_4_72.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_4_72.bet), game_on_4_72.target)
TOTAL_BETS++
if (multiplier < game_on_4_72.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_4_72.bet) / 100
game_on_4_72.PROFIT -= betSize(game_on_4_72.bet) / 100
game_on_4_72.bet *= game_on_4_72.multiplier
} else { // Win
PROFIT += (betSize(game_on_4_72.bet) / 100) * (game_on_4_72.target - 1)
game_on_4_72.PROFIT += (betSize(game_on_4_72.bet) / 100) * (game_on_4_72.target - 1)
game_on_4_72.bet = game_on_4_72.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_4_72.basebet < minProfit) {
engine.stop()
}
}
}
async function STR_9_44() {
let RETRY = true
if (game_on_9_44.LS < game_on_9_44.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_9_44.LS = 0
game_on_9_44.RUNS++
gong()
last_strategy = `Strategy ${game_on_9_44.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_9_44.bet), game_on_9_44.target)
TOTAL_BETS++
if (multiplier < game_on_9_44.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_9_44.bet) / 100
game_on_9_44.PROFIT -= betSize(game_on_9_44.bet) / 100
game_on_9_44.bet *= game_on_9_44.multiplier
} else { // Win
PROFIT += (betSize(game_on_9_44.bet) / 100) * (game_on_9_44.target - 1)
game_on_9_44.PROFIT += (betSize(game_on_9_44.bet) / 100) * (game_on_9_44.target - 1)
game_on_9_44.bet = game_on_9_44.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_9_44.bet < minProfit) {
engine.stop()
}
}
}
async function STR_15() {
let RETRY = true
if (game_on_15.LS < game_on_15.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_15.LS = 0
game_on_15.RUNS++
gong()
last_strategy = `Strategy ${game_on_15.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_15.bet), game_on_15.target)
TOTAL_BETS++
if (multiplier < game_on_15.target) { // Loose
PROFIT -= betSize(game_on_15.bet) / 100
game_on_15.PROFIT -= betSize(game_on_15.bet) / 100
game_on_15.bet *= game_on_15.multiplier
} else { // Win
PROFIT += (betSize(game_on_15.bet) / 100) * (game_on_15.target - 1)
game_on_15.PROFIT += (betSize(game_on_15.bet) / 100) * (game_on_15.target - 1)
game_on_15.bet = game_on_15.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_15.bet < minProfit) {
engine.stop()
}
}
}
async function STR_30() {
let RETRY = true
if (game_on_30.LS < game_on_30.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_30.LS = 0
game_on_30.RUNS++
gong()
last_strategy = `Strategy ${game_on_30.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_30.bet), game_on_30.target)
TOTAL_BETS++
if (multiplier < game_on_30.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_30.bet) / 100
game_on_30.PROFIT -= betSize(game_on_30.bet) / 100
game_on_30.bet *= game_on_30.multiplier
} else { // Win
PROFIT += (betSize(game_on_30.bet) / 100) * (game_on_30.target - 1)
game_on_30.PROFIT += (betSize(game_on_30.bet) / 100) * (game_on_30.target - 1)
game_on_30.bet = game_on_30.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_30.bet < minProfit) {
engine.stop()
}
}
}
async function STR_60() {
let RETRY = true
if (game_on_60.LS < game_on_60.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_60.LS = 0
game_on_60.RUNS++
gong()
last_strategy = `Strategy ${game_on_60.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_60.bet), game_on_60.target)
TOTAL_BETS++
if (multiplier < game_on_60.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_60.bet) / 100
game_on_60.PROFIT -= betSize(game_on_60.bet) / 100
game_on_60.bet *= game_on_60.multiplier
} else { // Win
PROFIT += (betSize(game_on_60.bet) / 100) * (game_on_60.target - 1)
game_on_60.PROFIT += (betSize(game_on_60.bet) / 100) * (game_on_60.target - 1)
game_on_60.bet = game_on_60.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_60.bet < minProfit) {
engine.stop()
}
}
}
async function STR_100() {
let RETRY = true
if (game_on_100.LS < game_on_100.STW) {
if (ex.no_waiting_time == false) {
return
}
}
game_on_100.LS = 0
game_on_100.RUNS++
gong()
last_strategy = `Strategy ${game_on_100.target}`
while (RETRY) {
const { multiplier } = await engine.bet(betSize(game_on_100.bet), game_on_100.target)
TOTAL_BETS++
if (multiplier < game_on_100.target) { // Loose
STREAK_ROLL++
PROFIT -= betSize(game_on_100.bet) / 100
game_on_100.PROFIT -= betSize(game_on_100.bet) / 100
game_on_100.bet *= game_on_100.multiplier
} else { // Win
PROFIT += (betSize(game_on_100.bet) / 100) * (game_on_100.target - 1)
game_on_100.PROFIT += (betSize(game_on_100.bet) / 100) * (game_on_100.target - 1)
game_on_100.bet = game_on_100.basebet
RETRY = false
}
await updateStreaks(multiplier)
Summary(STREAK_ROLL)
await updateLog()
if (PROFIT > maxProfit || PROFIT - game_on_100.bet < minProfit) {
engine.stop()
}
}
}
async function updateStreaks(multiplier) {
if (multiplier < game_on_2_36.target) { // Loose/Increase for all
game_on_2_36.LS++
game_on_4_72.LS++
game_on_9_44.LS++
game_on_15.LS++
game_on_30.LS++
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_4_72.target) {
game_on_2_36.LS = 0
game_on_4_72.LS++
game_on_9_44.LS++
game_on_15.LS++
game_on_30.LS++
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_9_44.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS++
game_on_15.LS++
game_on_30.LS++
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_15.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS++
game_on_30.LS++
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_30.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS = 0
game_on_30.LS++
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_60.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS = 0
game_on_30.LS = 0
game_on_60.LS++
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_100.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS = 0
game_on_30.LS = 0
game_on_60.LS = 0
game_on_100.LS++
game_on_custom.LS++
} else if (multiplier < game_on_custom.target) {
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS = 0
game_on_30.LS = 0
game_on_60.LS = 0
game_on_100.LS = 0
game_on_custom.LS++
} else { // Win/Reset for all
game_on_2_36.LS = 0
game_on_4_72.LS = 0
game_on_9_44.LS = 0
game_on_15.LS = 0
game_on_30.LS = 0
game_on_60.LS = 0
game_on_100.LS = 0
game_on_custom.LS = 0
}
}
function Summary(streak_count) {
engine.log(`Game ended in size of ${streak_count} streak`)
STREAK_ROLL = 0
}
function betSize(bet) {
return Math.round((bet * 100) / 100) * 100
}
async function updateLog() {
engine.clearLog()
engine.log(`Rolls: ${TOTAL_BETS} Seed: ${nonce}/${change_seed_next} last run ${last_strategy}`)
engine.log(stats_show() + `Profit: ${PROFIT.toFixed(2)}`)
}
function stats_show() {
let output = ""
if (game_on_2_36.game_2_36_enabled == true) {
engine.log(`${game_on_2_36.target.toFixed(2)}x: multiplier ${game_on_2_36.multiplier.toFixed(5)}, PROFIT: ${game_on_2_36.PROFIT.toFixed()}, run ${game_on_2_36.RUNS} times.`)
output = output + `${game_on_2_36.target.toFixed(2)}: ${game_on_2_36.LS}/${game_on_2_36.STW} | `
}
if (game_on_4_72.game_4_72_enabled == true) {
engine.log(`${game_on_4_72.target.toFixed(2)}x: multiplier ${game_on_4_72.multiplier.toFixed(5)}, PROFIT: ${game_on_4_72.PROFIT.toFixed()}, run ${game_on_4_72.RUNS} times.`)
output = output + `${game_on_4_72.target.toFixed(2)}: ${game_on_4_72.LS}/${game_on_4_72.STW} | `
}
if (game_on_9_44.game_9_44_enabled == true) {
engine.log(`${game_on_9_44.target.toFixed(2)}x: multiplier ${game_on_9_44.multiplier.toFixed(5)}, PROFIT: ${game_on_9_44.PROFIT.toFixed()}, run ${game_on_9_44.RUNS} times.`)
output = output + `${game_on_9_44.target.toFixed(2)}: ${game_on_9_44.LS}/${game_on_9_44.STW} | `
}
if (game_on_15.game_15_enabled == true) {
engine.log(`${game_on_15.target.toFixed(2)}x: multiplier ${game_on_15.multiplier.toFixed(5)}, PROFIT: ${game_on_15.PROFIT.toFixed()}, run ${game_on_15.RUNS} times.`)
output = output + `${game_on_15.target.toFixed()}: ${game_on_15.LS}/${game_on_15.STW} | `
}
if (game_on_30.game_30_enabled == true) {
engine.log(`${game_on_30.target.toFixed(2)}x: multiplier ${game_on_30.multiplier.toFixed(5)}, PROFIT: ${game_on_30.PROFIT.toFixed()}, run ${game_on_30.RUNS} times.`)
output = output + `${game_on_30.target.toFixed()}: ${game_on_30.LS}/${game_on_30.STW} | `
}
if (game_on_60.game_60_enabled == true) {
engine.log(`${game_on_60.target.toFixed(2)}x: multiplier ${game_on_60.multiplier.toFixed(5)}, PROFIT: ${game_on_60.PROFIT.toFixed()}, run ${game_on_60.RUNS} times.`)
output = output + `${game_on_60.target.toFixed()}: ${game_on_60.LS}/${game_on_60.STW} | `
}
if (game_on_100.game_100_enabled == true) {
engine.log(`${game_on_100.target.toFixed(2)}x: multiplier ${game_on_100.multiplier.toFixed(5)}, PROFIT: ${game_on_100.PROFIT.toFixed()}, run ${game_on_100.RUNS} times.`)
output = output + `${game_on_100.target.toFixed()}: ${game_on_100.LS}/${game_on_100.STW} | `
}
if (game_on_custom.game_custom_enabled == true) {
engine.log(`${game_on_custom.target.toFixed(2)}x: multiplier ${game_on_custom.multiplier.toFixed(5)}, PROFIT: ${game_on_custom.PROFIT.toFixed()}, run ${game_on_custom.RUNS} times.`)
output = output + `${game_on_custom.target.toFixed()}: ${game_on_custom.LS}/${game_on_custom.STW} | `
}
return output
}
/**
* Generating new seed pair for client and hash server.
*/
async function generateSeed() {
try {
const { server_seed_hash } = await engine.newSeedPair()
engine.log(`Server hash: ${server_seed_hash}`)
}
catch (e) {
engine.log(`Seed is already was reset`)
}
try {
const clientSeed = randomSeed()
await engine.setClientSeed(clientSeed)
engine.log(`Seed was set to: ${clientSeed}`)
}
catch (e) {
engine.log(`Client seed already is used`)
}
}
/**
* Returns a random word for seed generation.
*/
function randomSeed() {
const words = [ 'aAld5hedfra ', 'aBravfhfd5n ', 'aCh5adrfdlik ', 'aDelf5fhadgo ', 'aZefchf5hso ', 'aFordfehxft5romb ', 'aHoth5felshsa ', 'aGndhomfu5s ', 'aAddd5ihfc6ted ', 'aAu5dh6frelia ', 'aZif56dgalo ', 'aWiverm66fdda ',
'aMarid5dfnher ', 'aOctoberdd5ffhfest ', 'aNd5adfshcar ', 'aPdd5affhpaja ', 'aAlbfehf5dds ', 'aGfohfdm5us ', 'aFihfrra ', 'aGT5hdffdO ', 'aUn5dhicofrn ', 'aVicdnfht5us ', 'aShif5dski ', 'aXda6vf5ier ', 'aPoid66upflddet ', 'aAdntu66tdssfulika ' ]
return words[ Math.floor(words.length * Math.random()) ] + words[ Math.floor(words.length * Math.random()) ] + words[ Math.floor(words.length * Math.random()) ]
}
/**
* Play sound peak.
*/
async function gong() {
const audio = new Audio("https://bustadice.com/5bb187b7ef764e76fb519939f77288c1.mp3")
if (game_sounds != false) { await audio.play() }
return new Promise(resolve => audio.onended = resolve)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment