Skip to content

Instantly share code, notes, and snippets.

View peterthehan's full-sized avatar
🅱️

Peter Han peterthehan

🅱️
View GitHub Profile
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#IfWinActive, ahk_exe chrome.exe
~LButton Up::
Send, {Home}
Return
#IfWinActive
@peterthehan
peterthehan / ClipboardToFile.ahk
Last active November 13, 2022 21:42
Paste into Explorer to save your clipboard as a webp, jpeg, png, or txt file.
#NoEnv
#SingleInstance, Force
SetWorkingDir %A_ScriptDir%
return
getActiveExplorerPath()
{
; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=69925
explorerHwnd := WinActive("ahk_class CabinetWClass")
@peterthehan
peterthehan / Scheduler.ahk
Last active March 20, 2022 04:43
Automate a part of tweet scheduling using the Twitter UI.
#NoEnv
#SingleInstance, Force
; date
month := 5
dayStart := 1
dayEnd := 31
; time
hours := [9, 4]
@peterthehan
peterthehan / slide.ahk
Created March 17, 2021 00:52
Warframe slide attack.
#NoEnv
#SingleInstance, Force
; In milliseconds
SEND_BASE_DURATION := 50
SEND_RANDOM_DURATION := 25
LOOP_BASE_DURATION := 100
LOOP_RANDOM_DURATION := 50
; https://www.autohotkey.com/docs/KeyList.htm
@peterthehan
peterthehan / discord-batch-emoji-downloader.js
Last active March 20, 2022 04:43
Batch download emojis from any Discord server.
// 0. Open Discord's web client
// 1. Visit the server whose emojis you want
// 2. Open the emoji picker UI and keep it open
// 3. Minimize the page's zoom so that as many emojis load into the picker as possible
// 4. Open the browser's DevTools (press F12) > Elements tab
// 5. Search for the class "categorySection" e.g. <div class="categorySection-...">
// 6. Find the section that highlights the emojis you want when hovering over the element
// 7. Right click the element and Copy > Copy Element
// 8. Paste the element into a file "file.txt"
// 9. Run this script at the same location as "file.txt" to download all the emojis.
@peterthehan
peterthehan / AntiIdle.ahk
Created September 22, 2020 23:57
Prevent idling by displacing the mouse cursor.
#NoEnv
#Persistent
#SingleInstance, Force
SetTimer, MoveMouse, 10000
Return
MoveMouse:
If (A_TimeIdle > 60000) {
MouseMove, 1, 1,, R
@peterthehan
peterthehan / Shitpost2000.ahk
Last active March 20, 2022 04:44
Convenience script to copy-paste images between Chrome and Discord.
#NoEnv
#SingleInstance, Force
delay := 200
return
#IfWinActive, ahk_exe chrome.exe
~RButton::
Sleep, % delay
Send, y ; https://www.reddit.com/r/chrome/comments/aig340/chromes_hidden_context_menu_shortcuts/
return
@peterthehan
peterthehan / creator.ahk
Created August 12, 2020 04:58
Ragnarok Online macro for the Creator class.
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
!`::Suspend
!r::Reload
Spam(keyStroke, delay){
while GetKeyState(keyStroke, "P"){
Random, rand, 10, 20
Send %keyStroke%
Sleep rand