I am trying to create a quizbowl-esque game on the Discord chat service and am using AutoHotKey to quickly trigger the buzzer system. The game will be for a school project. I am using the following code:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Gui, +alwaysontop
Gui, Add, Button, gBuzzer1, Round #1: Buzz!
Gui, Add, Button, gBuzzer2, Round #2: Buzz!
Gui, Add, Button, gBuzzer3, Round #3: Buzz!
Gui, show
Return
Buzzer1:
{
Send, !{Esc} ; Changed from Alt+Tab
Sleep, 20
Send, ?buzz{Enter}
}
Return
Buzzer2:
{
Send, !{Esc} ; Changed from Alt+Tab
Sleep, 20
Send, {!}buzz{Enter}
}
Return
Buzzer3:
{
Send, !{Esc} ; Changed from Alt+Tab
Sleep, 20
Send, /buzz{Enter}
}
Return
Esc::ExitApp