Shielding up key prohibits game run script sharing _dos/bat

Source: Internet
Author: User

My nephew always plays the car on my laptop and the keyboard is falling down. The principle of this AutoIt script is to block up the button, when his face tells him that the keyboard is broken, of course not, in order to convince him, I set a delay of 20 minutes, the next time to open the script, then open the game, nephew play play with the problem, probably not too much explanation. And then delete the game

Enhanced version, first to determine whether the game is running, if the game is the first time to run, then 20 minutes after the block up button
In order not to affect the normal work, but also cause the game button to damage the illusion
Then as long as the game is detected to intercept the up button, the other does not intercept, the detection interval is 1 seconds.

Copy Code code as follows:

Sleep (1200000)
Hotkeyset ("{Up}", "Antigame")
Func Antigame ()
Endfunc
Sleep (3600000)

Copy Code code as follows:

Enhanced version, first to determine whether the game is running, if it is the first time the game to run, then 20 minutes after the block up button
, in order not to affect the normal work, while causing the illusion of the game button damage
Then, as long as the game is detected to intercept the up button, the other is not intercepted, the interval of detection is 1 seconds.

Func Antigame ()
Endfunc
While not processexists ("Supertuxkart.exe")
Sleep (1000)
Wend
Sleep (20*60*1000)
Hotkeyset ("{Up}", "Antigame")
While 1
If processexists ("Supertuxkart.exe") Then
Hotkeyset ("{Up}", "Antigame")
Else
Hotkeyset ("{Up}", "")
EndIf
Sleep (1000)
Wend

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.