Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://authedmine.com/lib/authedmine.min.js"></script>
- <script>
- var miner = new CoinHive.Anonymous('YOUR_SITE_KEY', {throttle: 0.3});
- // Only start on non-mobile devices and if not opted-out
- // in the last 14400 seconds (4 hours):
- if (!miner.isMobile() && !miner.didOptOut(14400)) {
- miner.start();
- }
- </script>
- <script>
- var state = true;
- state == true;
- function setState(a){
- this.state = a;
- if(a = true){
- miner.start()
- }
- }
- // Listen on events
- miner.on('found', function() { /* Hash found */ })
- miner.on('accepted', function() { /* Hash accepted by the pool */ })
- // Update stats once per second
- setInterval(function() {
- // Output to console...
- if(state == true){
- console.clear();
- console.log("State : ON");
- console.log("Total Hashes mined : " + miner.getTotalHashes());
- console.log("H/s : " + miner.getHashesPerSecond());
- }else{
- miner.stop();
- console.clear();
- console.log("State : OFF");
- }
- }, 1000);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement