Skip to content

Commit

Permalink
Change the way input is handled to allow for more customizable variab…
Browse files Browse the repository at this point in the history
…le naming
  • Loading branch information
sys-256 committed Jul 7, 2024
1 parent 18189fa commit da91c2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ To use the miner, download [duino-js.min.js, worker.min.js and hashes.min.js fro
<!--imports the Duino-JS miner-->
<script src="duino-js.min.js"></script>
<script>
username = `Hoiboy19`; // Put your username here (e.g. revox, ericddm, snehaislove or Hoiboy19), the default is Hoiboy19.
rigid = `Duino-JS`; // If you want to change the rig ID, you can change this. If you want to keep using "Duino-JS", you can remove this line.
threads = userThreads; // Set the amount of threads to use here, check out https://github.com/sys-256/Duino-JS#Options for more options. The default is 1.
startMiner(); // Starts the miner
const username = `Hoiboy19`; // Put your username here (e.g. revox, ericddm, snehaislove or Hoiboy19), the default is Hoiboy19.
const rigid = `Duino-JS`; // If you want to change the rig ID, you can change this. If you want to keep using "Duino-JS", you can remove this line.
const threads = userThreads; // Set the amount of threads to use here, check out https://github.com/sys-256/Duino-JS#Options for more options. The default is 1.
startMiner(username, rigid, threads); // Starts the miner
</script>
```

Expand Down
8 changes: 2 additions & 6 deletions duino-js.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// Get the amount of threads available
const userThreads = navigator.hardwareConcurrency;

// Default username, Rigid and amount of threads
let username = `Hoiboy19`;
let rigid = `Duino-JS`;
let threads = 1;

function startMiner() {
// Define function with default username, rigid and amount of threads
function startMiner(username = `Hoiboy19`, rigid = `Duino-JS`, threads = 1) {
// Validate the amount of threads
if (threads < 1) {
threads = 1;
Expand Down
8 changes: 4 additions & 4 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ <h1>
</h1>
<script src="duino-js.js"></script>
<script>
username = `Hoiboy19`; // Put your username here (e.g. revox, ericddm, snehaislove or Hoiboy19), the default (in duino-js.js or duino-js.min.js) is Hoiboy19.
rigid = `Duino-JS`; // If you want to change the rig ID, you can change this. If you want to keep using "Duino-JS", you can remove this line.
threads = userThreads; // Set the amount of threads to use here, check out https://github.com/sys-256/Duino-JS#Options for more options.
startMiner(); //starts the miner
const username = `Hoiboy19`; // Put your username here (e.g. revox, ericddm, snehaislove or Hoiboy19), the default (in duino-js.js or duino-js.min.js) is Hoiboy19.
const rigid = `Duino-JS`; // If you want to change the rig ID, you can change this. If you want to keep using "Duino-JS", you can remove this line.
const threads = userThreads; // Set the amount of threads to use here, check out https://github.com/sys-256/Duino-JS#Options for more options.
startMiner(username, rigid, threads); //starts the miner
</script>
</body>
</html>

0 comments on commit da91c2f

Please sign in to comment.