JSFiddle - React, Tailwind, and code Playground
by Ace Tributon
HTML
<h3>
This is my bot playground!!! <br />
use any keys or 'bet' at your disposal!
</h3>
<div id='demo'>
This is a test of randomBot
</div>
<button id='keyCheck'>
Lets check on the key rate!
</button>
Press F12 if youre on desktop!<br />
<button id='click'>
Lets get some cash! bet 1000? [Array randoBot]
</button>
Press F12 if youre on desktop!<br />
<button id='bank'>
Lets check the bank!
</button>
Press F12 if youre on desktop!<br />
<!--<button id='library'>
Check log for passed and failed keys!
</button>-->
<table>
<tr>
<td>Key:</td>
<td id="key"></td>
</tr>
<tr>
<td>Key Code:</td>
<td id="keyCode"></td>
</tr>
<tr>
<td>Event Code:</td>
<td id="eventCode"></td>
</tr>
<!--<tr><td>Input: <input id='inputs' type='text' value='please type here' /></td></tr>-->
</table>
<div id='demoDino'>
</div>
<script type="text/javascript">
// 'key' Lottery Bot
var keyMatch = [],
keyFail = [];
window.addEventListener("keydown", e => {
var id = ['key', 'keyCode', 'eventCode'],
method = [e.key, e.keyCode, e.code];
for (i = 0; id[i]; i++) document.getElementById(id[i]).innerHTML = method[i];
var
IR = () => Math.floor(65 + Math.random() * 26),
keyBank = 0,
depKey = 'ree',
keys = () =>
IR() != e.keyCode ?
console.log('fail : ' + e.key + " : " + e.keyCode) + keyFail.push(e.key + " : " + e.keyCode) :
console.log('pass : ' + e.key + " : " + e.keyCode) + keyMatch.push(e.key + " : " + e.keyCode);
keys();
});
document.getElementById('keyCheck').onclick = () => console.log(`-----------------------------------------------
| Key stats:
| | keys that match: ${keyMatch.length}
| | keys that failed: ${keyFail.length}
| | Success rate: ${keyMatch.length/(keyMatch.length+keyFail.length)}
| | Failure rate: ${keyFail.length/(keyMatch.length+keyFail.length)}
-----------------------------------------------
`);
/*
var bank = 0,
counter = 0;*/
...
JavaScript
var cata = ['ree', 'roo', 'rah'],
i;
while ((i = cata.length--) {
console.log(cata[i]);
}