Skip to content

Instantly share code, notes, and snippets.

@ethaizone
Last active November 11, 2024 21:33
Show Gist options
  • Save ethaizone/0de8546e0f197d9e43943968e3772bc5 to your computer and use it in GitHub Desktop.
Save ethaizone/0de8546e0f197d9e43943968e3772bc5 to your computer and use it in GitHub Desktop.
Auto typer from file - Execute by autohotkey.com
; Auto typer from file
; Write by EThaiZone @ 2016
; For fake code typing. lol
; Press Ctrl+F11 to start/stop
; Press F11 to pause/resume
#MaxThreads 2
#MaxThreadsPerHotkey 2
PressKey := true
^F11::
if ! PressKey {
MsgBox, Exit
Reload
}
MsgBox, Start
; readfile
FileRead, Contents, code.txt
; parse per line
Loop, parse, Contents, `n, `r
{
while ! PressKey
{
Sleep, 1000
}
;If ! PressKey {
; Break ;If PressKey is False, stop pressing key
;}
; parse per character
Loop, parse, A_LoopField
{
while ! PressKey
{
Sleep, 1000
}
;If ! PressKey {
; Break ;If PressKey is False, stop pressing key
;}
; create random delay for typing
Random, rand, 80, 150
sleep, rand
;SetKeyDelay, rand
; send key
Send, %A_LoopField%
}
Random, rand, 80, 150
sleep, rand
; send enter because new line got strip from parser
Send, {Enter}
}
Return
F11::
PressKey := !PressKey
if PressKey
MsgBox, Resume
else
MsgBox, Pause
Return
@ethaizone
Copy link
Author

วิธีใช้ภาษาไทย

สำหรับคนอยากหลับ
โหลด autohotkey ติดตั้งซะ แล้วเอาโค้ดนี้ไปเซฟเป็นไฟล์นามสกุล ahk
จากนั้นสร้างไฟล์ code.txt ใส่โค้ดอะไรก็ได้ลงไป

สั่งเปิดไฟล์ ahk ด้วย autohotkey จากนั้นกด Ctrl+F11
โปรแกรมจะพิมพ์อัตโนมัติเหมือนคนพิมพ์ตามโค้ดที่มีอยู่ใน code.txt
สั่งหยุดด้วยการกด F11 อีกที

@ramoscarlos
Copy link

Awesome! Just what I needed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment