python 自动-战争雷霆的奖励
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 自动-战争雷霆的奖励相关的知识,希望对你有一定的参考价值。
import subprocess
import os
import time
import pyautogui
import datetime
from ctypes import Structure, windll, c_uint, sizeof, byref
import sys
import ctypes
#Define hours you want the program to run below
hour1 = 3
hour2 = 6
def warthunder():
os.startfile("E:\Program Files (86x)\steamapps\common\War Thunder\launcher.exe")#Path to launcher.exe here
time.sleep(200)
pyautogui.press('enter')
time.sleep(40)
pyautogui.press('enter')
time.sleep(30)
pyautogui.press('enter')
def killProcess():
os.system("taskkill /f /im aces.exe")
time.sleep(1)
def shutdown():
subprocess.call(["shutdown", "/s"])
class LASTINPUTINFO(Structure):
_fields_ = [
('cbSize', c_uint),
('dwTime', c_uint),
]
def get_idle_duration():
lastInputInfo = LASTINPUTINFO()
lastInputInfo.cbSize = sizeof(lastInputInfo)
windll.user32.GetLastInputInfo(byref(lastInputInfo))
millis = windll.kernel32.GetTickCount() - lastInputInfo.dwTime
return millis / 1000.0
#Call get_idle_duration() to get idle time in seconds
def wait():
while 1:
now = datetime.datetime.now()
hour = now.hour
if hour > int(hour1) and hour < int(hour2):
time.sleep(1)
if get_idle_duration() == 0.0:
break
elif get_idle_duration() > 120:
warthunder()
killProcess()
shutdown()
break
else:
while 1:
if get_idle_duration() > 1200:
warthunder()
killProcess()
shutdown()
if __name__ == '__main__':
main()
以上是关于python 自动-战争雷霆的奖励的主要内容,如果未能解决你的问题,请参考以下文章
视频剪辑 战争雷霆BT-5日常
仿《雷霆战机》飞行射击手游开发--游戏对象
仿《雷霆战机》飞行射击手游开发--游戏简介
有啥好玩的飞机游戏
Python —— 给女儿写个雷霆战机
python及pygame雷霆战机游戏项目实战14 游戏开始结束界面