Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write the blocking up key to prevent the game from running the script

Shulou Source: shulou.com Published: 2022-06-03 07:48:54 10月29日 Update

This article introduces the relevant knowledge of "how to write a script to block the up key to prohibit the game from running". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Enhanced version, first judge whether the game is running, if it is the first time the game is run, then block the UP key after 20 minutes

In order not to affect the normal work, and at the same time cause the false appearance that the game keys are damaged.

Then the up key is intercepted as soon as the game is detected to be running, otherwise it is not intercepted, and the detection interval is 1 second.

The code is as follows:

Sleep (1200000)

HotKeySet ("{UP}", "AntiGame")

Func AntiGame ()

EndFunc

Sleep (3600000)

The code is as follows:

; enhanced version, first determine whether the game is running, if it is the first time the game is run, then block the UP key after 20 minutes

In order not to affect the normal work, and at the same time cause the false appearance that the game keys are damaged

The up key is then intercepted as soon as the game is detected to be running, otherwise it is not intercepted, and the detection interval is 1 second.

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

This is the end of the content of "how to write a script to block up keys to prevent games from running". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Run test script code illusion content at the same time keystroke more knowledge first time work influence practicality achievement next dilemma reality situation article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information macOS Microsoft Shulou Technology