-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notify OBS that SC2 is showing loading screen
- Loading branch information
1 parent
3b32122
commit f07e57c
Showing
6 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
AICOACH_MONGO_DSN= | ||
AICOACH_ASSISTANT_ID= | ||
AICOACH_OPENAI_API_KEY= | ||
AICOACH_OPENAI_ORG_ID= | ||
AICOACH_OPENAI_ORG_ID= | ||
AICOACH_OBS_WS_PW= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ dependencies: | |
- pyodmongo | ||
#- RealtimeTTS # install manually as it downgrades openai | ||
- keyboard | ||
- obsws-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import obsws_python as obs | ||
import click | ||
|
||
from time import sleep | ||
|
||
from obs_tools.sc2client import sc2client | ||
from config import config | ||
from obs_tools.types import UIInfo, Screen | ||
from rich import print | ||
|
||
@click.command() | ||
def main(): | ||
with obs.ReqClient(host='localhost', port=4455, password=config.obs_ws_pw, timeout=3) as cl: | ||
resp = cl.get_version() | ||
print(f"OBS Version: {resp.obs_version}") | ||
|
||
while True: | ||
ui = sc2client.get_screens() | ||
|
||
if len(ui.activeScreens) and Screen.loading in ui.activeScreens: | ||
print(Screen.loading) | ||
|
||
data = { | ||
"message": Screen.loading | ||
} | ||
|
||
cl.call_vendor_request(vendor_name="AdvancedSceneSwitcher", request_type="AdvancedSceneSwitcherMessage", request_data=data) | ||
sleep(5) | ||
elif len(ui.activeScreens) == 0: | ||
print("In game") | ||
sleep(10) | ||
else: | ||
sleep(0.25) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters