Skip to content

Commit

Permalink
Preparation for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tacombel committed Mar 27, 2022
1 parent 95c5903 commit f9f43b8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
65 changes: 32 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,51 @@

---

This script will get the price of SCP and update SCP/TB to a target price, defined in the script, if the difference is greater than a percentage also defined in the config file. It will always update the price if the new price is inferior to the current one.
This script will get the current price from a XA-Miner and update your host SCP/TB to 0.994x of it. This is because the max change in price in a XA is 0.05, so being 0.06 below it we guarantee to be below the price when it changes.

## Instructions for Linux

To install it donwload from the releases page and unzip in your system.

$ cd scprime_price_check

Edit the config.py and change the target price, the tolerance and base_cmd to your needs. I am using 3.9, 0.5. As we follow the xa-miners, if you use a value to close to the standard 4.0$, at some scans you will be above the limit, so better to lose some rent than to lose the incentives.
Install de virtual environment

You need to edit the base_cmd to match what you would be using to launch spc outside its directory. So something like '/var/lib/spc'.
$ python3 -m venv .venv

Then:
$ source .venv/bin/activate

$ python3 scprime_price_check.py
Install python dependencies

$ pip install -r requeriments.txt

Install system requirements

$ sudo apt-get install chromium-chromedriver

Edit the config.py and change base_cmd to your needs. You need to edit it to match what you would be using to launch spc outside its directory. So something like '/var/lib/spc'.

Switch to the user that has permission to change values in spd and test it.

$ python scprime_price_check.py

You will need a cronjob to execute it periodicaly.

$ crontab -e

And add a line similar to this one, that will execute the script every 2 minutes.

*/2 * * * * systemd-cat -t "checkprice-cron" /home/daniel/scprime_price_check/.venv/bin/python /home/daniel/scprime_price_check/scprime_price_check.py

You will be able to check the journal to see it working like this

$ sudo journalctl -n1000|grep checkprice-cron

---

## Instructions for Windows (no Python experience)

- Download Python
- Go to https://www.python.org/downloads/release/python-379/ and download the executable installer for x64 or x86
- Install it
- Restart the computer
- Download the repo as a zip file
- Extract it to your SCPrime folder
- Rename the folder (repo) to scprime_price_check
- Edit the settings
- Open the folder
- Edit the file config.py with notepad
- Set the target price
- Set the threshold percentage (update the price if the price changes with this percent)
- Enter the exact directory of your spc.exe - example `base_cmd = 'D:\SCPrime\spc.exe'`
- Open CMD
- Go to the folder where the script is (for example cd D:\SCPrime\scprime_price_check)
- Type python --version. If you get Python 3.x.x everything is ok.
- Type the command python scprime_price_check.py (If in the previous step you got Python 2.x.x you should use python3 instead in this command)
- If you see the script running, you are good to continue
- Create a new text file
- Name it pricechecker.bat
- Edit it with notepad
- The file should contain three lines if the folder is located on a drive other than C, or two lines if it is in the C drive
- cd - the location of the folder (for example cd D:\SCPrime\scprime_price_check)
- If the file is located on another drive (not C), you should put in the drive letter followed by : (for example D:)
- python scprime_price_check.py
You can now add this file to the task scheduler and you are good to go!
## Instructions for Windows

This release does not work in windows.

-----------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions price.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#v0.2

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
Expand Down
2 changes: 2 additions & 0 deletions scprime_price_check.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# v0.2

import os
import sys
from price import get_price
Expand Down

0 comments on commit f9f43b8

Please sign in to comment.