Start and stop your NiceHash miners using this script.

Overview

NiceHash Mining Scheduler

Use this script to schedule your NiceHash Miner(s).

Electricity costs between 4-9pm are high in my area and I want NiceHash to stop mining during those times. This script should start and stop your rigs on a schedule.

Installation

Acquire the necessary files by downloading the latest release. Save and extract the files to a directory of your choosing.

Configuration

  1. Open the NiceHash API key settings. Take note of your organization id located at the top of the page. (Ex. 01234567-0123-0123-0123-012345678900)

  2. Create an API key. You can make the App Name whatever you want. I recommend changing the API permissions to only allow "Mining permissions" and "Manage Rigs" as this is all that is required for the script to function. Take note of the "API Key Code" (public key) and the "API Secret Key Code" (private key). Make sure you complete the process of activating the new API key.

  3. Install python and and pip and requests for your operating system. These are my suggestions, do as you wish :)

Windows:

  1. Install Visual Studio Code
  2. Go to plugins and install python or follow these instructions (https://www.geeksforgeeks.org/download-and-install-python-3-latest-version/)
  3. Install Pip (https://www.geeksforgeeks.org/how-to-install-pip-on-windows/)
  4. Use pip to install requests (https://docs.python-requests.org/en/master/user/install/)

MAC:

  1. Install Visual Studio Code
  2. Go to plugins and install python
  3. Install Pip (https://www.geeksforgeeks.org/how-to-install-pip-in-macos/)
  4. Use pip to install requests (https://docs.python-requests.org/en/master/user/install/)

Initial Testing

Run the test script before setting up the Windows Task Scheduler or Cron job. Once you have added your API key, secret and organization ID in config.json and installed python and requests, you should be able to run the test script.

Using a shell of your choice (terminal, powershell, command prompt) navigate to the directory where test.py is located and type python test.py (for Windows) or python3 test.py (for mac).

If it worked then you should see a list of your rigs and then 'Finished' at the bottom.

Actual Testing

  1. Make sure everything is setup and the inital testing works
  2. Go to https://www.nicehash.com/my/mining/rigs and determine whether your rigs are mining or stopped
  3. If they are stopped, run python3 start_schedule.py, refresh the rigs page and they should start
  4. If they are mining, run python3 stop_schedule.py, refresh the rigs page and they should stop

Cron (Not finished)

Using Windows Task Scheduler:

Using CronTab:

If you would like to run this script on your own schedule using crontab, you can pass '--cron' as a command line argument. Passing this argument will suppress the automatic 4 hour loop, and the script will only execute once.

You can use Crontab Generator to quickly generate a custom crontab command.

Note: Crontab runs in your home directory by default. If you saved the script to a different directory, you will have to tell cron to change directories before running the script.

Ex:

* */4 * * * cd /home/[USER]/AutoWithdraw && python3 start_schedule.py --cron >/dev/null 2>&1
* */4 * * * cd /home/[USER]/AutoWithdraw && python3 stop_schedule.py --cron >/dev/null 2>&1

Donations

BTC: 3LBcrMcyGSNKJoat8dbPseqtomNBe79Yu5

ETH: 0x7579c17a57aFF6d40472A1e21b13D197Fd0116a7

LRC: 0x33F94f644B36AD13f232154a4C0D79c29a9656DC

MANA: 0x0d68D933582dB964CC5E31Fe305aC59026e0Aab1

MATIC (from Ethereum network): 0x5549d1536c2eacC50e8773c9241581465650f5eF

XRP: rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg TAG: 3272534061

You might also like...
A script where you execute a script that generates a base project for your gdextension

GDExtension Project Creator this is a script (currently only for linux) where you execute a script that generates a base project for your gdextension,

An assistant to guess your pip dependencies from your code, without using a requirements file.

Pip Sala Bim is an assistant to guess your pip dependencies from your code, without using a requirements file. Pip Sala Bim will tell you which packag

A python script that changes your desktop background based on current weather and time of the day.

Desktop background wallpaper, based on current weather and time A python script that changes your computer's desktop background based on current weath

A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

 WhyNotWin11 - Detection Script to help identify why your PC isn't Windows 11 Release Ready
WhyNotWin11 - Detection Script to help identify why your PC isn't Windows 11 Release Ready

WhyNotWin11 - Detection Script to help identify why your PC isn't Windows 11 Release Ready

A script that will warn you, by opening a new browser tab, when there are new content in your favourite websites.
A script that will warn you, by opening a new browser tab, when there are new content in your favourite websites.

web check A script that will warn you, by opening a new browser tab, when there are new content in your favourite websites. What it does The script wi

An event-based script that is designed to improve your aim

Aim-Trainer Info: This is an event-based script that is designed to improve a user's aim. It was built using Python Turtle and the Random library. Ins

A python script to get your activity

activities A python script to get your activity Not complete Requirements Python (=3.7) Pip (for python = 3.7) Git Pip packages psutil asyncio aioht

Releases(v1.0.2)
Owner
SeaRoth
Beep boop
SeaRoth
Python program to start your zoom meetings

zoomstarter Python programm to start your zoom meetings More about Initially this was a bash script for starting zoom meetings, but as i started devel

Viktor Cvetanovic 2 Nov 24, 2021
Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before.

Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before. This project is maintained by Aldrin Mathew.

Aldrin's Art Factory 67 Dec 31, 2022
An AI-powered device to stop people from stealing my packages.

Package Theft Prevention Device An AI-powered device to stop people from stealing my packages. Installation To install on a raspberry pi, clone the re

rydercalmdown 157 Nov 24, 2022
Vaccine for STOP/DJVU ransomware, prevents encryption

STOP/DJVU Ransomware Vaccine Prevents STOP/DJVU Ransomware from encrypting your files. This tool does not prevent the infection itself. STOP ransomwar

Karsten Hahn 16 May 31, 2022
Islam - This is a simple python script.In this script I have written all the suras of Al Quran. As a result, by using this script, you can know the number of any sura at the moment.

Introduction: If you want to know sura number of al quran by just typing the name of sura than you can use this script. Usage in termux: $ pkg install

Fazle Rabbi 1 Jan 2, 2022
A cookiecutter to start a Python package with flawless practices and a magical workflow 🧙🏼‍♂️

PyPackage Cookiecutter This repository is a cookiecutter to quickly start a Python package. It contains a ton of very useful features ?? : Package man

Daniel Leal 16 Dec 13, 2021
The Begin button and menu for the Meadows operating system. The start button for UNIX/Linux.

By: Seanpm2001, Meadows Et; Al. Top README.md Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrikaans Afri

Sean P. Myrick V19.1.7.2 4 Aug 28, 2022
PSP (Python Starter Package) is meant for those who want to start coding in python but are new to the coding scene.

Python Starter Package PSP (Python Starter Package) is meant for those who want to start coding in python, but are new to the coding scene. We include

Giter/ 1 Nov 20, 2021
lets learn Python language with basic examples. highly recommended for beginners who just start coding.

Lets Learn Python ?? Learn python from basic programs. learn python from scratch. 1.Online python compiler: https://www.onlinegdb.com/online_python_co

Subhranshu Choudhury 1 Jan 18, 2022
Python script to commit to your github for a perfect commit streak. This is purely for education purposes, please don't use this script to do bad stuff.

Daily-Git-Commit Commit to repo every day for the perfect commit streak Requirments pip install -r requirements.txt Setup Download this repository. Cr

JareBear 34 Dec 14, 2022