Comments (2)
Hello, I have managed to create a function to launch the RuneLite client with the settings, however it seems tKinter <or Python?> doesn't like to play nice unless you thread that button. This allows you to launch the client, and still use the OSBC UI. However, I think because not everything is multithreaded that this approach will not work?
Let me know. Below is what I did in the home_view_osrs.py with a complete flow:
import threading
self.grid_rowconfigure(9, weight=0) # - Launch btn
# Launch Btn
self.btn_launch = customtkinter.CTkButton(master=self,
text="Launch",
#fg_color="gray40",
#hover_color="gray25",
command=threading.Thread(target=self.__launchrunelite_with_settings).start)
self.btn_launch.grid(row=9, column=0, sticky="nwes", padx=40, pady=(0, 15))
def __launchrunelite_with_settings(self):
# Start by grabbing the logged in user
currentUser = os.getlogin()
# src path for our runelite bot settings
PATH = Path(__file__).parent.parent.resolve() # src directory
# executable path for runelite, taking the current logged in user
# this is a default path for a windows user
EXECPATH = f"C:\\Users\\{currentUser}\\AppData\\Local\\RuneLite\\RuneLite.exe"
# executable args for runelite to direct the client to launch with bot settings
EXECARGS = f" --clientargs \"--config={PATH}\\runelite_settings\\settings.properties\""
#possible outdated method, but only method I could manage to get to work
self.main.toggle_btn_state(enabled=True)
os.system(EXECPATH + EXECARGS)
from os-bot-color.
Just placing your updated code here for reference:
# UI Code
self.grid_rowconfigure(9, weight=0) # - Launch btn
# Launch Btn
self.btn_launch = customtkinter.CTkButton(master=self,
text="Launch",
#fg_color="gray40",
#hover_color="gray25",
command=self.__launchrunelite_with_settings)
self.btn_launch.grid(row=9, column=0, sticky="nwes", padx=40, pady=(0, 15))
from subprocess import DETACHED_PROCESS, Popen
def __launchrunelite_with_settings(self):
# src path for our runelite bot settings
PATH = Path(__file__).parent.parent.resolve()
# currently logged in user <windows>
currentUser = os.getlogin()
# executable path for runelite, taking the current logged in user
# this is a default path for a windows user
EXECPATH = f"C:\\Users\\{currentUser}\\AppData\\Local\\RuneLite\\RuneLite.exe"
# executable args for runelite to direct the client to launch with bot settings
EXECARG1 = "--clientargs"
EXECARG2 = f"--config={PATH}\\runelite_settings\\settings.properties"
self.main.toggle_btn_state(enabled=True)
client = Popen([EXECPATH, EXECARG1, EXECARG2], creationflags=DETACHED_PROCESS)
from os-bot-color.
Related Issues (20)
- [OSR-18] Add remote mouse option HOT 1
- [OSR-17] Add Window attribute for entire RuneLite window to allow right-clicking inventory items HOT 4
- [OSR-15] OCR fails when lines of text are too close together HOT 2
- [OSR-27] Add function to determine if color exists in Rectangle
- [OSR-28] Add "latest msg" features to Morg API utility HOT 1
- [OSR-29] Add Rectangle manipulation functions HOT 2
- [OSR-35] ValueError when using red_click_check in mouse.click HOT 3
- [OSR-38] Bot.stop() function does not work when called within script
- [OSR-39] Add "inventory full" check to Morg API
- [OSR-40] Improve Geometry constructors & sorting key functions
- [OSR-44] Make SpriteScraper use OSRS Wiki API
- [OSR-45] Profile Manager plugin interferes with game_launcher utility HOT 2
- [OSR-47] Swap PyAutoGUI for PyDirectInput HOT 3
- [OSR-48] Implement context manager for StatusSocket
- ERROR: unsupported argument text_font to the CTkLabel constructor from the customtkinter package.
- Stuck on this error, thank you in advance for any help HOT 2
- runelite_cv.py -> extract_objects() deduplication
- Jagex Launcher support HOT 3
- Some questions about the project HOT 2
- Old Discord Member - Request New Invite HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from os-bot-color.