Skip to content

Instantly share code, notes, and snippets.

@chisui
Last active July 9, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chisui/0ebfed785554c200b957a72d84303569 to your computer and use it in GitHub Desktop.
Save chisui/0ebfed785554c200b957a72d84303569 to your computer and use it in GitHub Desktop.
Hipchat autohotkey loading bar
#SingleInstance force
^+l::
SetKeyDelay ,-1
Send /me is thinking 00`% [░░░░░░░░░░]
Sleep 2
Send {Enter}
sleep, 250
Loop, 100 {
Tail := % 11 - (A_Index / 10)
Head := % Ceil(A_Index / 10) - 1
NextTail := % 11 - ((A_Index + 1) / 10)
NextHead := % Ceil((A_Index + 1) / 10) - 1
Percent := % A_Index - 1
NextPercent := % Percent + 1
if (Percent < 10) {
Percent := % "0" . Percent
}
if (NextPercent < 10) {
NextPercent := % "0" . NextPercent
}
Send ,s/ %Percent%`% [
Loop, %Head% {
Send █
}
Loop, %Tail% {
Send ░
}
Send ]/ %NextPercent%`% [
Loop, %NextHead% {
Send █
}
Loop, %NextTail% {
Send ░
}
Send ]/
Sleep 2
Send {Enter}
sleep, 250
}
Send ,s/thinking 100`% [██████████]/done thinking: That's a bad idea/{Enter}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment