; ------------------------------ ; Roblox Virtual Piano Autoplayer ; Clean, Safe, Improved Version ; ------------------------------ #NoEnv #SingleInstance Force SetBatchLines, -1 SetTitleMatchMode, 2 global song := "", index := 1, delay := 100 ; ------------------ GUI ------------------ Gui, +AlwaysOnTop Gui, Add, Text,, 🎹 Roblox Piano Autoplayer (Improved) Gui, Add, Text,, Paste notes below (supports [chords] and spaces): Gui, Add, Edit, R10 w400 vsongEdit Gui, Add, Text,, [ - Start autoplay | ] - Reset | Esc - Stop Gui, Add, Text,, Delay (ms): Gui, Add, Edit, w50 vdelayEdit, 100 Gui, Show,, Roblox Piano Autoplayer return ; ------------- Start Playback on [ ------------- [:: Gui, Submit, NoHide ; Filter out brackets tempSong := songEdit StringReplace, tempSong, tempSong, `[, , All StringReplace, tempSong, tempSong, `], , All song := tempSong delay := delayEdit index := 1 SetTimer, PlayNote, 10 return ; ------------- Reset on ] ------------- ]:: SetTimer, PlayNote, Off index := 1 SoundBeep, 1000, 150 return ; ------------- Stop Playback on Esc ------------- :: SetTimer, PlayNote, Off SoundBeep, 800, 100 return ; ------------- Play Logic ------------- PlayNote: if (index > StrLen(song)) { SetTimer, PlayNote, Off SoundBeep, 600, 100 return } char := SubStr(song, index, 1) ; Chord detection: [asdf] if (char = "[") { endIndex := InStr(song, "]", false, index) if (endIndex > 0) { chord := SubStr(song, index + 1, endIndex - index - 1) SendRaw, %chord% index := endIndex + 1 } else { index++ ; malformed chord, skip } } else if (char = " " || char = "`n" || char = "`r" || char = "/") { index++ } else { SendRaw, %char% index++ } Sleep, delay return ; ------------- GUI Close ------------- GuiClose: ExitApp