Advertisement
Crimsxn_K1ra

New AutoHotkey Roblox Piano Autoplayer AHK Script (v1.1)

Sep 25th, 2024
33,933
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 1 0
  1. Gui, +AlwaysOnTop
  2. Gui, Add, Text,, ============Roblox Virtual Piano In-Game Styled Autoplayer (v 1.1)============
  3. Gui, Add, Text,, -----------------------------------------------PASTE SHEETS HERE------------------------------------------------
  4. Gui, Add, Edit, R10 w400 vPianoMusic
  5. Gui, Add, Text,, Press the - = [ ] keybinds to start autoplaying. you'll need to play by rhythm.
  6. Gui, Add, Text,, Click the "Reset" button after playing a song/changing a song. (IMPORTANT)
  7. Gui, Add, Text,, Based on the old AutoHotkey Virtual Piano Autoplayer (the one with F4 and F8)
  8. Gui, Add, Text,, This also works in Virtual Pianos outside of Roblox.
  9. Gui, Add, Text,, Modifications done by: Crimsxn K1ra
  10. Gui, Add, Text,, ------------------------------------------------------------Progress------------------------------------------------------------
  11. Gui, Add, Edit, ReadOnly w400 vNextNotes
  12. Gui, Add, Button, gResetProgress, Reset
  13. Gui, Show
  14.  
  15. PianoMusic := ""
  16. CurrentPos := 1
  17. DisplayPos := 1
  18. KeyPressStartTime := 0
  19. KeyDelay := 0.1
  20.  
  21. PlayNextNote()
  22. {
  23. global PianoMusic, CurrentPos, DisplayPos, KeyDelay, KeyPressStartTime
  24. Gui, Submit, Nohide
  25. DisplayMusic := PianoMusic
  26. PianoMusic := RegExReplace(PianoMusic, "`n|`r|/| ")
  27.  
  28. if (CurrentPos > StrLen(PianoMusic))
  29. {
  30. CurrentPos := 1
  31. DisplayPos := 1
  32. }
  33.  
  34. if (CurrentPos <= StrLen(PianoMusic) && A_TickCount - KeyPressStartTime < 3000)
  35. {
  36. if (RegExMatch(PianoMusic, "U)(\[.*]|.)", Keys, CurrentPos))
  37. {
  38. CurrentPos += StrLen(Keys)
  39.  
  40. while (DisplayPos <= StrLen(DisplayMusic) && InStr(" `n`r/", SubStr(DisplayMusic, DisplayPos, 1)))
  41. DisplayPos++
  42.  
  43. DisplayPos += StrLen(Keys)
  44.  
  45. Keys := Trim(Keys, "[]")
  46. SendInput, {Raw}%Keys%
  47.  
  48. NextNotes := SubStr(DisplayMusic, DisplayPos, 90)
  49. GuiControl,, NextNotes, %NextNotes%
  50.  
  51. Sleep, %KeyDelay%
  52. }
  53. }
  54. }
  55.  
  56. -::
  57. =::
  58. [::
  59. ]::
  60. KeyPressStartTime := A_TickCount
  61. PlayNextNote()
  62. KeyPressStartTime := 0
  63. return
  64.  
  65. GuiClose:
  66. ExitApp
  67.  
  68. ResetProgress:
  69. CurrentPos := 1
  70. DisplayPos := 1
  71. GuiControl,, NextNotes
  72. return
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement