-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
siddhartha | ||
Siddhun9JB5AuPGo | ||
|
||
######################################################### | ||
var arr = [100,100,300,500,800,1300,2100,3400,5400,8100,12200,18300,27400,41100,61700]; | ||
|
||
|
||
var first = arr[0]; | ||
|
||
var iterator = arr.values(); | ||
|
||
|
||
|
||
|
||
function if_lose() | ||
{ | ||
return iterator.next().value; | ||
} | ||
|
||
|
||
function if_win() | ||
{ | ||
iterator = arr.values(); | ||
return iterator.next().value; | ||
} | ||
|
||
|
||
|
||
function roundBit(bet) { | ||
return Math.round(bet / 100) * 100; | ||
} | ||
############################################################### | ||
|
||
https://github.com/bustabit/autobet#how-to-write-a-script | ||
|
||
https://mtihc.github.io/bustabit-script-simulator/ | ||
|
||
https://gist.github.com/RHavar/e608bb389a5cfe2f01e1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* 100 satoshis (1 bit) */ | ||
|
||
var config = { | ||
|
||
}; | ||
|
||
log('Simulation begins here...'); | ||
var arr = [100,100,300,500,800,1300,2100]; | ||
var iterator = arr.values(); | ||
|
||
engine.on('GAME_STARTING', function (res) { | ||
log('a game is starting'); | ||
engine.bet(iterator.next().value, 2); | ||
log(res); | ||
}); | ||
|
||
|
||
engine.on('GAME_ENDED', function (res) { | ||
log('a game is edded'); | ||
log(res); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var config = { | ||
|
||
}; | ||
|
||
var iterifyArr = function (arr) { | ||
var cur = 0; | ||
arr.next = (function () { return (++cur >= this.length) ? false : this[cur]; }); | ||
arr.prev = (function () { return (--cur < 0) ? false : this[cur]; }); | ||
arr.reset = (function () { cur = 0; }); | ||
return arr; | ||
}; | ||
|
||
log('Simulation begins here...'); | ||
/* 100 satoshis (1 bit) */ | ||
var wagers = [100,100,200,300,500,800,1300,2100,3400,5400,8100,12200,900]; | ||
//var wagers = [100,100,200,300,500,900]; | ||
iterifyArr(wagers); | ||
|
||
const payout = 3; | ||
|
||
engine.on('GAME_STARTING', function (res) { | ||
log('a game is starting'); | ||
var wager = wagers.next(); | ||
if(wager == 900) | ||
{ | ||
wagers.reset(); | ||
var wager = wagers.next(); | ||
} | ||
engine.bet(wager, payout); | ||
log(res); | ||
}); | ||
|
||
|
||
engine.on('GAME_ENDED', function (res) { | ||
log('a game is edded'); | ||
log(res); | ||
var lastGame = engine.history.first(); | ||
if (lastGame.cashedAt) | ||
{ | ||
// We won | ||
// iterator = arr.reset(); | ||
wagers.reset(); | ||
log("we won"); | ||
} | ||
else | ||
{ | ||
// We loss | ||
log("we loss"); | ||
} | ||
}); |