csgo自動(dòng)急停,python短小精悍版(菜鳥(niǎo)有福了)
自行下載keyboard庫(kù)
import keyboard
import time
def on_release_D(event):
? ?if event.name == 'd':
? ? ? ?start_time = time.time()
? ? ? ?while time.time() - start_time < 0.1:
? ? ? ? ? ?keyboard.press('a')
? ? ? ?keyboard.release('a')
? ?if event.name == 'a':
? ? ? ?start_time = time.time()
? ? ? ?while time.time() - start_time < 0.1:
? ? ? ? ? ?keyboard.press('d')
? ? ? ?keyboard.release('d')
keyboard.on_release(on_release_D)
keyboard.wait()
思路:這段代碼的作用是監(jiān)聽(tīng)鍵盤(pán)事件,當(dāng)松開(kāi)鍵盤(pán)上的字母d時(shí),會(huì)在0.1秒內(nèi)持續(xù)模擬按下字母a;當(dāng)松開(kāi)字母a時(shí),會(huì)在0.1秒內(nèi)持續(xù)按下字母d。
用法:開(kāi)槍前松開(kāi)按鍵即可
標(biāo)簽: