Skip to content

Commit

Permalink
Automatically install dependencies from requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRedstoneRadiant authored Apr 6, 2022
1 parent 03297c8 commit 0e31a2e
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions artemis.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import requests
from colorama import Fore
import msmcauth
import socket
import ssl
import datetime
import threading
import time
from discord_webhook import DiscordWebhook, DiscordEmbed
import fade
import sys
# Standard Library imports
import socket, ssl, datetime, threading, time, sys, subprocess

try:
import requests
import msmcauth
import fade
from colorama import Fore
from discord_webhook import DiscordWebhook, DiscordEmbed

except ImportError:
print("Installing dependencies... (requirements.txt)")

# sys.executable -m pip install -r requirements.txt (silenced stdout)
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'], stderr=subprocess.STDOUT, stdout=subprocess.DEVNULL)

# import again
import requests
import msmcauth
import fade
from colorama import Fore
from discord_webhook import DiscordWebhook, DiscordEmbed

WEBHOOK_URL = ""
accdata = []
Expand Down Expand Up @@ -141,23 +152,23 @@ def success_true(token_list):

print("Blessed by the Goddess - Artemis\n")

target_name = input("Name ~> ")
target_name = input("% Name ~> ")
while not target_name:
target_name = input("Name ~> ")
target_name = input("% Name ~> ")

auto_offset = auto_ping(5)

offset = float(input(f"\nOffset [{auto_offset:.2f}ms] ~> ") or auto_offset)
offset = float(input(f"\n% Offset [{auto_offset:.2f}ms] ~> ") or auto_offset)

droptime = requests.get(f"http://api.star.shopping/droptime/{target_name}", headers={"User-Agent": "Sniper"}).json()

if droptime.get("unix"):
droptime = droptime["unix"] - (offset / 1000)
else:
print(f"\n{Fore.RED}ERROR: \"{droptime['error'].capitalize()}\"{Fore.RESET}")
droptime = input(f"\n{target_name} Unix Droptime ~> {Fore.RESET}")
droptime = input(f"\n% {target_name} Unix Droptime ~> {Fore.RESET}")
while not droptime:
droptime = input(f"\n{target_name} Unix Droptime ~> {Fore.RESET}")
droptime = input(f"\n% {target_name} Unix Droptime ~> {Fore.RESET}")

droptime = int(droptime)

Expand Down Expand Up @@ -225,4 +236,4 @@ def success_true(token_list):
success_true(accdata)

finally:
input("Press enter to exit...")
input("\n\n\nPress enter to exit...")

0 comments on commit 0e31a2e

Please sign in to comment.