diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32bcdf1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/test \ No newline at end of file diff --git a/ACV.py b/ACV.py deleted file mode 100644 index e7886e6..0000000 --- a/ACV.py +++ /dev/null @@ -1,126 +0,0 @@ -from pynput.keyboard import Listener as keyboardListener -from pynput.mouse import Controller, Button -from PyQt5.QtWidgets import QApplication -from pyautogui import screenshot -from os import startfile, path -from PyQt5.uic import loadUi -from threading import Thread -from time import sleep -from sys import exit -import json - - -def keyPress(key): - if str(key) == "<67>": - main() - listener.stop() - - -def main(): - mouse = Controller() - if not path.exists("./champ.txt"): - open("./champ.txt", "w").write("champNameHere") - startfile("champ.txt") - exit() - - with open("./champ.txt", "r") as f: - fav_champ = str(f.readline().strip()).lower() - - lockBtnPos = (950, 800) # old (770, 655) - newPos = (0, 0) - basePos = (540, 925) - squareXDiff = 85 - squareYDiff = 65 - - if fav_champ in allAgents: - agentsLineOrder = len(allAgents) // 2 - newPos = ( - 540 + (allAgents.index(fav_champ) % agentsLineOrder) * squareXDiff, - 925 + (allAgents.index(fav_champ) // agentsLineOrder) * squareYDiff, - ) - - if newPos != (0, 0): - sleep(0.1) - mouse.position = newPos - mouse.click(Button.left, 2) - sleep(0.1) - mouse.position = lockBtnPos - sleep(0.1) - mouse.click(Button.left, 1) - else: - startfile("champ.txt") - exit() - - -def initScreenListenerThread(): - global screenListenerThread - screenListenerThread = Thread(target=initialiseScreenListener, daemon=True).start() - - -def initialiseScreenListener(): - while True: - im = screenshot() - validPixels = 1 - for i in range(pixelsPositions.__len__()): - pixelColor = im.getpixel(pixelsPositions[i]) - if pixelsColors[i] == pixelColor: - validPixels += 1 - else: - break - if validPixels == 4: - listener.stop() - main() - break - exit() - sleep(0.05) - - -def changeAgent(): - newAgent = fen.agentName.text() - if newAgent in allAgents and path.exists("./champ.txt"): - with open("./champ.txt", "w") as f: - f.write(fen.agentName.text()) - else: - fen.agentName.setText("agent not valid !") - - -############## Main Program ############## - - -App = QApplication([]) -fen = loadUi("userInterface.ui") - -global allAgents -# get config data from "config.json" -with open("config.json", "r") as f: - data = json.loads(f.read()) - allAgents = data["agents"] - agentsPreferredMap = data["preferredAgentMap"] - mapsPixelsColors = data["mapsPixelsColors"] - pixelsPositions = list(tuple(pointPos) for pointPos in data["pointsPos"]) - maps = list(agentsPreferredMap.keys()) - print(pixelsPositions) - -exit() - -if path.exists("./champ.txt"): - with open("./champ.txt", "r") as f: - fav_champ = str(f.readline().strip()).lower() - if len(fav_champ) > 0: - fen.agentName.setText(fav_champ) - -fen.initialiseBtn.clicked.connect(initScreenListenerThread) -fen.selectBtn.clicked.connect(changeAgent) -fen.exitBtn.clicked.connect(exit) - - -pixelsPositions = [(0, 100), (0, 200), (0, 300), (0, 400)] -pixelsColors = [(55, 168, 227), (68, 174, 226), (89, 178, 227), (106, 177, 222)] - -global listener -listener = keyboardListener(on_press=keyPress) -listener.start() - - -fen.show() -App.exec() diff --git a/Agent Auto Picker.py b/Agent Auto Picker.py new file mode 100644 index 0000000..a9ac73d --- /dev/null +++ b/Agent Auto Picker.py @@ -0,0 +1,239 @@ +from pyautogui import screenshot, locateOnScreen, size +from PyQt5.QtWidgets import QApplication, QMessageBox +from pynput.mouse import Controller, Button +from os import startfile, path +from PyQt5.QtGui import QIcon, QPixmap +from PyQt5.uic import loadUi +from threading import Thread +from PyQt5.QtCore import Qt +from time import sleep +from sys import exit +import subprocess +import json + + +def main(mapName): + """ + Generate a function comment for the given function body in a markdown code block with the correct language syntax. + Args: + mapName (str): The name of the map. + Returns: + None + """ + mouse = Controller() + + newPos = None + fav_champ = mapsDetails[mapName]["preferredAgent"] + + if fav_champ in agents: + agentsLineOrder = len(agents) // 2 + newPos = ( + basePos[0] + (agents.index(fav_champ) % agentsLineOrder) * squaresXDiff, + basePos[1] + (agents.index(fav_champ) // agentsLineOrder) * squaresYDiff, + ) + + if newPos != None: + sleep(0.1) + mouse.position = newPos + mouse.click(Button.left, 2) + sleep(0.1) + mouse.position = lockBtnPos + sleep(0.1) + mouse.click(Button.left, 1) + + +def initScreenListenerThread(): + """ + Initializes the screen listener thread. + + This function checks the text of the `initialiseBtn` button and performs the + following actions based on its value: + - If the text is "Deactivate", the `executed` flag is set to True, the + text of the `initialiseBtn` button is changed to "Activate", and the + text of the `status` label is set to "Not Active ❌". + - If the text is not "Deactivate", the `executed` flag is set to False, + the text of the `initialiseBtn` button is changed to "Deactivate", and + the text of the `status` label is set to "Active ✔". + + After performing the necessary actions based on the `initialiseBtn` button, + this function creates a new thread named `screenListenerThread` and starts + it. The thread is created with the following parameters: + - `target` is set to `initialiseScreenListener`, which is the function + that will be executed by the thread. + - `daemon` is set to True, which means that the thread will be a daemon + thread and will terminate when the main program ends. + - `name` is set to "screenListener", which is the name of the thread. + + Parameters: + None + + Returns: + None + """ + global screenListenerThread, executed + if str(fen.initialiseBtn.text()).lower() == "deactivate": + executed = True + fen.initialiseBtn.setText("Activate") + fen.status.setText("Not Active ❌") + else: + fen.initialiseBtn.setText("Deactivate") + fen.status.setText("Active ✔") + executed = False + screenListenerThread = Thread( + target=initialiseScreenListener, daemon=True, name="screenListener" + ) + screenListenerThread.start() + + +def initialiseScreenListener(): + """ + Initialises the screen listener. + This function sets the text of the status label to "Active ✔". + It calculates the width and height of the screen using the size() function. + It defines the region of the screen to monitor as the top-left one-fifth of the screen. + The function enters a while loop until the global variable 'executed' is set to True. + For each map name in the 'mapsNames' list, it checks if the corresponding image file exists. + If the image file exists, it uses the locateOnScreen() function to search for the image in the defined region with a confidence of 0.7. + If the image is found, it calls the main() function with the map name as an argument. + It prints a message indicating that the map is locked to the specific map name. + It sets the value of 'executed' to True and updates the text of the initialiseBtn and status labels. + The function then sleeps for 0.05 seconds before continuing to the next iteration of the while loop. + """ + global executed + fen.status.setText("Active ✔") + + width, height = size() + region = (0, 0, width // 5, height // 5) + + while not executed: + for mapName in mapsNames: + if path.exists(f"./assets/maps_pics/{mapName}.png"): + if ( + locateOnScreen( + f"./assets/maps_pics/{mapName}.png", + confidence=0.7, + region=region, + ) + != None + ): + main(mapName) + print(f"map locked to {mapName}") + executed = True + fen.initialiseBtn.setText("Activate") + fen.status.setText("Not Active ❌") + sleep(0.05) + + +def changeAgent(): + """ + Changes the agent for a given map in the config file. + + This function takes no parameters. + + Returns: + None. + """ + mapName = str(fen.map.currentText()).lower() + newAgent = str(fen.agent.currentText()).lower() + if newAgent == "none": + newAgent = "" + if path.exists("./config.json"): + if newAgent in agents or newAgent == "": + with open("config.json", "r") as f: + data = json.loads(f.read()) + data["maps"][mapName]["preferredAgent"] = newAgent + with open("config.json", "w") as f: + f.write(json.dumps(data)) + fen.msg.setText("✅ Reload required !") + else: + fen.msg.setText("agent not valid ❌") + else: + fen.msg.setText("config.json not found ❌") + + +def initFen(fenTitle): + """ + Initializes the Fen object with the specified Fen title. + + Parameters: + fenTitle (str): The title to set for the Fen window. + + Returns: + None + """ + fen.setWindowTitle(fenTitle) + fen.setWindowFlags(Qt.FramelessWindowHint) + fen.setAttribute(Qt.WA_TranslucentBackground) + + # rendering Images + fen.exitBtn.setIcon(QIcon("./assets/close.png")) + fen.exitBtn.setText("") + fen.minimizeBtn.setIcon(QIcon("./assets/minimize.png")) + fen.minimizeBtn.setText("") + fen.appIcon.setPixmap(QPixmap("./assets/icon.ico")) + fen.appIcon.setScaledContents(True) + + # handling events + fen.setMouseTracking(True) + fen.appHeader.mouseReleaseEvent = mouseReleaseEvent + fen.appHeader.mousePressEvent = mousePressEvent + fen.appHeader.mouseMoveEvent = mouseMoveEvent + + +def mousePressEvent(event): + fen._old_pos = event.pos() + + +def mouseReleaseEvent(event): + fen._old_pos = None + + +def mouseMoveEvent(event): + if not fen._old_pos: + return + delta = event.pos() - fen._old_pos + fen.move(fen.pos() + delta) + + +def minimize(): + """ + Minimizes the window by calling the showMinimized() method of the `fen` object. + """ + fen.showMinimized() + + +############## Main Program ############## + + +App = QApplication([]) +fen = loadUi("./ui/main.ui") + +if not path.exists("./config.json"): + msg = QMessageBox.critical( + "Alert !", "config file not found ❌ please execute the config.exe script", "OK" + ) + subprocess.run(["config.py"]) + exit() + +# get config data from "config.json" +with open("config.json", "r") as f: + data = json.loads(f.read()) + agents = data["agents"] + basePos = tuple(data["basePos"]) + lockBtnPos = tuple(data["lockBtnPos"]) + mapsNames = list(data["maps"].keys()) + mapsDetails = data["maps"] + squaresXDiff = data["squaresXDiff"] + squaresYDiff = data["squaresYDiff"] + +initFen("Agent Auto Picker") + +fen.initialiseBtn.clicked.connect(initScreenListenerThread) +fen.setAgent.clicked.connect(changeAgent) +fen.exitBtn.clicked.connect(exit) +fen.exitBtn.clicked.connect(lambda: exit(0)) +fen.minimizeBtn.clicked.connect(minimize) + + +fen.show() +App.exec() diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..cdbb33d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Wissem + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f2a7d0 --- /dev/null +++ b/README.md @@ -0,0 +1,95 @@ +# Read Me + +## [👀 Preview] + + + +--- + +### Table of Contents 👋 + +- [Description 📄](#description) +- [How To Use 📙](#how-to-use) +- [References ](#references) +- [License ](#license) +- [Author Info ✆](#author-info) + +--- + +## Description + +Introducing Valorant Auto Agent Picker Alpha Release + +Hello there, **Auto Agent Picker** is a cutting-edge tool designed to enhance your gaming experience and streamline agent selection. Say goodbye to the dilemma of coordinating agent choices with your friends before a match. With the Auto Agent Picker, you're in control of your destiny in the Valorant universe. + +#### Technologies 🛠️ + +- ## Python3 + +[Back To The Top](#read-me) + +--- + +## How To Use + +download the latest RELEASE package and extract it then launch the .exe file an Enjoy 👌 + +#### Installation + +No Installation required just extract the RELEASE package and **Thats It** + +#### API Reference + +```html +

⚙️⚙️⚙️ Coming Soon ⚙️⚙️⚙️

+``` + +[Back To The Top](#read-me) + +--- + +## References + +[Back To The Top](#read-me) + +--- + +## License + +MIT License + +Copyright (c) 2022 Wissem Zidi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[Back To The Top](#read-me) + +--- + +## Author Info + +#### Created By Wissem Zidi + +- [Website ](https://wissem-zidi-ofc.netlify.com) +- [Email ](https://mail.google.com/mail/u/0/?fs=1&tf=cm&source=mailto&to=wissem.zidi.contact@gmail.com) +- [Github ](https://github.com/wissemzidi/) + +[Back To The Top](#read-me) + +**Have a nice day!** 🚀 diff --git a/assets/agents_pics/first.png b/assets/agents_pics/first.png new file mode 100644 index 0000000..354cfd5 Binary files /dev/null and b/assets/agents_pics/first.png differ diff --git a/assets/agents_pics/lockBtn.png b/assets/agents_pics/lockBtn.png new file mode 100644 index 0000000..b119ec0 Binary files /dev/null and b/assets/agents_pics/lockBtn.png differ diff --git a/assets/agents_pics/second.png b/assets/agents_pics/second.png new file mode 100644 index 0000000..06f664c Binary files /dev/null and b/assets/agents_pics/second.png differ diff --git a/assets/agents_pics/third.png b/assets/agents_pics/third.png new file mode 100644 index 0000000..e780fff Binary files /dev/null and b/assets/agents_pics/third.png differ diff --git a/assets/close.png b/assets/close.png new file mode 100644 index 0000000..16ea545 Binary files /dev/null and b/assets/close.png differ diff --git a/icon.ico b/assets/icon.ico similarity index 100% rename from icon.ico rename to assets/icon.ico diff --git a/assets/maps_pics/ascent.png b/assets/maps_pics/ascent.png new file mode 100644 index 0000000..8ec207c Binary files /dev/null and b/assets/maps_pics/ascent.png differ diff --git a/assets/maps_pics/bind.png b/assets/maps_pics/bind.png new file mode 100644 index 0000000..f0c004c Binary files /dev/null and b/assets/maps_pics/bind.png differ diff --git a/assets/maps_pics/breeze.png b/assets/maps_pics/breeze.png new file mode 100644 index 0000000..14f8c69 Binary files /dev/null and b/assets/maps_pics/breeze.png differ diff --git a/assets/maps_pics/fracture.png b/assets/maps_pics/fracture.png new file mode 100644 index 0000000..7c0fe21 Binary files /dev/null and b/assets/maps_pics/fracture.png differ diff --git a/assets/maps_pics/haven.png b/assets/maps_pics/haven.png new file mode 100644 index 0000000..5e4d25f Binary files /dev/null and b/assets/maps_pics/haven.png differ diff --git a/assets/maps_pics/icebox.png b/assets/maps_pics/icebox.png new file mode 100644 index 0000000..d255c3f Binary files /dev/null and b/assets/maps_pics/icebox.png differ diff --git a/assets/maps_pics/lotus.png b/assets/maps_pics/lotus.png new file mode 100644 index 0000000..7e07356 Binary files /dev/null and b/assets/maps_pics/lotus.png differ diff --git a/assets/maps_pics/pearl.png b/assets/maps_pics/pearl.png new file mode 100644 index 0000000..a75392d Binary files /dev/null and b/assets/maps_pics/pearl.png differ diff --git a/assets/maps_pics/split.png b/assets/maps_pics/split.png new file mode 100644 index 0000000..38d2273 Binary files /dev/null and b/assets/maps_pics/split.png differ diff --git a/assets/minimize.png b/assets/minimize.png new file mode 100644 index 0000000..887bc61 Binary files /dev/null and b/assets/minimize.png differ diff --git a/champ.txt b/champ.txt deleted file mode 100644 index d1f7f74..0000000 --- a/champ.txt +++ /dev/null @@ -1 +0,0 @@ -kay/o \ No newline at end of file diff --git a/config.ico b/config.ico new file mode 100644 index 0000000..f75cee6 Binary files /dev/null and b/config.ico differ diff --git a/config.json b/config.json index 2e0e426..be2c99e 100644 --- a/config.json +++ b/config.json @@ -1,39 +1,20 @@ { - "preferredAgentMap": { - "Ascent": "astra", - "Bind": "breach", - "Breeze": "brimstone", - "Fracture": "", - "Haven": "", - "Icebox": "", - "Pearl": "", - "Split": "" + "basePos": [540, 925], + "lockBtnPos": [950, 800], + "squaresXDiff": 85, + "squaresYDiff": 85, + "maps": { + "ascent": { + "preferredAgent": "cypher" + }, + "bind": { "preferredAgent": "breach" }, + "breeze": { "preferredAgent": "" }, + "fracture": { "preferredAgent": "brimstone" }, + "haven": { "preferredAgent": "" }, + "icebox": { "preferredAgent": "" }, + "pearl": { "preferredAgent": "" }, + "split": { "preferredAgent": "gekko" } }, - - "pointsPos": [ - [0, 100], - [0, 200], - [0, 300], - [0, 400] - ], - - "mapsPixelsColors": { - "Ascent": [ - [55, 168, 227], - [68, 174, 226], - [89, 178, 227], - [106, 177, 222], - [0, 0, 0] - ], - "Bind": [], - "Breeze": [], - "Fracture": [], - "Haven": [], - "Icebox": [], - "Pearl": [], - "Split": [] - }, - "agents": [ "astra", "breach", diff --git a/config.py b/config.py new file mode 100644 index 0000000..df93861 --- /dev/null +++ b/config.py @@ -0,0 +1,155 @@ +from PyQt5.QtWidgets import QApplication, QWidget +from pyautogui import locateOnScreen, size +from PyQt5.uic import loadUi +from threading import Thread +import json + + +def initConfigThread(): + """ + Initializes the configuration thread. + + This function creates a global variable `configThread` and assigns it a `Thread` object. The `Thread` object is initialized with the `initConfig` function as the target, the `daemon` flag set to `True`, and the name set to "configThread". The function then starts the thread by calling the `start` method. + + Parameters: + None + + Returns: + None + """ + global configThread + configThread = Thread(target=initConfig, daemon=True, name="configThread") + configThread.start() + + +def initConfig(): + """ + Initializes the configuration settings. + + This function sets up the initial configuration by performing the following steps: + 1. Sets the text of the instructions widget to "Go to the select agent screen". + 2. Initializes the `stepExecuted` list to an empty list. + 3. Initializes the `confidence` variable to 0.7. + 4. Enters a while loop that continues until the length of `stepExecuted` is less than 4. + 5. Uses the `locateOnScreen` function to find the `lockBtn` image on the screen with a confidence level of 0.7. + - If `lockBtn` is found and "lockBtn" is not in `stepExecuted` list, it stores the position of the `lockBtn` in the `data` dictionary and appends "lockBtn" to the `stepExecuted` list. + 6. Uses the `locateOnScreen` function to find the `firstAgent` image on the screen with a confidence level of 0.7. + - If `firstAgent` is found and "firstAgent" is not in `stepExecuted` list, it stores the position of the `firstAgent` in the `data` dictionary and appends "firstAgent" to the `stepExecuted` list. + - If `secondAgent` is found and "secondAgent" is not in `stepExecuted` list, it calculates the difference between the x-coordinate of `secondAgent` and the x-coordinate of the `basePos` from the `data` dictionary, and stores it in the `squaresXDiff` key of the `data` dictionary. It then appends "secondAgent" to the `stepExecuted` list. + - If `thirdAgent` is found and "thirdAgent" is not in `stepExecuted` list, it calculates the difference between the y-coordinate of `thirdAgent` and the y-coordinate of the `basePos` from the `data` dictionary, and stores it in the `squaresYDiff` key of the `data` dictionary. It then appends "thirdAgent" to the `stepExecuted` list. + 7. Sets the active window to `fen`. + 8. Sets the active window of the application to `fen`. + 9. Raises the `fen` widget to the top of the window stack. + 10. Checks if the length of `stepExecuted` is equal to 4. + - If it is, it opens the file "config.json" in write mode and writes the `data` dictionary as a JSON string to the file. It then sets the text of the instructions widget to "Config Saved ✔". + - If it is not, it sets the text of the instructions widget to "Config error ❌, try again". + """ + fen.instructions.setText("Go to the select agent screen") + + stepExecuted = [] + confidence = 0.7 + + while len(stepExecuted) < 4: + lockBtn = locateOnScreen( + "./assets/agents_pics/lockBtn.png", confidence=confidence + ) + firstAgent = locateOnScreen( + "./assets/agents_pics/first.png", confidence=confidence + ) + secondAgent = locateOnScreen( + "./assets/agents_pics/second.png", confidence=confidence + ) + thirdAgent = locateOnScreen( + "./assets/agents_pics/third.png", confidence=confidence + ) + + if lockBtn != None and "lockBtn" not in stepExecuted: + data["lockBtnPos"] = [ + int(lockBtn.left + lockBtn.width // 2), + int(lockBtn.top + lockBtn.height // 2), + ] + stepExecuted.append("lockBtn") + + if firstAgent != None and "fistAgent" not in stepExecuted: + data["basePos"] = [ + int(firstAgent.left + (firstAgent.width // 2)), + int(firstAgent.top + (firstAgent.height // 2)), + ] + stepExecuted.append("firstAgent") + if secondAgent != None and "secondAgent" not in stepExecuted: + data["squaresXDiff"] = int( + (secondAgent.left + secondAgent.width // 2) - data["basePos"][0] + ) + stepExecuted.append("secondAgent") + if thirdAgent != None and "thirdAgent" not in stepExecuted: + data["squaresYDiff"] = int( + (thirdAgent.top + thirdAgent.height // 2) - data["basePos"][1] + ) + stepExecuted.append("thirdAgent") + + App.setActiveWindow(fen) + QApplication.setActiveWindow(fen) + QWidget.raise_(fen) + if len(stepExecuted) == 4: + with open("config.json", "w") as f: + f.write(json.dumps(data)) + fen.instructions.setText("Config Saved ✔") + else: + fen.instructions.setText("Config error ❌, try again") + + +############## Main Program ############## + + +App = QApplication([]) +fen = loadUi("./ui/config.ui") + +data = { + "basePos": [540, 925], + "lockBtnPos": [950, 800], + "squaresXDiff": 85, + "squaresYDiff": 65, + "maps": { + "ascent": { + "preferredAgent": "", + }, + "bind": {"preferredAgent": ""}, + "breeze": {"preferredAgent": ""}, + "fracture": {"preferredAgent": "brimstone"}, + "haven": {"preferredAgent": ""}, + "icebox": {"preferredAgent": ""}, + "pearl": {"preferredAgent": ""}, + "split": {"preferredAgent": ""}, + }, + "agents": [ + "astra", + "breach", + "brimstone", + "chamber", + "cypher", + "deadlock", + "fade", + "gekko", + "harbor", + "jett", + "kay/o", + "killjoy", + "neon", + "omen", + "phoenix", + "raze", + "reyna", + "sage", + "skye", + "sova", + "viper", + "yoru", + ], +} + + +fen.initialiseBtn.clicked.connect(initConfigThread) + + +fen.show() +App.exec() diff --git a/config/compiler installer.iss b/config/compiler installer.iss new file mode 100644 index 0000000..07ffa01 --- /dev/null +++ b/config/compiler installer.iss @@ -0,0 +1,131 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Auto Agent Picker" +#define MyAppVersion "1.0" +#define MyAppPublisher "wissemzidi" +#define MyAppURL "https://wissem-zidi-ofc.netlify.app" +#define MyAppExeName "Agent Auto Picker.exe" +#define MyAppAssocName MyAppName + " File" +#define MyAppAssocExt ".setup" +#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{34F74956-1EBD-4E2F-A167-DBEB7A89FE50} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +ChangesAssociations=yes +DisableProgramGroupPage=yes +LicenseFile=D:\code\projects\auto champ (valorant) selector\src_code\LICENSE.txt +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputDir=C:\apps output +OutputBaseFilename=Auto Agent Picker installer +SetupIconFile=D:\code\projects\auto champ (valorant) selector\src_code\assets\icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" +Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" +Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl" +Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" +Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" +Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" +Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" +Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" +Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" +Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl" +Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" +Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" +Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" +Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" +Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" +Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\setuptools-57.0.0.dist-info\*"; DestDir: "{app}\setuptools-57.0.0.dist-info"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\ui\*"; DestDir: "{app}\ui"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\wheel-0.36.2.dist-info\*"; DestDir: "{app}\wheel-0.36.2.dist-info"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\win32\*"; DestDir: "{app}\win32"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\win32com\*"; DestDir: "{app}\win32com"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\tcl\*"; DestDir: "{app}\tcl"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\tcl8\*"; DestDir: "{app}\tcl8"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\tk\*"; DestDir: "{app}\tk"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\assets\*"; DestDir: "{app}\assets"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\cv2\*"; DestDir: "{app}\cv2"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\numpy\*"; DestDir: "{app}\numpy"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\PIL\*"; DestDir: "{app}\PIL"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\PyQt5\*"; DestDir: "{app}\PyQt5"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\Pythonwin\*"; DestDir: "{app}\PythonWin"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\pywin32_system32\*"; DestDir: "{app}\pywin32_system32"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_asyncio.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_bz2.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_cffi_backend.cp311-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_ctypes.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_decimal.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_elementtree.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_hashlib.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_lzma.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_multiprocessing.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_overlapped.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_queue.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_socket.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_ssl.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_tkinter.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\_uuid.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\base_library.zip"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\config.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\config.json"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\libcrypto-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\libffi-8.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\libopenblas64__v0.3.21-gcc_10_3_0.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\libssl-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\pyexpat.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\python3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\python311.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\select.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\tcl86t.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\tk86t.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\unicodedata.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\VCRUNTIME140.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "D:\code\projects\auto champ (valorant) selector\output\Agent Auto Picker\VCRUNTIME140_1.dll"; DestDir: "{app}"; Flags: ignoreversion +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Registry] +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0" +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1""" +Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: "" + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/build.config.json b/config/installer.config.json similarity index 69% rename from build.config.json rename to config/installer.config.json index 1dff6d7..0be6d3a 100644 --- a/build.config.json +++ b/config/installer.config.json @@ -1,81 +1,89 @@ -{ - "version": "auto-py-to-exe-configuration_v1", - "pyinstallerOptions": [ - { - "optionDest": "noconfirm", - "value": true - }, - { - "optionDest": "filenames", - "value": "D:/code/projects/auto champ (valorant) selector/source_code/ACV.py" - }, - { - "optionDest": "onefile", - "value": false - }, - { - "optionDest": "console", - "value": true - }, - { - "optionDest": "icon_file", - "value": "D:/code/projects/auto champ (valorant) selector/source_code/icon.ico" - }, - { - "optionDest": "ascii", - "value": false - }, - { - "optionDest": "clean_build", - "value": false - }, - { - "optionDest": "strip", - "value": false - }, - { - "optionDest": "noupx", - "value": false - }, - { - "optionDest": "disable_windowed_traceback", - "value": false - }, - { - "optionDest": "embed_manifest", - "value": true - }, - { - "optionDest": "uac_admin", - "value": false - }, - { - "optionDest": "uac_uiaccess", - "value": false - }, - { - "optionDest": "win_private_assemblies", - "value": false - }, - { - "optionDest": "win_no_prefer_redirects", - "value": false - }, - { - "optionDest": "bootloader_ignore_signals", - "value": false - }, - { - "optionDest": "argv_emulation", - "value": false - }, - { - "optionDest": "datas", - "value": "D:/code/projects/auto champ (valorant) selector/source_code/champ.txt;." - } - ], - "nonPyinstallerOptions": { - "increaseRecursionLimit": true, - "manualArguments": "" - } +{ + "version": "auto-py-to-exe-configuration_v1", + "pyinstallerOptions": [ + { + "optionDest": "noconfirm", + "value": true + }, + { + "optionDest": "filenames", + "value": "D:/code/projects/auto champ (valorant) selector/src_code/Agent Auto Picker.py" + }, + { + "optionDest": "onefile", + "value": false + }, + { + "optionDest": "console", + "value": false + }, + { + "optionDest": "icon_file", + "value": "D:/code/projects/auto champ (valorant) selector/src_code/assets/icon.ico" + }, + { + "optionDest": "ascii", + "value": false + }, + { + "optionDest": "clean_build", + "value": false + }, + { + "optionDest": "strip", + "value": false + }, + { + "optionDest": "noupx", + "value": false + }, + { + "optionDest": "disable_windowed_traceback", + "value": false + }, + { + "optionDest": "embed_manifest", + "value": true + }, + { + "optionDest": "uac_admin", + "value": false + }, + { + "optionDest": "uac_uiaccess", + "value": false + }, + { + "optionDest": "win_private_assemblies", + "value": false + }, + { + "optionDest": "win_no_prefer_redirects", + "value": false + }, + { + "optionDest": "bootloader_ignore_signals", + "value": false + }, + { + "optionDest": "argv_emulation", + "value": false + }, + { + "optionDest": "datas", + "value": "D:/code/projects/auto champ (valorant) selector/src_code/ui;ui/" + }, + { + "optionDest": "datas", + "value": "D:/code/projects/auto champ (valorant) selector/src_code/assets;assets/" + }, + { + "optionDest": "datas", + "value": "D:/code/projects/auto champ (valorant) selector/src_code/config.json;." + } + ], + "nonPyinstallerOptions": { + "increaseRecursionLimit": true, + "manualArguments": "" + } } \ No newline at end of file diff --git a/installer/Agent Auto Picker/success/success.txt b/installer/Agent Auto Picker/success/success.txt new file mode 100644 index 0000000..0f0c913 --- /dev/null +++ b/installer/Agent Auto Picker/success/success.txt @@ -0,0 +1 @@ +success \ No newline at end of file diff --git a/installer/close.png b/installer/close.png new file mode 100644 index 0000000..16ea545 Binary files /dev/null and b/installer/close.png differ diff --git a/installer/icon.ico b/installer/icon.ico new file mode 100644 index 0000000..547bd9a Binary files /dev/null and b/installer/icon.ico differ diff --git a/installer/install.py b/installer/install.py new file mode 100644 index 0000000..5f28f02 --- /dev/null +++ b/installer/install.py @@ -0,0 +1,176 @@ +from PyQt5.QtWidgets import QApplication, QFileDialog +from pyuac import runAsAdmin, isUserAdmin +import win32com.shell.shell as shell +from PyQt5.QtGui import QIcon +from PyQt5.uic import loadUi +from threading import Thread +from PyQt5.QtCore import Qt +from PyQt5 import QtGui +import win32com.client +from sys import exit +import shutil +import sys +import os + + +def createShortcut(sourcePath, toPath, icon): + """ + Creates a shortcut from a source file to a specified path with an icon. + + Parameters: + source (str): The path to the source file. + toPath (str): The path where the shortcut will be created. + icon (str): The path to the icon file. + + Returns: + None + """ + shell = win32com.client.Dispatch("WScript.Shell") + shortcut = shell.CreateShortCut(toPath) + shortcut.Targetpath = sourcePath + shortcut.IconLocation = icon + shortcut.save() + + +def copyFolderToPrograms(installDir): + try: + installDir = os.path.join(installDir, "Agent Auto Picker") + src = os.path.join(os.getcwd(), "Agent Auto Picker") + shutil.copytree(src, installDir) + return True + except: + return False + + +def createAppShortcut(installDir): + try: + programsShortcutsPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" + mainExecutablePath = os.path.join( + installDir, "Agent Auto Picker\Agent Auto Picker.exe" + ) + curdir = os.getcwd() + + # creating the shortcut and saving it + path = os.path.join(curdir, "Agent Auto Picker.lnk") + + createShortCut( + os.path.join(mainExecutablePath), + os.path.join(programsShortcutsPath, "Agent Auto Picker.lnk"), + os.path.join(curdir, "icon.ico"), + ) + os.rename( + os.path.join(programsShortcutsPath, "Agent Auto Picker.lnk"), + "Agent Auto Picker", + ) + return True + except: + return False + + +def install(): + global fen + installDir = fen.dir.text() + if not installDir: + installDir = os.environ["ProgramFiles"] + fen.close() + fen = loadUi("./progress.ui") + initFen("Installing Agent Auto Picker") + + fen.cancelBtn.clicked.connect(cancel) + + fen.exitBtn.clicked.connect(lambda: exit(0)) + fen.minimizeBtn.clicked.connect(minimize) + + fen.show() + if not copyFolderToPrograms(installDir): + fen.error.setText("Error: Failed to copy Agent Auto Picker") + return + fen.progress.value(60) + + if not createAppShortcut(installDir): + fen.error.setText("Error: Failed to create Agent Auto Picker shortcut") + fen.progress.value(70) + return + + fen.progress.value(100) + + +def initFen(fenTitle): + fen.setWindowTitle(fenTitle) + fen.setWindowFlags(Qt.FramelessWindowHint) + fen.setAttribute(Qt.WA_TranslucentBackground) + + # set dynamic text + fen.dir.setText(str(os.environ["ProgramFiles"])) + + # rendering Images + fen.exitBtn.setIcon(QIcon("close.png")) + fen.exitBtn.setText("") + fen.minimizeBtn.setIcon(QIcon("minimize.png")) + fen.minimizeBtn.setText("") + fen.appIcon.setPixmap(QtGui.QPixmap("icon.ico")) + fen.appIcon.setScaledContents(True) + + # handling events + fen.setMouseTracking(True) + fen.appHeader.mouseReleaseEvent = mouseReleaseEvent + fen.appHeader.mousePressEvent = mousePressEvent + fen.appHeader.mouseMoveEvent = mouseMoveEvent + + +def mousePressEvent(event): + fen._old_pos = event.pos() + + +def mouseReleaseEvent(event): + fen._old_pos = None + + +def mouseMoveEvent(event): + if not fen._old_pos: + return + delta = event.pos() - fen._old_pos + fen.move(fen.pos() + delta) + + +def selectDir(): + directory = QFileDialog.getExistingDirectory(None, "Select Directory") + if directory: + fen.dir.setText(str(directory)) + + +def cancel(): + exit(0) + + +def reset(): + fen.dir.setText(str(os.environ["ProgramFiles"])) + fen.createShortcut.setChecked(False) + fen.runConfig.setChecked(False) + + +def minimize(): + fen.showMinimized() + + +if __name__ == "__main__": + # requesting admin privileges + if not isUserAdmin: + print("Requires Admin") + runAsAdmin() + else: + App = QApplication(sys.argv) + App.setWindowIcon(QIcon("icon.ico")) + fen = loadUi("installConfig.ui") + initFen("Install Agent Auto Picker") + + fen.selectDirBtn.clicked.connect(selectDir) + fen.installBtn.clicked.connect(install) + fen.cancelBtn.clicked.connect(cancel) + fen.resetBtn.clicked.connect(reset) + + fen.exitBtn.clicked.connect(lambda: exit(0)) + fen.minimizeBtn.clicked.connect(minimize) + + fen.show() + App.exec() diff --git a/installer/installConfig.ui b/installer/installConfig.ui new file mode 100644 index 0000000..bc8a461 --- /dev/null +++ b/installer/installConfig.ui @@ -0,0 +1,438 @@ + + + Form + + + + 0 + 0 + 522 + 463 + + + + + 10 + + + + Form + + + QWidget { +color: #EEE; +} + +#Form { +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +} + +#widget { + border-radius: 15px; +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +color: #EEE; +} + +#appHeader { + background-color: rgba(0, 0, 0, 0.75); + border: none; + border-top-left-radius: 15px; + border-top-right-radius: 15px; +} + +QPushButton, QComboBox { + background: transparent; + border-radius: 10px; + color: white; + border: 1px solid #999; +} +QPushButton:hover, QLineEdit:hover { + border-color: red; +} + +QLineEdit { + padding: 5px; + background-color: rgba(0, 0, 0, 0.5); + border-radius: 10px; + color: white; + border: 1px solid #999; +} + +QCheckBox { + background-color: transparent +} + +#title { + color: red; +} + +QLabel { + background-color: transparent; +} + + + + + 0 + 0 + 521 + 461 + + + + + + 70 + 190 + 301 + 51 + + + + + 11 + + + + border-top-right-radius: 0px; +border-bottom-right-radius: 0px; + + + C:\Program Files + + + Choose A Location + + + + + true + + + + 1 + 0 + 521 + 51 + + + + QPushButton { + border-radius: 2px; + height: 30px; + width: 30px; + border: 5px solid transparent; +} +QPushButton:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +#appIcon { + width: 50px; + min-width: 50px; +} + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 15 + + + 3 + + + 0 + + + + + <html><head/><body><p><br/></p></body></html> + + + border-image: url(:/res/icon.ico) 0; +width: 30px; +max-width: 40px; + + + + + + + + + + + 12 + 75 + true + + + + Auto Agent Picker + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + + + + - + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + <html><head/><body><p><br/></p></body></html> + + + QPushButton:hover { + background-color: red; +} + + + X + + + + + + + + + 180 + 390 + 281 + 51 + + + + + 14 + + + + PointingHandCursor + + + Install + + + + + + 70 + 60 + 93 + 41 + + + + + 11 + + + + PointingHandCursor + + + Reset + + + + + + 80 + 390 + 91 + 51 + + + + + 10 + + + + PointingHandCursor + + + Cancel + + + + + + 140 + 340 + 261 + 20 + + + + + 9 + + + + PointingHandCursor + + + Run Config script when complete + + + + + + 370 + 190 + 91 + 51 + + + + + 11 + + + + PointingHandCursor + + + border-top-left-radius: 0px; +border-bottom-left-radius: 0px; + + + select + + + + + + 110 + 140 + 201 + 41 + + + + + 10 + + + + Installation Directory : + + + + + + 100 + 250 + 341 + 31 + + + + + 10 + + + + color: red; + + + + + + Qt::AlignCenter + + + + + + 160 + 310 + 221 + 21 + + + + + 9 + + + + PointingHandCursor + + + Create desktop shortcut + + + + + + 280 + 60 + 181 + 41 + + + + + 14 + 75 + true + + + + Installation + + + Qt::AlignCenter + + + + + + + + + diff --git a/installer/minimize.png b/installer/minimize.png new file mode 100644 index 0000000..887bc61 Binary files /dev/null and b/installer/minimize.png differ diff --git a/installer/progress.ui b/installer/progress.ui new file mode 100644 index 0000000..1375b11 --- /dev/null +++ b/installer/progress.ui @@ -0,0 +1,309 @@ + + + Form + + + + 0 + 0 + 520 + 462 + + + + + 10 + + + + Form + + + QWidget { +color: #EEE; +} + +#Form { +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +} + +#widget { + border-radius: 15px; +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +color: #EEE; +} + +#appHeader { + background-color: rgba(0, 0, 0, 0.75); + border: none; + border-top-left-radius: 15px; + border-top-right-radius: 15px; + border: none; +} + +QPushButton, QComboBox { + background: transparent; + border-radius: 10px; + color: white; + border: 1px solid #999; +} +QPushButton:hover, QLineEdit:hover { + border-color: red; +} + +QLineEdit { + padding: 5px; + background-color: rgba(0, 0, 0, 0.5); + backdrop-filter: blur(5px); + border-radius: 10px; + color: white; + border: 1px solid #999; +} + +QCheckBox { + background-color: transparent +} + +#title { + color: red; +} + +QLabel { + background-color: transparent; +} + + + + + 0 + 0 + 521 + 461 + + + + + + + + true + + + + 1 + 0 + 521 + 51 + + + + QPushButton { + border-radius: 2px; + height: 30px; + width: 30px; + border: 5px solid transparent; +} +QPushButton:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +#appIcon { + width: 50px; + min-width: 50px; +} + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 15 + + + 3 + + + 0 + + + + + <html><head/><body><p><br/></p></body></html> + + + border-image: url(:/res/icon.ico) 0; +width: 30px; +max-width: 40px; + + + + + + + + + + + 12 + 75 + true + + + + Auto Agent Picker + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + + + + - + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + <html><head/><body><p><br/></p></body></html> + + + QPushButton:hover { + background-color: red; +} + + + X + + + + + + + + + 160 + 70 + 181 + 81 + + + + + 14 + 75 + true + + + + Installing... + + + Qt::AlignCenter + + + + + + 90 + 170 + 401 + 91 + + + + + 18 + + + + 0 + + + + + + 120 + 380 + 261 + 51 + + + + + 10 + + + + PointingHandCursor + + + Cancel + + + + + + 80 + 280 + 341 + 31 + + + + + 11 + + + + color: red; + + + + + + Qt::AlignCenter + + + + + + + + + diff --git a/installer/resources.qrc b/installer/resources.qrc new file mode 100644 index 0000000..69d6dd4 --- /dev/null +++ b/installer/resources.qrc @@ -0,0 +1,8 @@ + + + icon.ico + minimize.png + fullscreen.png + close.png + + diff --git a/tempFile.py b/tempFile.py new file mode 100644 index 0000000..1c66b15 --- /dev/null +++ b/tempFile.py @@ -0,0 +1 @@ +def minimize(): \ No newline at end of file diff --git a/test.py b/test.py deleted file mode 100644 index d084ad0..0000000 --- a/test.py +++ /dev/null @@ -1,17 +0,0 @@ -from pynput.mouse import Controller, Button -from time import sleep - - -sleep(2) -mouse = Controller() - -mouse.position = (770, 655) -# mouse.position = (435 + 65 + 65, 740 + 65) -# mouse.position = (435 + 65 + 65, 740 + 65) -exit() - -i = 1 -while True: - print(f"{i} : ", mouse.position) - i += 1 - sleep(1) diff --git a/userInterface.ui b/ui/config.ui similarity index 51% rename from userInterface.ui rename to ui/config.ui index ddc6e93..1f3451e 100644 --- a/userInterface.ui +++ b/ui/config.ui @@ -1,167 +1,124 @@ - - - Form - - - - 0 - 0 - 426 - 267 - - - - Form - - - QWidget { -background-color: #000; -color: #EEE; -} - -QPushButton { - border-radius: 10px; - color: white; - border: 1px solid #999; -} -QPushButton:hover { - border-color: red; -} - -#title { - color: red; -} - -QLabel { - background-color: transparent; -} - - - - - 20 - 10 - 261 - 61 - - - - - 16 - 75 - true - - - - Agent Auto Picker - - - Qt::AlignCenter - - - - - - 150 - 180 - 151 - 41 - - - - - 12 - 75 - true - - - - PointingHandCursor - - - INITIALISE - - - - - - 310 - 20 - 101 - 41 - - - - - 12 - 75 - true - - - - PointingHandCursor - - - EXIT - - - - - - 120 - 240 - 211 - 16 - - - - ShortCut : CTRL + SHIFT + ALT + C - - - - - - 40 - 100 - 251 - 41 - - - - - 10 - - - - padding: 5px; -border-radius: 10px; -border: 1px solid #999; - - - Select Agent - - - - - - 310 - 100 - 101 - 41 - - - - - 10 - 75 - true - - - - Select - - - - - - + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + QWidget { +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +color: #EEE; +} + +QPushButton, QComboBox { + background: transparent; + border-radius: 10px; + color: white; + border: 1px solid #999; +} +QPushButton:hover { + border-color: red; +} + +QLabel { + background-color: transparent; +} + + + + + 40 + 20 + 311 + 61 + + + + + 14 + 75 + true + + + + + + + Config - Agent Auto Picker + + + + + + 90 + 100 + 211 + 51 + + + + + 12 + + + + Begin Config + + + + + + 40 + 250 + 341 + 41 + + + + + 10 + 75 + true + + + + color: red; + + + Any Old Configuration Will Be deleted ! + + + + + + 50 + 190 + 311 + 41 + + + + + 12 + + + + + + + Qt::AlignCenter + + + + + + diff --git a/ui/icon.ico b/ui/icon.ico new file mode 100644 index 0000000..538de24 Binary files /dev/null and b/ui/icon.ico differ diff --git a/ui/main.ui b/ui/main.ui new file mode 100644 index 0000000..9f4dba3 --- /dev/null +++ b/ui/main.ui @@ -0,0 +1,525 @@ + + + Form + + + + 0 + 0 + 521 + 466 + + + + Form + + + QWidget { +color: #EEE; +} + +#Form { +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +} + +#widget { + border-radius: 15px; +background-color: qlineargradient(spread:pad, x1:0.487562, y1:0.512, x2:1, y2:0, stop:0 rgba(0, 0, 0, 242), stop:1 rgba(0, 113, 240, 238)); +color: #EEE; +} + +#appHeader { + background-color: rgba(0, 0, 0, 0.75); + border: none; + border-top-left-radius: 15px; + border-top-right-radius: 15px; +} + +QPushButton, QComboBox { + background: transparent; + border-radius: 10px; + color: white; + border: 1px solid #999; +} +QPushButton:hover { + border-color: red; +} +QLabel { + background-color: transparent; +} + + + + + 0 + 0 + 521 + 461 + + + + + + + + true + + + + 0 + 0 + 521 + 51 + + + + QPushButton { + border-radius: 2px; + height: 30px; + width: 30px; + border: 5px solid transparent; +} +QPushButton:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +#appIcon { + width: 50px; + min-width: 50px; +} + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 15 + + + 3 + + + 0 + + + + + <html><head/><body><p><br/></p></body></html> + + + border-image: url(:/src/icon.ico) 0; +width: 30px; +max-width: 40px; + + + + + + + + + + + 12 + 75 + true + + + + Auto Agent Picker + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + + + + - + + + + + + + + 18 + 50 + false + + + + PointingHandCursor + + + <html><head/><body><p><br/></p></body></html> + + + QPushButton:hover { + background-color: red; +} + + + X + + + + + + + + + 350 + 260 + 111 + 21 + + + + Not Active ❌ + + + Qt::AlignCenter + + + + + + 290 + 320 + 211 + 41 + + + + + 11 + + + + + + + Qt::AlignCenter + + + + + + 40 + 130 + 231 + 51 + + + + + 12 + + + + padding: 10px; +background-color: transparent; + + + + ascent + + + + + bind + + + + + breeze + + + + + fracture + + + + + haven + + + + + icebox + + + + + pearl + + + + + split + + + + + + + 50 + 210 + 121 + 31 + + + + + 12 + + + + Agent : + + + + + + 330 + 190 + 151 + 61 + + + + + 12 + 75 + true + + + + PointingHandCursor + + + Activate + + + + + + 90 + 350 + 121 + 41 + + + + + 10 + 75 + true + + + + Set + + + + + + 40 + 250 + 231 + 51 + + + + + 12 + false + + + + padding: 10px; +background-color: transparent; + + + + None + + + + + astra + + + + + breach + + + + + brimstone + + + + + chamber + + + + + cypher + + + + + deadlock + + + + + fade + + + + + gekko + + + + + harbor + + + + + jett + + + + + kay/o + + + + + killjoy + + + + + neon + + + + + omen + + + + + phoenix + + + + + raze + + + + + reyna + + + + + sage + + + + + skye + + + + + sova + + + + + viper + + + + + yoru + + + + + + + 50 + 90 + 121 + 31 + + + + + 12 + + + + Map : + + + + + + 340 + 430 + 171 + 21 + + + + color: #444; + + + Copyright 2023 ©️ wissemzidi + + + + + + + + + diff --git a/ui/resources.qrc b/ui/resources.qrc new file mode 100644 index 0000000..c3019e1 --- /dev/null +++ b/ui/resources.qrc @@ -0,0 +1,5 @@ + + + icon.ico + +