Current location - Loan Platform Complete Network - Big data management - How to write an automatic keystroke source code in easy language
How to write an automatic keystroke source code in easy language

Components used: a label a clock

Description: ? This is to randomly press one of the buttons up, down, left, right or right every 0.1 seconds? If you want all of them to be pressed every 0.1 seconds, just remove the judgment from the clock cycle event

----------------------------------

. Version 2

. Support library shellEx

. Supported libraries eAPI

. Programs Window Programs 1

. Assembly variable F10, integer

. Assembly variable F11, integer

. Subroutine __Launch Window_Complete

F10 = Register Hotkey (_Launch Window. Fetch Window Handle (), Label 1.Fetch Window Handle (), 0, #F10 key)

F11 = Register Hotkey (_Launch Window. Fetch Window Handle (), Label 1.Fetch Window Handle (), 0, #F11 key)

. Subroutine _Label 1_Feedback Event, integer

. Parameters Parameter one, integer

. Parameters Parameter 2, integer

. Judgment start (parameter one = F10)

Clock 1. Judgment (Parameter one = F11)

Clock1.clock period = 0

. Default

. End of judgment

. Subroutine _clock1_cycle event

. Local variable a, integer

a = take random number (1, 5)

. Judgment start (a = 1)

Simulate keystrokes (#up cursor keys, , )

. Judgment (a = 2)

Analog keys (#Bottom cursor keys, , )

. Judgment (a = 3)

Analog keys (#Left cursor keys, , )

. Judgment (a = 4)

Analog keys (#Right cursor keys, , )

. Judgment (a = 5)

Analog keys (#spacebar, , )

. Default

----------------------------------------------