close miner and power up gpu on game start

This commit is contained in:
Death916 2020-03-04 16:47:48 -08:00
parent 07c66a6add
commit 94d04061a9

View file

@ -69,19 +69,23 @@ def startminer():
def checkgames():
game = 0
for i in gameList.values():
print(i)
game = findProcessIdByName(i)
if game:
if game == []:
print(i + ' is not running')
else:
print("game is running")
print(game)
print(i)
miners = checkminer()
if miners == 'running':
killminer()
keyboard.press_and_release('alt+y')
keyboard.press_and_release('alt+y')
return 'gamerunning'
else:
return 'nogame'
@ -93,10 +97,10 @@ def checkgames():
"""
curTime = time.time()
while True:
checkgames()
gpus = checkgpu()
miner = checkminer()
checkgames()
usage = str(gpu.showUtilization())
#log(str(gpu.showUtilization()))
@ -105,7 +109,7 @@ while True:
if x != 'gamerunning':
print('starting miner')
startminer()
time.sleep(120)
time.sleep(12)
if gpus is 'isavailable' and miner is 'running':
killminer()