Skip to content

Commit b7f3c02

Browse files
committed
Build inicial
1 parent 4e23f83 commit b7f3c02

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# FlashRichPresence
22
Permite detecção de Rich Presence para Adobe Flash Player
3+
4+
No momento so testado em windows
5+
Os executaveis devem ter o nome "flashplayer.exe" para standalone ou "flashplayer_32_sa_debug.exe" para build de debug

flashpresence.py

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import psutil
2+
from pypresence import Presence
3+
import time
4+
5+
6+
def checkprocess(targetname):
7+
for proc in psutil.process_iter():
8+
try:
9+
if targetname.lower() in proc.name().lower():
10+
return True
11+
except (psutil.NoSuchProcess, psutil.AccessDenied,
12+
psutil.ZombieProcess):
13+
pass
14+
return False
15+
16+
if __name__ == "__main__":
17+
18+
print("Started.")
19+
DebugRunning = False
20+
StandaloneRunning = False
21+
RPCRun = False
22+
TYPE = "Unknown"
23+
VERSION = "Unknown"
24+
25+
client_id = '1013717821122936873' # Fake ID, put your real one here
26+
RPC = Presence(client_id)
27+
fpd = "flashplayer_32_sa_debug.exe"
28+
fp = "flashplayer.exe"
29+
while True: # The presence will stay on as long as the program is running
30+
time.sleep(4)
31+
32+
if checkprocess(fpd) == True:
33+
print("Found Debug Build")
34+
TYPE = "Debug"
35+
if DebugRunning == False and RPCRun == False:
36+
RPC.connect()
37+
RPCRun = True
38+
# RPC.update(state="Idle", details="Not Quite Dead Yet.", large_image="afp32_big", large_text=f"Version {VERSION} ({TYPE})")
39+
DebugRunning = True
40+
else:
41+
print("Debug Build Not Found")
42+
if DebugRunning == True and RPCRun == True:
43+
DebugRunning = False
44+
if StandaloneRunning == False and RPCRun == True:
45+
RPCRun = False
46+
RPC.close()
47+
48+
if checkprocess(fp) == True:
49+
print("Found Standalone Build")
50+
TYPE = "Standard"
51+
if StandaloneRunning == False and RPCRun == False:
52+
RPC.connect()
53+
RPCRun = True
54+
# RPC.update(state="Idle", details="Not Quite Dead Yet.", large_image="afp32_big", large_text=f"Version {VERSION} ({TYPE})")
55+
StandaloneRunning = True
56+
else:
57+
print("Standalone Build Not Found")
58+
if StandaloneRunning == True and RPCRun == True:
59+
StandaloneRunning = False
60+
if DebugRunning == False and RPCRun == True:
61+
RPCRun = False
62+
RPC.close()
63+
64+
if DebugRunning == True and StandaloneRunning == True:
65+
TYPE = "Multiple Running"
66+
if RPCRun == True:
67+
RPC.update(state="Idle", details="Not Quite Dead Yet.", large_image="afp32_big", large_text=f"Version {VERSION} ({TYPE})")

0 commit comments

Comments
 (0)