Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Installation

eternal edited this page Sep 27, 2021 · 18 revisions

Repl.it (recommended)

  • Visit the dashboard

  • Click the New Repl button as seen below.
    Image

  • Select the Bash template as seen below.
    Image

  • After your project gets created, delete everything in main.sh and paste this piece of code:

PACKAGE_VERSION=$(node -p -e "try { require('./nitro-sniper/package.json').version } catch { '0.0.0' }")
LATEST_VERSION=$(curl --silent "https://raw.githubusercontent.com/slow/nitro-sniper/main/package.json" | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/')

function compareVersions {
   echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; 
}

function installAll() {
   echo "$(tput setaf 6)Installing packages, please wait..."
   install-pkg "http://archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-0_2.56.4-0ubuntu0.18.04.8_amd64.deb" &> /dev/null
   echo "$(tput setaf 2)Installed dependencies."
   echo "$(tput setaf 6)Cloning the latest sniper code..."
   rm -rf nitro-sniper &> /dev/null
   git clone https://github.com/slow/nitro-sniper nitro-sniper &> /dev/null
   cd nitro-sniper
   echo "$(tput setaf 2)Cloned latest version of the sniper."
   echo "$(tput setaf 6)Installing sniper dependencies..."
   npm install &> /dev/null
   echo "$(tput setaf 2)Installed sniper dependencies."
   echo "$(tput setaf 2)Running sniper..."
   npx node ./src/index.js
}

if [ $(compareVersions $PACKAGE_VERSION) -lt $(compareVersions $LATEST_VERSION) ]; then 
   installAll
else
   cd nitro-sniper
   npx node ./src/index.js
fi
  • The file should now look like this:
    Image

  • Visit the environment variables tab.
    Image

  • Set the key as settings and paste this inside the value text box; proceed to edit your configuration.

  • After you are done editing your configuration, click Add new secret. (You can go back to that tab whenever to change your settings)
    Image

  • You can now use CTRL + ENTER or CMD + ENTER to start the sniper or by using the Run button at the top of the page.

  • Tips:

    • If you want to keep the sniper running 24/7 even when you shut down your PC, use uptime robot to ping the repl.it URL as seen here Image
    • To see the output of the sniper, go to the Console tab.
      Image

Local

  • Make sure Node v14+ is installed on your system and open a command prompt/terminal.
  • Run git clone https://github.com/slow/nitro-sniper nitro-sniper
  • Run cd nitro-sniper
  • Run npm install
  • Edit the .env file.
  • Run node .
Clone this wiki locally