diff --git a/.github/README.md b/.github/README.md index 7766d40..5a65078 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,35 +1,180 @@ -### Collection of Scripts, that may be useful in automating daily tasks, or just assist you otherwise. Autohotkey is required for every script. +# Scripts - Windows Gaming & Automation Toolkit -![GitHub Release](https://img.shields.io/github/v/release/Ven0m0/Scripts?label=Current%20Release) -![GitHub Downloads](https://img.shields.io/github/downloads/Ven0m0/Scripts/total?logo=github&label=GitHub%20Downloads) -![Commit activity](https://img.shields.io/github/last-commit/Ven0m0/Scripts?logo=github) +> **Comprehensive AutoHotkey automation suite for Windows gaming, emulation, and productivity** - - AHK - +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![GitHub Release](https://img.shields.io/github/v/release/Ven0m0/Scripts?label=Current%20Release)](https://github.com/Ven0m0/Scripts/releases) +[![GitHub Downloads](https://img.shields.io/github/downloads/Ven0m0/Scripts/total?logo=github&label=GitHub%20Downloads)](https://github.com/Ven0m0/Scripts/releases) +[![Commit activity](https://img.shields.io/github/last-commit/Ven0m0/Scripts?logo=github)](https://github.com/Ven0m0/Scripts/commits) + +--- + +## Quick Links + +- **[Main README](../README.md)** - Full project documentation +- **[CONTRIBUTING.md](../CONTRIBUTING.md)** - How to contribute +- **[CHANGELOG.md](../CHANGELOG.md)** - Version history +- **[CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md)** - Community guidelines + +--- + +## Featured Tools + +### 🎮 Gaming & Emulation -### [Youtube and Spotify downloader:](Other/Downloader) +#### [YouTube & Spotify Downloader](../Other/Downloader/) - - Windows10 + + Downloader GUI -### [Citra mod manager:](Other/Citra_mods) +GUI-based media downloaders for YouTube videos/audio and Spotify playlists/tracks. - - +**Features:** +- Download videos or extract audio from YouTube +- Download songs from Spotify playlists +- Quality selection and format conversion +- User-friendly GUI interface + +[View Documentation →](../Other/Downloader/README.md) + +--- + +#### [Citra Mod Manager](../Other/Citra_mods/) + + + Citra Mod Manager -### [Playnite auto Fullscreen](Other/Playnite_fullscreen) +GUI for managing mods and HD texture packs for Citra 3DS emulator. + +**Features:** +- Enable/disable mods per game +- HD texture pack management +- CSV-based game database +- Per-game settings + +[View Documentation →](../Other/Citra_mods/README.md) + +--- + +### 🖥️ Window Management + +#### [Borderless Fullscreen](../AHK_v2/Fullscreen.ahk) + +Toggle borderless fullscreen on any window with multi-monitor support. + +**Features:** +- Multi-monitor aware +- Saves and restores window state +- Works with games lacking native borderless mode + +--- + +#### [Auto-Fullscreen Manager](../Other/AutoStartManager.ahk) + +Unified data-driven auto-fullscreen launcher for all major emulators. + +**Supported Emulators:** +- Citra, Yuzu, Ryujinx +- RPCS4, PCSX2 +- Dolphin, Cemu +- And 10+ more! + +--- + +### 🛠️ System Utilities + +#### [Power Plan Automation](../AHK_v2/Powerplan.ahk) + +Automatically switch Windows power plan based on running applications. + +#### [Controller Quit](../AHK_v2/ControllerQuit.ahk) + +Close applications using gamepad button combinations. + +#### [GUI Launchers](../AHK_v2/GUI/) + +Centralized script launchers with graphical interface for easy management. + +--- + +## Additional Tools + +### [Playnite Auto-Fullscreen](../Other/Playnite_fullscreen_v2/) + +Multi-monitor setup automation for Playnite with boot videos. + +### [Citra Per-Game Config](../Other/Citra_per_game_config/) + +Automatically apply per-game configuration settings to Citra emulator. + +### [7zEmuPrepper](../Other/7zEmuPrepper/) + +On-the-fly game decompression for emulation front-ends. + +### [Robocopy Utilities](../Other/Robocopy/) + +Batch script wrappers for Windows Robocopy with extension filtering. + +--- + +## Project Statistics + +- **61+ AutoHotkey scripts** (v1 and v2) +- **45+ scripts migrated** to AutoHotkey v2 +- **15+ emulators supported** for auto-fullscreen +- **Dual library architecture** for v1/v2 compatibility +- **MIT Licensed** - Free and open source + +--- + +## Quick Start + +1. **Install AutoHotkey** + - [AutoHotkey v2.0.19+](https://www.autohotkey.com/) for modern scripts + - [AutoHotkey v1.1.37.02+](https://www.autohotkey.com/download/) for legacy scripts + +2. **Clone the repository** + ```bash + git clone https://github.com/Ven0m0/Scripts.git + cd Scripts + ``` + +3. **Run any script** + - Double-click `.ahk` files + - Or run from command line: `autohotkey script.ahk` + +--- + +## Documentation + +- **[README.md](../README.md)** - Main project documentation +- **[CLAUDE.md](../CLAUDE.md)** - Comprehensive developer guide (1700+ lines) +- **[EXAMPLES.md](../EXAMPLES.md)** - Common usage patterns and examples +- **[CONTRIBUTING.md](../CONTRIBUTING.md)** - Contribution guidelines +- **[CHANGELOG.md](../CHANGELOG.md)** - Version history + +--- + +## CI/CD & Workflows + +This directory contains GitHub Actions workflows for: + +- **Code Quality** - Syntax validation and formatting checks +- **Automated Builds** - Compilation of .exe releases +- **Version Detection** - Automatic v1/v2 script detection -### [Citra per game auto config](Other/Citra_per_game_config) +See [workflows/](workflows/) for workflow definitions. -### Fake Fullscreen: +--- -Simple scripts to set the current window to fullscreen, similar to fullscreen borderless +## Support -[Fullscreen](AHK/Fullscreen.ahk) +- **Issues:** [GitHub Issues](https://github.com/Ven0m0/Scripts/issues) +- **Email:** ven0m0.wastaken@gmail.com +- **License:** MIT -[Fullscreen Single Key](AHK/Fullscreen_single.ahk) +--- -[Fullscreen Double Key](AHK/Fullscreen_double.ahk) +**⭐ Star this repository if you find it useful!** diff --git a/AHK_v2/Black_ops_6/README.md b/AHK_v2/Black_ops_6/README.md new file mode 100644 index 0000000..27f0609 --- /dev/null +++ b/AHK_v2/Black_ops_6/README.md @@ -0,0 +1,352 @@ +# Black Ops 6 AFK Macros + +This directory contains AutoHotkey v2 AFK (Away From Keyboard) macros for Call of Duty: Black Ops 6. These scripts automate repetitive actions for XP farming, camo grinding, and other in-game tasks. + +## Scripts + +### bo6-afk.ahk + +**Purpose:** Main AFK macro for Black Ops 6 + +**Features:** +- Automated movement and actions +- Customizable timing patterns +- Pause/resume functionality +- Emergency stop hotkey +- Works in Zombies and multiplayer modes + +**Hotkeys:** +- `F7` - Start macro +- `F8` - Pause/Resume +- `F9` - Emergency stop (exits script) + +**Usage:** +```bash +# 1. Start Black Ops 6 +# 2. Enter a game mode (Zombies, Multiplayer, etc.) +# 3. Run the macro +bo6-afk.ahk + +# 4. Press F7 to start the macro +# 5. Press F8 to pause if needed +# 6. Press F9 to stop completely +``` + +**Configuration:** +The script includes customizable timing and actions. Edit the script to adjust: + +```autohotkey +; Adjust timing (in milliseconds) +actionDelay := 1000 ; Time between actions +moveDelay := 500 ; Time for movement inputs + +; Adjust actions +; Modify the Loop section to change what keys are pressed +``` + +## ⚠️ Important Warnings + +### Game Terms of Service + +**Use at your own risk!** Using automation macros may violate the game's Terms of Service and could result in: + +- Temporary suspension +- Permanent ban +- Loss of progress +- Account termination + +**We do not condone violating game ToS.** These scripts are provided for educational purposes and single-player/private use only. + +### Anti-Cheat Detection + +Call of Duty games have anti-cheat systems that may detect: + +- Repeated patterns +- Inhuman timing +- Macro software + +**Recommendations:** +- Only use in private/offline modes +- Add randomization to timing +- Don't run for extended periods +- Monitor your session + +## Safety Features + +### Built-in Safeguards + +1. **Emergency Stop** - F9 immediately terminates the script +2. **Pause Function** - F8 allows you to pause without stopping +3. **Window Detection** - Script only runs when game is active (optional) + +### Adding Window Detection + +To make the macro only work when Black Ops 6 is active: + +```autohotkey +; Add at top of script +#HotIf WinActive("ahk_exe cod.exe") ; Replace with actual exe name + +; Your hotkeys here +F7::StartMacro() +F8::Pause + +#HotIf ; End context + +; Now hotkeys only work when game is focused +``` + +## Customization Guide + +### Modifying Actions + +**Example: Change movement pattern** + +```autohotkey +; Original +Loop { + Send("{w down}") + Sleep(500) + Send("{w up}") + Sleep(1000) +} + +; Modified: Circle movement +Loop { + Send("{w down}{a down}") + Sleep(500) + Send("{w up}{a up}") + Sleep(100) + Send("{w down}{d down}") + Sleep(500) + Send("{w up}{d up}") + Sleep(100) +} +``` + +### Adding Randomization + +**Prevent detection with random timing:** + +```autohotkey +; Add Random function helper +RandomDelay(min, max) { + return Random(min, max) +} + +; Use in loop +Loop { + Send("{Space}") + Sleep(RandomDelay(900, 1100)) ; Random delay between 900-1100ms + Send("{Mouse1}") + Sleep(RandomDelay(450, 550)) +} +``` + +### Adding Mouse Movement + +```autohotkey +; Random mouse movement +Loop { + MouseMove(RandomDelay(-50, 50), RandomDelay(-50, 50), 0, "R") + Sleep(1000) +} +``` + +## Use Cases + +### 1. Zombies AFK + +**Purpose:** Farm XP in Zombies mode + +**Setup:** +1. Find a safe corner or camping spot +2. Set up equipment/defenses +3. Run macro with continuous shooting + +**Macro pattern:** +```autohotkey +Loop { + Send("{Mouse1 down}") ; Hold fire + Sleep(2000) + Send("{Mouse1 up}") + Sleep(500) + Send("{r}") ; Reload + Sleep(2000) +} +``` + +### 2. Multiplayer Movement + +**Purpose:** Avoid AFK kick in multiplayer + +**Macro pattern:** +```autohotkey +Loop { + Send("{w down}") + Sleep(500) + Send("{w up}") + Sleep(500) + Send("{s down}") + Sleep(500) + Send("{s up}") + Sleep(5000) ; Wait between movements +} +``` + +### 3. Camo Grinding + +**Purpose:** Automate repetitive actions for camo challenges + +**Macro pattern:** +```autohotkey +Loop { + Send("{Mouse1}") ; Fire + Sleep(100) + Send("{Mouse2}") ; Aim + Sleep(300) + Send("{r}") ; Reload + Sleep(2000) +} +``` + +## Troubleshooting + +### Issue: Macro doesn't work in game + +**Possible causes:** +1. Game has focus protection +2. Running without admin privileges +3. Anti-cheat blocking + +**Solutions:** +```ahk +; 1. Add admin requirement +#Include A_ScriptDir "\..\..\Lib\v2\AHK_Common.ahk" +InitScript(false, true) ; Require admin + +; 2. Use DirectInput instead +Send("{w down}") ; Try this +SendEvent("{w down}") ; Or this +``` + +### Issue: Actions are too fast/slow + +**Solution:** Adjust Sleep times + +```autohotkey +; Slow down +Sleep(2000) ; Increase value + +; Speed up +Sleep(500) ; Decrease value + +; Find the sweet spot for your game +``` + +### Issue: Character gets stuck + +**Solution:** Add unstuck routine + +```autohotkey +; Add to main loop +Loop { + ; Normal actions + Send("{w down}") + Sleep(1000) + Send("{w up}") + + ; Unstuck every 30 seconds + if (Mod(A_Index, 30) == 0) { + Send("{Space}") ; Jump + Sleep(200) + Send("{s down}") ; Move back + Sleep(500) + Send("{s up}") + } +} +``` + +## Advanced Features + +### Progress Tracking + +**Track how long the macro has been running:** + +```autohotkey +global startTime := 0 +global totalRuns := 0 + +F7:: { + global startTime, totalRuns + startTime := A_TickCount + totalRuns := 0 + + Loop { + ; Your actions here + totalRuns++ + + ; Show progress every 100 iterations + if (Mod(totalRuns, 100) == 0) { + elapsed := (A_TickCount - startTime) / 1000 / 60 ; Minutes + ToolTip("Running: " Round(elapsed, 1) " min | Cycles: " totalRuns) + } + } +} +``` + +### Auto-Stop After Time + +**Stop macro after X minutes:** + +```autohotkey +F7:: { + startTime := A_TickCount + maxMinutes := 60 ; Run for 60 minutes + + Loop { + ; Your actions here + + ; Check elapsed time + elapsed := (A_TickCount - startTime) / 1000 / 60 + if (elapsed >= maxMinutes) { + MsgBox("Macro complete! Ran for " maxMinutes " minutes") + ExitApp + } + } +} +``` + +## Best Practices + +1. **Start small** - Test macro for 5 minutes before long sessions +2. **Add breaks** - Include pauses every 10-15 minutes +3. **Randomize** - Add random delays to avoid patterns +4. **Monitor** - Check game periodically +5. **Respect ToS** - Only use in appropriate game modes +6. **Stay safe** - Don't violate game rules + +## Resources + +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) +- [Send Function](https://www.autohotkey.com/docs/v2/lib/Send.htm) +- [Mouse Commands](https://www.autohotkey.com/docs/v2/lib/Click.htm) +- [CLAUDE.md](../../CLAUDE.md) - Developer guide + +## Contributing + +When modifying or adding macros: + +1. Test thoroughly in private/offline modes +2. Add comments explaining timing and actions +3. Include setup instructions +4. Warn about ToS implications +5. Add randomization where possible + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for detailed guidelines. + +--- + +**Disclaimer:** Use these scripts responsibly and at your own risk. The authors are not responsible for any consequences of using these macros, including but not limited to account suspensions or bans. + +**Last Updated:** 2025-12-26 diff --git a/AHK_v2/GUI/README.md b/AHK_v2/GUI/README.md new file mode 100644 index 0000000..6c4dc36 --- /dev/null +++ b/AHK_v2/GUI/README.md @@ -0,0 +1,402 @@ +# GUI - Script Launcher Applications + +This directory contains graphical user interface (GUI) launchers for managing and running multiple AutoHotkey scripts from a centralized location. + +## Scripts + +### GUI.ahk + +**Purpose:** Main script launcher with tabbed interface + +**Features:** +- Tabbed interface for organizing scripts +- Quick launch buttons for common scripts +- Process monitoring (shows if scripts are running) +- Kill script functionality +- System tray integration + +**Usage:** +```bash +# Run the launcher +GUI.ahk + +# Click buttons to start/stop scripts +# Right-click tray icon for quick access +``` + +**Customization:** +```autohotkey +; Add your own buttons to the GUI +; Edit the tabs and button definitions in the script +``` + +--- + +### WM.ahk + +**Purpose:** Window Management GUI controls + +**Features:** +- Visual controls for window operations +- Borderless fullscreen toggle +- Window positioning presets +- Always-on-top toggle +- Monitor configuration display + +**Usage:** +```bash +# Run the window manager +WM.ahk + +# Use GUI buttons for window operations +# Select target window or use "Active Window" +``` + +**Functions:** +- Toggle borderless fullscreen +- Snap windows to screen edges +- Set windows always on top +- Monitor management + +--- + +### GUI_Shared.ahk + +**Purpose:** Shared framework and utilities for GUI scripts + +**Description:** +This is a library file that provides common functionality for GUI applications. It is not meant to be run directly. + +**Contains:** +- Shared GUI styling functions +- Common button handlers +- Process management utilities +- Configuration loading/saving + +**Usage:** +```autohotkey +; Include in other GUI scripts +#Include A_ScriptDir "\GUI_Shared.ahk" + +; Use shared functions +CreateStyledButton("Launch", LaunchHandler) +``` + +--- + +## Common Features + +### All GUI Scripts Include: + +1. **Modern GUI Design** + - Clean, organized layout + - Consistent styling + - Responsive controls + +2. **Process Management** + - Track running scripts by PID + - Show running status + - Proper cleanup on exit + +3. **Error Handling** + - User-friendly error messages + - Validation of inputs + - Graceful failure handling + +4. **System Tray Integration** + - Minimize to tray + - Tray menu for quick access + - Status indicators + +## Customization Guide + +### Adding Custom Buttons + +**Example: Add a new script button to GUI.ahk** + +```autohotkey +; 1. Define your script path +myScriptPath := A_ScriptDir "\..\Other\MyScript.ahk" + +; 2. Add button to GUI +myGui.Add("Button", "w200", "Launch My Script").OnEvent("Click", LaunchMyScript) + +; 3. Add launch handler +LaunchMyScript(*) { + global myScriptPID + if WinExist("ahk_pid " myScriptPID) { + MsgBox("My Script is already running!") + return + } + Run(myScriptPath, , , &myScriptPID) +} + +; 4. Add close button if needed +myGui.Add("Button", "w200", "Close My Script").OnEvent("Click", CloseMyScript) + +CloseMyScript(*) { + global myScriptPID + if WinExist("ahk_pid " myScriptPID) { + WinClose("ahk_pid " myScriptPID) + myScriptPID := 0 + } +} +``` + +### Creating Custom Tabs + +```autohotkey +; Add a new tab category +myGui.Add("Tab3", "w600", ["Gaming", "Utilities", "Custom"]) + +; Select the new tab +myGui["Tab"].Choose(3) + +; Add controls to the custom tab +myGui.Add("Text", , "Custom Scripts") +myGui.Add("Button", "w200", "Custom Action").OnEvent("Click", CustomHandler) + +CustomHandler(*) { + MsgBox("Custom button clicked!") +} +``` + +### Changing GUI Appearance + +```autohotkey +; Modify GUI properties +myGui := Gui("+AlwaysOnTop -MinimizeBox", "My Launcher") +myGui.BackColor := "0x2B2B2B" ; Dark background +myGui.SetFont("s10 cWhite", "Segoe UI") + +; Custom button styling +myButton := myGui.Add("Button", "w200 h40") +myButton.SetFont("s11 bold", "Arial") +``` + +## Development + +### Creating a New GUI Launcher + +**Template:** + +```autohotkey +; ============================================================================= +; Custom GUI Launcher +; ============================================================================= + +#Requires AutoHotkey v2.0 +#SingleInstance Force +SendMode "Input" +SetWorkingDir A_ScriptDir + +#Include A_ScriptDir "\GUI_Shared.ahk" ; Optional: use shared functions +#Include A_ScriptDir "\..\..\Lib\v2\AHK_Common.ahk" + +InitScript(false, false) + +; Global variables for process tracking +global scriptPID := 0 + +; Create GUI +myGui := Gui("+AlwaysOnTop", "My Launcher") +myGui.OnEvent("Close", GuiClose) + +; Add controls +myGui.Add("Text", , "Select an action:") +myGui.Add("Button", "w200", "Launch Script").OnEvent("Click", LaunchScript) +myGui.Add("Button", "w200", "Close Script").OnEvent("Click", CloseScript) +myGui.Add("Button", "w200", "Exit Launcher").OnEvent("Click", GuiClose) + +; Show GUI +myGui.Show() +return + +; Event handlers +LaunchScript(*) { + global scriptPID + scriptPath := A_ScriptDir "\..\MyScript.ahk" + + if WinExist("ahk_pid " scriptPID) { + MsgBox("Script already running!") + return + } + + try { + Run(scriptPath, , , &scriptPID) + MsgBox("Script launched!") + } catch as e { + MsgBox("Failed to launch: " e.Message) + } +} + +CloseScript(*) { + global scriptPID + if WinExist("ahk_pid " scriptPID) { + WinClose("ahk_pid " scriptPID) + scriptPID := 0 + MsgBox("Script closed!") + } else { + MsgBox("Script is not running!") + } +} + +GuiClose(*) { + ExitApp +} +``` + +### Best Practices + +1. **Track PIDs:** Always store process IDs for launched scripts +2. **Check if running:** Verify script isn't already running before launching +3. **Proper cleanup:** Close launched scripts when GUI exits +4. **Error handling:** Use try/catch for file operations +5. **User feedback:** Provide clear status messages +6. **Consistent styling:** Follow existing GUI design patterns + +### Testing + +**Test checklist:** +- [ ] All buttons launch correct scripts +- [ ] Scripts don't launch multiple times +- [ ] Close buttons properly terminate scripts +- [ ] GUI closes cleanly (no orphaned processes) +- [ ] Error messages are clear and helpful +- [ ] GUI appearance is consistent +- [ ] Works with and without admin privileges + +## Troubleshooting + +### Issue: Script won't launch from GUI + +**Possible causes:** +1. Incorrect script path +2. Script doesn't exist +3. Missing AutoHotkey installation +4. Insufficient permissions + +**Solutions:** +```autohotkey +; Debug script path +MsgBox("Script path: " scriptPath) +MsgBox("File exists: " FileExist(scriptPath)) + +; Use absolute paths +scriptPath := A_ScriptDir "\..\MyScript.ahk" + +; Check for errors +try { + Run(scriptPath, , , &scriptPID) +} catch as e { + MsgBox("Error: " e.Message "`nFile: " e.File "`nLine: " e.Line) +} +``` + +### Issue: Multiple instances launching + +**Problem:** Script launches multiple times when button clicked repeatedly + +**Solution:** +```autohotkey +; Check if already running +if WinExist("ahk_pid " scriptPID) { + MsgBox("Already running!") + return +} + +; Alternative: Disable button while launching +myButton.Enabled := false +Run(scriptPath, , , &scriptPID) +Sleep(500) +myButton.Enabled := true +``` + +### Issue: GUI doesn't close scripts + +**Problem:** Scripts keep running after GUI closes + +**Solution:** +```autohotkey +; Add cleanup in OnEvent("Close") +GuiClose(*) { + ; Close all tracked processes + if WinExist("ahk_pid " script1PID) + WinClose("ahk_pid " script1PID) + if WinExist("ahk_pid " script2PID) + WinClose("ahk_pid " script2PID) + + ExitApp +} +``` + +## Examples + +### Example 1: Simple Script Launcher + +```autohotkey +#Requires AutoHotkey v2.0 +#SingleInstance Force + +global pid := 0 + +myGui := Gui(, "Simple Launcher") +myGui.Add("Button", "w200", "Start Script").OnEvent("Click", (*) => Run("script.ahk", , , &pid)) +myGui.Add("Button", "w200", "Stop Script").OnEvent("Click", (*) => WinClose("ahk_pid " pid)) +myGui.Show() +``` + +### Example 2: Status Display + +```autohotkey +#Requires AutoHotkey v2.0 +#SingleInstance Force + +global pid := 0 +global statusText := "" + +myGui := Gui(, "Status Launcher") +statusText := myGui.Add("Text", "w200", "Status: Not running") +myGui.Add("Button", "w200", "Launch").OnEvent("Click", Launch) + +; Update status periodically +SetTimer(UpdateStatus, 1000) + +Launch(*) { + global pid + Run("script.ahk", , , &pid) +} + +UpdateStatus() { + global statusText, pid + if WinExist("ahk_pid " pid) + statusText.Value := "Status: Running (PID: " pid ")" + else + statusText.Value := "Status: Not running" +} + +myGui.Show() +``` + +## Resources + +- [AutoHotkey v2 GUI Documentation](https://www.autohotkey.com/docs/v2/lib/Gui.htm) +- [AHK_v2/README.md](../README.md) - Parent directory documentation +- [CLAUDE.md](../../CLAUDE.md) - Developer guide + +## Contributing + +When adding new GUI scripts: + +1. Follow the established design patterns +2. Use consistent button sizes and spacing +3. Include proper error handling +4. Test all button functions +5. Document hotkeys and features +6. Update this README + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for detailed guidelines. + +--- + +**Last Updated:** 2025-12-26 diff --git a/AHK_v2/Minecraft/README.md b/AHK_v2/Minecraft/README.md new file mode 100644 index 0000000..4dc5b9e --- /dev/null +++ b/AHK_v2/Minecraft/README.md @@ -0,0 +1,463 @@ +# Minecraft AFK Macros + +This directory contains AutoHotkey v2 AFK (Away From Keyboard) macros for Minecraft. These scripts automate repetitive tasks like fishing, farming, and mob grinding. + +## Scripts + +### MC_AFK.ahk + +**Purpose:** General-purpose AFK macro for Minecraft Java Edition + +**Features:** +- AFK fishing automation +- Auto-farming (crops, melons, etc.) +- Mob grinder automation +- Customizable timing +- Pause/resume functionality + +**Hotkeys:** +- `F7` - Start macro +- `F8` - Pause/Resume +- `F9` - Emergency stop (exits script) + +**Usage:** +```bash +# 1. Start Minecraft +# 2. Set up your AFK farm/fishing spot +# 3. Position your character correctly +# 4. Run the macro +MC_AFK.ahk + +# 5. Press F7 to start +# 6. Press F8 to pause +# 7. Press F9 to stop +``` + +--- + +### MC_Bedrock.ahk + +**Purpose:** Minecraft Bedrock Edition specific macro + +**Features:** +- Optimized for Bedrock Edition controls +- Touch-friendly input timing +- Bedrock-specific mechanics support +- Console/Windows 10 compatible + +**Usage:** +Same as MC_AFK.ahk but optimized for Bedrock Edition + +--- + +## Common Use Cases + +### 1. AFK Fishing + +**Purpose:** Automatically fish while AFK + +**Setup:** +1. Make an AFK fishing farm (search YouTube for designs) +2. Stand in the correct position +3. Hold fishing rod +4. Run macro + +**Macro pattern:** +```autohotkey +Loop { + Send("{Mouse2}") ; Cast fishing rod + Sleep(RandomDelay(1000, 2000)) ; Wait for bite + + ; Detect bite (pixel color check or timer) + Sleep(RandomDelay(500, 1000)) + + Send("{Mouse2}") ; Reel in + Sleep(500) +} + +RandomDelay(min, max) { + return Random(min, max) +} +``` + +**Tips:** +- Use note blocks or redstone to detect bites +- Add randomization to avoid detection +- Monitor inventory space + +--- + +### 2. Auto-Farming + +**Purpose:** Harvest and replant crops automatically + +**Setup:** +1. Create rows of crops (wheat, carrots, potatoes) +2. Position at start of first row +3. Run macro + +**Macro pattern:** +```autohotkey +Loop { + ; Move forward + Send("{w down}") + Sleep(500) + Send("{w up}") + + ; Break and replant + Send("{Mouse1}") ; Break + Sleep(100) + Send("{Mouse2}") ; Plant + Sleep(500) + + ; Turn at end of row + if (Mod(A_Index, 10) == 0) { + Send("{d down}") + Sleep(200) + Send("{d up}") + } +} +``` + +--- + +### 3. Mob Grinder + +**Purpose:** Collect items from mob grinder + +**Setup:** +1. Build mob grinder with collection point +2. Stand at collection point +3. Run macro + +**Macro pattern:** +```autohotkey +Loop { + Send("{Mouse1}") ; Attack + Sleep(500) + + ; Collect items periodically + if (Mod(A_Index, 20) == 0) { + Send("{e}") ; Open inventory + Sleep(500) + ; Sort items here if needed + Send("{Escape}") ; Close inventory + } +} +``` + +--- + +### 4. Auto-Clicker + +**Purpose:** Hold down a button/action + +**Macro pattern:** +```autohotkey +F7:: { + Loop { + Send("{Mouse1}") ; Left click + Sleep(50) ; Very fast clicking + } +} +``` + +--- + +## Advanced Features + +### Smart AFK Fishing + +**Detects when fish bites using pixel color:** + +```autohotkey +F7:: { + ; Get reference color of bobber float + MouseGetPos(&x, &y) + baseColor := PixelGetColor(x, y) + + Loop { + Send("{Mouse2}") ; Cast + Sleep(500) + + ; Wait for color change (bite) + Loop { + currentColor := PixelGetColor(x, y) + if (currentColor != baseColor) { + Sleep(100) + Send("{Mouse2}") ; Reel in + break + } + Sleep(100) + + ; Timeout after 30 seconds + if (A_Index > 300) { + Send("{Mouse2}") ; Recast + break + } + } + + Sleep(2000) + } +} +``` + +### Auto-Breeding Animals + +**Automatically breed animals:** + +```autohotkey +F7:: { + Loop { + ; Hold wheat/carrots + Send("{1}") ; Switch to hotbar slot 1 + Sleep(500) + + ; Right-click animals + Loop 5 { + Send("{Mouse2}") + Sleep(100) + MouseMove(50, 0, 10, "R") ; Move mouse to next animal + } + + ; Wait for breeding cooldown + Sleep(5 * 60 * 1000) ; 5 minutes + } +} +``` + +### Elytra Auto-Boost + +**Automatically use firework rockets while flying:** + +```autohotkey +; Hold this key while flying +$Space:: { + Send("{Space}") + if GetKeyState("Space", "P") { + Sleep(1000) + Send("{Mouse2}") ; Use firework + } +} +``` + +## Customization Guide + +### Adjusting Timing + +**For different computers/servers:** + +```autohotkey +; Variables for timing +global actionDelay := 1000 ; Milliseconds between actions +global moveDelay := 500 ; Movement duration +global waitDelay := 2000 ; Wait between cycles + +; Use in script +Sleep(actionDelay) +``` + +### Adding Anti-AFK Movement + +**Prevent being kicked for AFK:** + +```autohotkey +F7:: { + Loop { + ; Main actions here + Send("{Mouse1}") + Sleep(1000) + + ; Anti-AFK movement every 60 seconds + if (Mod(A_Index, 60) == 0) { + Send("{w down}") + Sleep(100) + Send("{w up}") + Sleep(100) + Send("{a down}") + Sleep(100) + Send("{a up}") + } + } +} +``` + +### Inventory Management + +**Auto-sort or drop items:** + +```autohotkey +; Drop unwanted items +DropJunk() { + Send("{e}") ; Open inventory + Sleep(500) + + ; Drop items from specific slots + Loop 9 { + Send("{" A_Index "}") ; Select slot + Sleep(50) + Send("{q}") ; Drop item + Sleep(50) + } + + Send("{Escape}") ; Close inventory +} + +; Call periodically +if (Mod(A_Index, 100) == 0) { + DropJunk() +} +``` + +## Safety Features + +### Server-Friendly Settings + +**Avoid getting kicked or banned:** + +1. **Add randomization** to all timing +2. **Include breaks** every 30-60 minutes +3. **Monitor chat** for admin messages +4. **Check inventory** to prevent overflow +5. **Test in single-player** first + +### Example: Safe Fishing Macro + +```autohotkey +F7:: { + startTime := A_TickCount + cycleCount := 0 + + Loop { + ; Random delay between casts + Send("{Mouse2}") + Sleep(RandomDelay(1000, 3000)) + + ; Wait for bite (randomized) + Sleep(RandomDelay(10000, 20000)) + + ; Reel in + Send("{Mouse2}") + Sleep(RandomDelay(500, 1000)) + + cycleCount++ + + ; Take break every 30 minutes + elapsed := (A_TickCount - startTime) / 1000 / 60 + if (elapsed > 30 and Mod(cycleCount, 100) == 0) { + TakeBreak() + startTime := A_TickCount + } + } +} + +TakeBreak() { + MsgBox("Taking a 5-minute break...", , "T300") + Sleep(5 * 60 * 1000) +} + +RandomDelay(min, max) { + return Random(min, max) +} +``` + +## Troubleshooting + +### Issue: Macro stops working + +**Possible causes:** +1. Minecraft lost focus +2. Inventory full +3. Died or respawned +4. Server lag + +**Solutions:** +```ahk +; Add window detection +#HotIf WinActive("ahk_exe javaw.exe") ; Java Edition +; or +#HotIf WinActive("ahk_exe Minecraft.Windows.exe") ; Bedrock + +; Add inventory check +CheckInventory() { + Send("{e}") + Sleep(500) + ; Check if inventory is full (implementation depends on method) + Send("{Escape}") +} +``` + +### Issue: Character moves incorrectly + +**Solution:** Adjust movement timing + +```ahk +; Increase delays for laggy servers +Send("{w down}") +Sleep(1000) ; Increase from 500 +Send("{w up}") +``` + +### Issue: Actions are detected as cheating + +**Solution:** Add more randomization + +```ahk +; More natural timing +RandomDelay(min, max) { + return Random(min, max) +} + +Loop { + Send("{Mouse1}") + Sleep(RandomDelay(800, 1200)) ; Not exactly 1000ms every time +} +``` + +## Server Compatibility + +### Single-Player +✅ Fully compatible - use any settings + +### Multiplayer (Vanilla) +⚠️ Check server rules - many servers ban AFK machines + +### Multiplayer (Modded) +⚠️ Check for anti-cheat mods + +### Realms +⚠️ May violate Microsoft ToS + +## Best Practices + +1. **Test in single-player** before using on servers +2. **Read server rules** about AFK automation +3. **Add randomization** to all timing +4. **Monitor your game** - don't leave completely unattended +5. **Respect the community** - don't ruin the game for others +6. **Use ethically** - some servers consider this cheating + +## Resources + +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) +- [Minecraft Wiki](https://minecraft.fandom.com/) +- [AFK Farm Designs](https://www.youtube.com/results?search_query=minecraft+afk+farm) +- [CLAUDE.md](../../CLAUDE.md) - Developer guide + +## Contributing + +When adding or modifying Minecraft macros: + +1. Test in single-player extensively +2. Add comments for timing explanations +3. Include setup instructions +4. Add server compatibility notes +5. Implement safety features + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for detailed guidelines. + +--- + +**Note:** Using AFK macros may violate some server rules or Minecraft's Terms of Service. Use responsibly and check your server's policies before using these scripts. + +**Last Updated:** 2025-12-26 diff --git a/AHK_v2/README.md b/AHK_v2/README.md new file mode 100644 index 0000000..63696c8 --- /dev/null +++ b/AHK_v2/README.md @@ -0,0 +1,429 @@ +# AHK_v2 - AutoHotkey v2 Scripts + +This directory contains AutoHotkey v2.0 scripts for gaming automation, window management, and system utilities. All scripts in this directory use the modern v2 syntax and require AutoHotkey v2.0.19+. + +## Directory Structure + +``` +AHK_v2/ +├── Black_ops_6/ # Call of Duty Black Ops 6 AFK macros +├── Minecraft/ # Minecraft AFK farming scripts +├── GUI/ # GUI launcher applications +├── ControllerQuit.ahk # Quit apps with controller button combo +├── Fullscreen.ahk # Borderless fullscreen toggle +├── Keys.ahk # Comprehensive hotkey suite +└── Powerplan.ahk # Automatic power plan switching +``` + +## Scripts Overview + +### Window Management + +#### Fullscreen.ahk + +**Purpose:** Toggle borderless fullscreen on any window with multi-monitor support + +**Hotkeys:** +- `End` - Toggle borderless fullscreen on active window + +**Features:** +- Multi-monitor aware (detects current monitor) +- Saves and restores window state +- Works with games that don't have native borderless mode + +**Usage:** +```bash +# Run the script +Fullscreen.ahk + +# Press End key while a game window is active +# Press End again to restore original state +``` + +**Requirements:** +- AutoHotkey v2.0.19+ +- Admin privileges (for some applications) + +--- + +### System Utilities + +#### Powerplan.ahk + +**Purpose:** Automatically switch Windows power plan based on running applications + +**Features:** +- Monitors for specific game processes +- Switches to High Performance when game is running +- Reverts to Balanced when game closes +- Runs silently in system tray + +**Default Configuration:** +- Monitors for: Fortnite +- High Performance: When game running +- Balanced: When game not running + +**Customization:** +```autohotkey +; Edit the script to monitor different processes +processName := "YourGame.exe" + +; Change power plans +highPerfGUID := "{8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c}" +balancedGUID := "{381b4222-f694-41f0-9685-ff5bb260df2e}" +``` + +**Usage:** +```bash +# Run the script (starts in system tray) +Powerplan.ahk + +# Right-click tray icon to exit +``` + +**Requirements:** +- AutoHotkey v2.0.19+ +- Admin privileges (required for power plan changes) + +--- + +#### ControllerQuit.ahk + +**Purpose:** Close applications using gamepad button combinations + +**Hotkeys:** +- `Guide + Start + B` - Close active window + +**Features:** +- Works with Xbox controllers +- Customizable button combinations +- Useful for controller-only setups (couch gaming) + +**Usage:** +```bash +# Run the script +ControllerQuit.ahk + +# Hold Guide + Start + B to close active window +``` + +**Requirements:** +- AutoHotkey v2.0.19+ +- Xbox-compatible controller + +--- + +#### Keys.ahk + +**Purpose:** Comprehensive hotkey suite for productivity and window management + +**Hotkeys:** +- `Win+Arrow Keys` - Snap windows to screen edges +- `Win+J` - Rename file with date prefix +- `Alt+Wheel` - Adjust system volume +- `Alt+MButton` - Mute/unmute +- `Win+T` - Always on top toggle +- See script for complete list + +**Features:** +- Window snapping and positioning +- File management shortcuts +- Media control integration +- System-wide hotkeys + +**Usage:** +```bash +# Run the script +Keys.ahk + +# Use hotkeys as needed +# Press F1 for built-in help (if available) +``` + +**Requirements:** +- AutoHotkey v2.0.19+ +- Some features may require admin privileges + +--- + +### Gaming Automation + +#### Black_ops_6/ + +Black Ops 6 AFK farming macros for XP and camo grinding. + +See [Black_ops_6/README.md](Black_ops_6/README.md) for details. + +**Scripts:** +- `bo6-afk.ahk` - Main AFK macro + +**Features:** +- Automated movement and actions +- Customizable timing and patterns +- Pause/resume functionality + +--- + +#### Minecraft/ + +Minecraft AFK automation for farming and resource gathering. + +See [Minecraft/README.md](Minecraft/README.md) for details. + +**Scripts:** +- `MC_AFK.ahk` - General AFK script +- `MC_Bedrock.ahk` - Bedrock Edition specific + +**Features:** +- AFK fishing +- Auto-farming +- Mob grinder automation + +--- + +### GUI Applications + +#### GUI/ + +Centralized script launchers with graphical interface. + +See [GUI/README.md](GUI/README.md) for details. + +**Scripts:** +- `GUI.ahk` - Main launcher +- `GUI_Shared.ahk` - Shared framework +- `WM.ahk` - Window management GUI + +**Features:** +- Launch multiple scripts from one interface +- Monitor script status +- Quick access to common tasks + +--- + +## Common Features + +### All v2 Scripts Include: + +1. **Modern Syntax** + - Function-based syntax: `MsgBox("text")` + - Proper parameter passing + - Try/catch error handling + +2. **Performance Optimization** + - Automatic via `InitScript()` from Lib/v2/AHK_Common.ahk + - Maximum execution speed + - Minimal overhead + +3. **Multi-Monitor Support** + - Most window management scripts detect monitor configuration + - Proper positioning on secondary displays + +4. **Error Handling** + - Timeouts for window/process waits + - User-friendly error messages + - Graceful failure modes + +## Usage Tips + +### Running Scripts + +**Method 1: Double-click** +```bash +# Simply double-click any .ahk file +Fullscreen.ahk +``` + +**Method 2: Command line** +```bash +# From AutoHotkey installation +"C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe" Fullscreen.ahk + +# If AutoHotkey is in PATH +autohotkey Fullscreen.ahk +``` + +**Method 3: Compiled executable** +```bash +# Compile to .exe first (optional) +Ahk2Exe /in Fullscreen.ahk /out Fullscreen.exe + +# Then run +Fullscreen.exe +``` + +### Hotkey Conflicts + +If hotkeys conflict with other applications: + +1. **Edit the script** and change the hotkey +2. **Use context-specific hotkeys:** + ```autohotkey + #HotIf WinActive("ahk_exe game.exe") + End::ToggleFullscreen() + #HotIf + ``` + +3. **Disable conflicting scripts** + +### Debugging + +If a script isn't working: + +1. **Check AutoHotkey version:** + ```bash + autohotkey --version + # Should be v2.0.19 or higher + ``` + +2. **Run from command line to see errors:** + ```bash + autohotkey script.ahk + ``` + +3. **Check for admin privileges:** + ```ahk + ; Add to script for debugging + if !A_IsAdmin { + MsgBox("Script needs admin privileges") + } + ``` + +4. **Enable debugging output:** + ```ahk + ; Temporarily add at top of script + #Warn All + MsgBox("Script started") + ``` + +## Migration from v1 + +If you're familiar with AutoHotkey v1: + +### Key Syntax Changes + +| v1 | v2 | +|----|-----| +| `MsgBox, text` | `MsgBox("text")` | +| `WinWait, title` | `WinWait("title")` | +| `WinGet, var, Style` | `var := WinGetStyle()` | +| `SetTimer, Label, 1000` | `SetTimer(Function, 1000)` | +| `Object()` | `Map()` | +| `%var%` in strings | Just `var` | + +### Migration Guide + +See [CLAUDE.md](../CLAUDE.md#autohotkey-v2-migration-status) for comprehensive migration information. + +## Development + +### Creating New Scripts + +**Template for new v2 scripts:** + +```autohotkey +; ============================================================================= +; Script Name: MyScript.ahk +; Description: What the script does +; Author: Your Name +; Version: 1.0.0 +; Last Updated: YYYY-MM-DD +; +; Requirements: +; - AutoHotkey v2.0.19+ +; - Admin privileges (if needed) +; +; Usage: +; Brief usage instructions +; +; Hotkeys: +; F1 - Action description +; ============================================================================= + +#Requires AutoHotkey v2.0 +#SingleInstance Force +SendMode "Input" +SetWorkingDir A_ScriptDir + +; Include shared libraries +#Include A_ScriptDir "\..\Lib\v2\AHK_Common.ahk" + +; Initialize script (UIA not needed in v2, admin if needed, optimize=true) +InitScript(false, false, true) + +; Your code here + +; Hotkeys +F1::MyFunction() + +; Functions +MyFunction() { + MsgBox("Hello from v2!") +} +``` + +### Best Practices + +1. **Use shared libraries:** Include from `Lib/v2/` instead of duplicating code +2. **Add error handling:** Use try/catch for risky operations +3. **Use timeouts:** Never use infinite waits +4. **Document hotkeys:** Add comments or help system +5. **Test on multiple monitors:** If using window management +6. **Follow naming conventions:** See [CONTRIBUTING.md](../CONTRIBUTING.md) + +### Testing + +**Before committing:** + +1. Test script functionality +2. Verify hotkeys work as expected +3. Check for error dialogs +4. Test on different screen resolutions (if applicable) +5. Test with/without admin privileges + +## Troubleshooting + +### Common Issues + +**Issue: Script won't run** +- Check AutoHotkey v2 is installed +- Right-click script → Edit → Check for syntax errors +- Run from command line to see error messages + +**Issue: Hotkeys don't work** +- Check for conflicting hotkeys +- Verify script is running (check system tray) +- Try running with admin privileges + +**Issue: Window functions fail** +- Use Window Spy (comes with AHK) to get exact window title +- Add timeout handling +- Verify window exists before operations + +**Issue: Multi-monitor problems** +- Check monitor configuration in Windows settings +- Verify monitors are detected by script +- Test on primary monitor first + +## Resources + +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) +- [v1 to v2 Changes](https://www.autohotkey.com/docs/v2/v2-changes.htm) +- [CLAUDE.md](../CLAUDE.md) - Detailed developer guide +- [CONTRIBUTING.md](../CONTRIBUTING.md) - Contribution guidelines + +## Contributing + +Contributions are welcome! Please: + +1. Follow v2 syntax and conventions +2. Test thoroughly before submitting +3. Update documentation +4. Add header comments to new scripts + +See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed guidelines. + +--- + +**Last Updated:** 2025-12-26 +**AutoHotkey Version:** v2.0.19+ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..48bcb63 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,146 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- CONTRIBUTING.md - Comprehensive contribution guidelines +- CODE_OF_CONDUCT.md - Community standards and enforcement guidelines +- CHANGELOG.md - Version history tracking + +### Changed +- Enhanced documentation structure across the repository + +## [2.0.0] - 2025-12-17 + +### Added +- AutoHotkey v2.0 migration for 45+ scripts +- Dual library architecture (Lib/v1/ and Lib/v2/) +- AutoStartManager.ahk - Unified data-driven auto-fullscreen launcher +- AutoStartConfig.ini - Centralized emulator configuration +- GUI_Shared.ahk - Shared GUI framework for launchers +- Comprehensive v2 migration documentation in CLAUDE.md +- Enhanced CLAUDE.md with 1700+ lines of developer documentation +- GEMINI.md - Additional AI assistant instructions + +### Changed +- Migrated all AFK macros to AutoHotkey v2 (Black Ops 6, Minecraft) +- Migrated all GUI scripts to v2 (GUI_PC, GUI_Laptop, GUI_Shared, WM) +- Migrated all Playnite launcher variants to v2 (4 scripts) +- Migrated utility scripts to v2 (ControllerQuit, Powerplan, Fullscreen, etc.) +- Updated CI/CD workflow for automatic v1/v2 version detection +- Improved README.md with enhanced structure and migration details + +### Fixed +- Command injection vulnerability in YouTube downloader +- Command injection vulnerability in Spotify downloader +- Command injection vulnerability in combined YT/Spotify downloader +- Hardcoded user paths in Ryujinx_LDN.ahk using OneDrive environment variable +- Hardcoded user paths in RemotePlay_Whatever.ahk +- Missing mouse button release in AFK_Hold_Click.ahk + +### Removed +- 9 duplicate auto-start scripts (consolidated into AutoStartManager) +- 3 duplicate fullscreen variants (unified into single implementation) +- 4 duplicate downloader draft files +- 7 deprecated auto-start v1 files +- 4 deprecated v1 utility files +- 1 deprecated Playnite_fullscreen/ directory + +### Security +- Added input validation to prevent command injection in downloader scripts +- Fixed arbitrary command execution vulnerabilities + +## [1.0.0] - 2025-11-19 + +### Added +- Initial release of Scripts repository +- Window management utilities (Fullscreen, Keys.ahk) +- Emulator automation scripts for 15+ emulators +- AFK macros for Black Ops 6 and Minecraft +- YouTube and Spotify downloader GUIs +- Citra 3DS mod manager and per-game configurations +- Playnite fullscreen automation +- Power plan automation +- Controller quit functionality +- 7zEmuPrepper integration +- Shared library framework (Lib/) + - AHK_Common.ahk + - WindowManager.ahk + - AutoStartHelper.ahk +- GUI launchers for PC and Laptop configurations +- Robocopy wrapper scripts +- Documentation (README.md, CLAUDE.md) + +### Features + +#### Window Management +- Borderless fullscreen toggle (multi-monitor aware) +- Window snapping with Win+Arrow keys +- Always-on-top window management +- Multi-monitor detection and positioning + +#### Emulator Support +- Auto-fullscreen for Citra, Yuzu, Ryujinx, RPCS4 +- Bluestacks rotation automation +- Per-game configuration profiles for Citra +- Integration with Playnite launcher + +#### Gaming Utilities +- AFK farming macros for Black Ops 6 +- AFK fishing/farming for Minecraft +- Controller-based application quit +- Power plan switching based on game detection + +#### Media Tools +- YouTube video/audio downloader with quality selection +- Spotify playlist/track downloader +- Combined media downloader GUI +- Integration with yt-dlp and spotdl + +#### System Enhancement +- Comprehensive hotkey suite (file renaming, media control) +- Power plan automation +- Lossless scaling integration + +## Version History Notes + +### Breaking Changes in 2.0.0 + +- Scripts now require AutoHotkey v2.0.19+ for v2 scripts +- Legacy scripts still require AutoHotkey v1.1.37.02+ +- Function call syntax changed from v1 command style to v2 function style +- Some auto-start scripts consolidated - use AutoStartManager.ahk instead + +### Migration Path from 1.x to 2.x + +1. Install AutoHotkey v2.0.19+ +2. Update script includes to use Lib/v2/ for new scripts +3. For auto-start scripts, migrate to AutoStartManager.ahk + AutoStartConfig.ini +4. Update function calls from v1 syntax to v2 syntax +5. See CLAUDE.md for detailed migration guide + +### Compatibility Notes + +- Both v1 and v2 scripts are maintained for compatibility +- Legacy v1 scripts in Other/Citra_* and Other/Downloader/ remain functional +- Dual library architecture allows gradual migration +- CI/CD automatically detects and compiles correct version + +## Links + +- [Repository](https://github.com/Ven0m0/Scripts) +- [Issues](https://github.com/Ven0m0/Scripts/issues) +- [AutoHotkey Documentation](https://www.autohotkey.com/docs/) + +## Contributors + +- **Ven0m0** - Initial work and maintenance (ven0m0.wastaken@gmail.com) + +--- + +**Note**: For detailed technical changes and development notes, see [CLAUDE.md](CLAUDE.md). diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ad736be --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,90 @@ +# Code of Conduct + +## Our Pledge + +We as contributors and maintainers pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +### Positive Behavior + +Examples of behavior that contributes to a positive environment: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members +- Providing helpful and constructive feedback +- Being patient with newcomers + +### Unacceptable Behavior + +Examples of unacceptable behavior: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting +- Dismissing or attacking inclusion-oriented requests + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, including: + +- GitHub repository (issues, pull requests, discussions) +- Code comments and documentation +- Project-related communications (email, social media, etc.) + +It also applies when an individual is representing the project or community in public spaces. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer at **ven0m0.wastaken@gmail.com**. + +All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. + +### Enforcement Guidelines + +Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +#### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional. + +**Consequence**: A private, written warning, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +#### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved for a specified period of time. This includes avoiding interactions in community spaces as well as external channels. Violating these terms may lead to a temporary or permanent ban. + +#### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved is allowed during this period. Violating these terms may lead to a permanent ban. + +#### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +## Questions + +If you have questions about this Code of Conduct, please contact the project maintainer at ven0m0.wastaken@gmail.com. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2a3b88a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,365 @@ +# Contributing to Scripts + +Thank you for considering contributing to this Windows automation toolkit! This guide will help you get started. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Environment](#development-environment) +- [Coding Standards](#coding-standards) +- [Submitting Changes](#submitting-changes) +- [Testing Guidelines](#testing-guidelines) +- [Documentation](#documentation) + +## Code of Conduct + +This project follows a simple code of conduct: be respectful, constructive, and collaborative. We welcome contributions from developers of all skill levels. + +## Getting Started + +### Prerequisites + +- **AutoHotkey v2.0.19+** - [Download](https://www.autohotkey.com/) +- **AutoHotkey v1.1.37.02+** - For legacy scripts ([Download UIA version](https://www.autohotkey.com/download/)) +- **Windows 10/11** - Required for testing +- **Git** - For version control + +### Fork and Clone + +1. Fork the repository on GitHub +2. Clone your fork locally: + ```bash + git clone https://github.com/YOUR-USERNAME/Scripts.git + cd Scripts + ``` +3. Add upstream remote: + ```bash + git remote add upstream https://github.com/Ven0m0/Scripts.git + ``` + +## Development Environment + +### Recommended Tools + +- **VS Code** with AutoHotkey extensions +- **Git Bash** or **PowerShell 7+** +- **AutoHotkey Language Support** extension for VS Code + +### Project Structure + +``` +Scripts/ +├── AHK_v2/ # AutoHotkey v2 scripts +├── Lib/ # Shared libraries (v1 and v2) +├── Other/ # Specialized utilities +├── .github/ # CI/CD workflows and instructions +└── docs/ # Additional documentation +``` + +See [README.md](README.md) for detailed structure information. + +## Coding Standards + +### AutoHotkey v2 Scripts + +All new scripts should target **AutoHotkey v2.0** unless they require v1-specific features. + +#### Required Directives + +```autohotkey +#Requires AutoHotkey v2.0 +#SingleInstance Force +SendMode "Input" +SetWorkingDir A_ScriptDir +``` + +#### Naming Conventions + +- **Functions**: `PascalCase()` - e.g., `ToggleFullscreen()` +- **Variables**: `camelCase` - e.g., `windowTitle` +- **Constants**: `UPPER_SNAKE_CASE` - e.g., `DEFAULT_TIMEOUT` +- **Globals**: Prefix with `g_` - e.g., `g_ScriptPID` + +#### Code Style + +- **Indentation**: 2 spaces (not tabs) +- **Line Endings**: CRLF (Windows) +- **Encoding**: UTF-8 with BOM +- **Brace Style**: OTBS (One True Brace Style) + ```autohotkey + FunctionName() { + ; code here + } + ``` + +#### Documentation + +Add header comments to all scripts: + +```autohotkey +; ============================================================================= +; Script Name: MyScript.ahk +; Description: Brief description of what the script does +; Author: Your Name +; Version: 1.0.0 +; Last Updated: YYYY-MM-DD +; +; Requirements: +; - AutoHotkey v2.0+ +; - Admin privileges (if needed) +; +; Usage: +; Brief usage instructions +; ============================================================================= + +#Requires AutoHotkey v2.0 +``` + +### AutoHotkey v1 Scripts + +Only modify v1 scripts when fixing critical bugs. For new features, migrate to v2. + +#### Performance Directives + +Always include these at the top: + +```autohotkey +#SingleInstance Force +#NoEnv +ListLines Off +SetBatchLines -1 +SetKeyDelay -1, -1 +SetMouseDelay -1 +SetDefaultMouseSpeed 0 +SetWinDelay -1 +SetControlDelay -1 +SendMode Input +``` + +### PowerShell Scripts + +- Target **PowerShell 7+** when possible +- Use **2-space indentation** +- Include proper parameter validation +- Add comment-based help + +```powershell +<# +.SYNOPSIS + Brief description +.DESCRIPTION + Detailed description +.PARAMETER ParameterName + Parameter description +.EXAMPLE + PS> .\script.ps1 +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory)] + [string]$ParameterName +) +``` + +### Batch/CMD Scripts + +- Keep scripts minimal and self-contained +- Use `@echo off` and `setlocal` +- Quote all paths +- Check for admin privileges when needed + +## Submitting Changes + +### Branch Naming + +Use descriptive branch names: + +- `feature/add-xyz` - New features +- `fix/bug-description` - Bug fixes +- `docs/update-readme` - Documentation updates +- `refactor/improve-xyz` - Code refactoring + +### Commit Messages + +Follow the Conventional Commits format: + +``` +: + + + + +``` + +**Types:** +- `feat:` - New feature +- `fix:` - Bug fix +- `docs:` - Documentation changes +- `style:` - Code formatting (no logic changes) +- `refactor:` - Code restructuring (no behavior change) +- `perf:` - Performance improvements +- `test:` - Adding or updating tests +- `chore:` - Maintenance tasks + +**Examples:** + +``` +feat: Add multi-monitor support to Fullscreen.ahk + +Implemented automatic monitor detection and positioning +for borderless fullscreen mode. + +Closes #123 +``` + +``` +fix: Resolve window positioning bug on secondary monitor + +Windows were incorrectly positioned when using secondary +monitor as primary display. +``` + +### Pull Request Process + +1. **Update your fork:** + ```bash + git fetch upstream + git rebase upstream/main + ``` + +2. **Create a feature branch:** + ```bash + git checkout -b feature/my-feature + ``` + +3. **Make your changes** following coding standards + +4. **Test your changes** thoroughly + +5. **Commit with descriptive messages** + +6. **Push to your fork:** + ```bash + git push origin feature/my-feature + ``` + +7. **Open a Pull Request** on GitHub with: + - Clear description of changes + - Reference to any related issues + - Screenshots for UI changes + - Test results + +### Pull Request Checklist + +- [ ] Code follows the style guidelines +- [ ] Comments added for complex logic +- [ ] Documentation updated (README, CLAUDE.md, etc.) +- [ ] No trailing whitespace +- [ ] CRLF line endings for `.ahk` files +- [ ] Scripts tested locally +- [ ] No hardcoded paths (use `A_ScriptDir`, environment variables) +- [ ] CI/CD checks pass + +## Testing Guidelines + +### Manual Testing + +1. **Test in clean environment** when possible +2. **Verify all hotkeys** work as expected +3. **Test edge cases:** + - Missing dependencies + - Wrong paths + - Admin privileges + - Multiple monitors (if applicable) +4. **Check for errors** - No error dialogs or unexpected behavior + +### AutoHotkey Script Testing + +```bash +# Run script +Double-click script.ahk + +# Check for syntax errors (compiles without running) +"C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in script.ahk /out temp.exe + +# Clean up +del temp.exe +``` + +### Library Changes + +When modifying shared libraries (`Lib/`): + +1. Identify all scripts that include the library +2. Test at least 5 dependent scripts +3. Verify no regressions in existing functionality + +### PowerShell Testing + +```powershell +# Syntax check +pwsh -NoProfile -File script.ps1 -WhatIf + +# Run with error handling +pwsh -NoProfile -File script.ps1 +``` + +## Documentation + +### When to Update Documentation + +Update documentation when you: + +- Add a new script or feature +- Change script behavior +- Fix a bug that affects usage +- Add new dependencies +- Change file structure + +### Documentation Files + +- **README.md** - User-facing overview and quick start +- **CLAUDE.md** - Developer guide and AI assistant instructions +- **CONTRIBUTING.md** - This file +- **Directory READMEs** - Specific documentation for subdirectories +- **Inline comments** - Complex logic and function documentation + +### Documentation Standards + +- Use **Markdown** format +- Include **code examples** where helpful +- Add **screenshots** for GUI features +- Keep **Table of Contents** updated +- Use **relative links** for internal references +- **Test all links** before committing + +## Getting Help + +### Resources + +- [AutoHotkey Documentation](https://www.autohotkey.com/docs/) +- [AutoHotkey Forum](https://www.autohotkey.com/boards/) +- [CLAUDE.md](CLAUDE.md) - Comprehensive development guide +- [GitHub Issues](https://github.com/Ven0m0/Scripts/issues) + +### Asking Questions + +- Check existing [Issues](https://github.com/Ven0m0/Scripts/issues) +- Read [CLAUDE.md](CLAUDE.md) for common patterns +- Open a new issue with: + - Clear description + - Steps to reproduce (for bugs) + - Expected vs actual behavior + - System information + +## Recognition + +Contributors will be acknowledged in: + +- Git commit history +- Release notes +- Project README (for significant contributions) + +Thank you for contributing! 🎉 diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 0000000..e4e2c5c --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,502 @@ +# Examples & Common Usage Patterns + +This document provides practical examples and common usage patterns for the scripts in this repository. + +## Table of Contents + +- [Window Management](#window-management) +- [Emulator Automation](#emulator-automation) +- [AFK Macros](#afk-macros) +- [GUI Launchers](#gui-launchers) +- [Media Downloads](#media-downloads) +- [System Utilities](#system-utilities) + +--- + +## Window Management + +### Example 1: Toggle Borderless Fullscreen + +**Use Case:** Make any game fullscreen without borders + +```autohotkey +; AHK_v2/Fullscreen.ahk +#Requires AutoHotkey v2.0 +#Include A_ScriptDir "\..\Lib\v2\WindowManager.ahk" + +; Press End key to toggle borderless fullscreen on active window +End::ToggleFakeFullscreenMultiMonitor("A") +``` + +**Usage:** +1. Run `Fullscreen.ahk` +2. Focus on your game window +3. Press `End` key +4. Press `End` again to restore + +--- + +### Example 2: Window Snapping + +**Use Case:** Snap windows to screen edges like Windows 11 + +```autohotkey +; From Keys.ahk - Window snapping with Win+Arrow keys +#Left:: ; Win+Left - Snap to left half + WinGetPos(&X, &Y, &Width, &Height, "A") + WinMove(0, 0, A_ScreenWidth/2, A_ScreenHeight, "A") +Return + +#Right:: ; Win+Right - Snap to right half + WinGetPos(&X, &Y, &Width, &Height, "A") + WinMove(A_ScreenWidth/2, 0, A_ScreenWidth/2, A_ScreenHeight, "A") +Return +``` + +--- + +### Example 3: Always On Top Toggle + +**Use Case:** Keep a window on top of all others + +```autohotkey +; Toggle always-on-top for active window +^Space:: ; Ctrl+Space + WinSetAlwaysOnTop(-1, "A") ; -1 = toggle + MsgBox("Always on top toggled!") +Return +``` + +--- + +## Emulator Automation + +### Example 4: Auto-Fullscreen for Citra + +**Use Case:** Automatically launch Citra in fullscreen + +**Method 1: Using AutoStartManager** + +```bash +# Run with emulator name +Other/AutoStartManager.ahk Citra +``` + +**Method 2: Manual Script** + +```autohotkey +#Requires AutoHotkey v2.0 +#Include A_ScriptDir "\..\Lib\v2\AutoStartHelper.ahk" + +; Wait for Citra, then press F11 for fullscreen +AutoStartFullscreen("citra-qt.exe", "{F11}", true, 0) +``` + +--- + +### Example 5: Per-Game Citra Configuration + +**Use Case:** Apply HD textures for Zelda: Ocarina of Time + +```autohotkey +#Include %A_ScriptDir%\tf.ahk + +global CitraConfigFile := A_AppData . "\Citra\config\qt-config.ini" + +; Enable HD Textures +tf_Replace(CitraConfigFile, "custom_textures\use_custom_textures=false", "custom_textures\use_custom_textures=true") + +; Set 4x resolution +tf_Replace(CitraConfigFile, "resolution_factor\default=true", "resolution_factor\default=false") +tf_Replace(CitraConfigFile, "resolution_factor=1", "resolution_factor=4") + +MsgBox("Configuration applied for Zelda OOT!") +ExitApp +``` + +--- + +### Example 6: Multi-Monitor Playnite Setup + +**Use Case:** Auto-switch monitors when launching Playnite + +```bash +# Run Playnite with multi-monitor automation +Other/Playnite_fullscreen_v2/Playnite_TV.ahk +``` + +This automatically: +- Disables secondary monitor +- Switches primary monitor +- Launches Playnite fullscreen +- Plays boot video +- Restores on exit + +--- + +## AFK Macros + +### Example 7: Minecraft AFK Fishing + +**Use Case:** Auto-fish while AFK + +```autohotkey +#Requires AutoHotkey v2.0 + +F7:: { ; Start fishing macro + Loop { + Send("{Mouse2}") ; Cast rod + Sleep(RandomDelay(15000, 20000)) ; Wait for bite + Send("{Mouse2}") ; Reel in + Sleep(RandomDelay(1000, 2000)) ; Delay before next cast + } +} + +F8::Pause ; Pause/Resume +F9::ExitApp ; Stop + +RandomDelay(min, max) { + return Random(min, max) +} +``` + +**Usage:** +1. Position yourself at fishing spot +2. Hold fishing rod +3. Run script and press F7 +4. F8 to pause, F9 to stop + +--- + +### Example 8: Black Ops 6 XP Farming + +**Use Case:** AFK XP grinding in Zombies + +```autohotkey +#Requires AutoHotkey v2.0 + +F7:: { ; Start XP macro + Loop { + ; Move in circle to avoid AFK kick + Send("{w down}") + Sleep(500) + Send("{w up}") + Sleep(100) + + ; Shoot periodically + Send("{Mouse1}") + Sleep(RandomDelay(800, 1200)) + + ; Anti-AFK movement every 30 seconds + if (Mod(A_Index, 30) == 0) { + Send("{Space}") ; Jump + Sleep(200) + } + } +} + +F8::Pause +F9::ExitApp + +RandomDelay(min, max) { + return Random(min, max) +} +``` + +--- + +## GUI Launchers + +### Example 9: Simple Script Launcher + +**Use Case:** Launch multiple scripts from one GUI + +```autohotkey +#Requires AutoHotkey v2.0 + +global script1PID := 0 +global script2PID := 0 + +; Create GUI +myGui := Gui("+AlwaysOnTop", "Script Launcher") + +; Add buttons +myGui.Add("Button", "w200", "Launch Fullscreen").OnEvent("Click", LaunchFullscreen) +myGui.Add("Button", "w200", "Launch Power Plan").OnEvent("Click", LaunchPowerPlan) +myGui.Add("Button", "w200", "Close All Scripts").OnEvent("Click", CloseAll) + +myGui.Show() + +; Button handlers +LaunchFullscreen(*) { + global script1PID + Run(A_ScriptDir "\Fullscreen.ahk", , , &script1PID) +} + +LaunchPowerPlan(*) { + global script2PID + Run(A_ScriptDir "\Powerplan.ahk", , , &script2PID) +} + +CloseAll(*) { + if WinExist("ahk_pid " script1PID) + WinClose("ahk_pid " script1PID) + if WinExist("ahk_pid " script2PID) + WinClose("ahk_pid " script2PID) +} +``` + +--- + +## Media Downloads + +### Example 10: Download YouTube Playlist + +**Use Case:** Download entire playlist as MP3s + +```bash +# 1. Place yt-dlp.exe in Other/Downloader/ +# 2. Run YT_Spotify_Downloader.ahk +# 3. Paste playlist URL +# 4. Select "Audio - MP3" +# 5. Click Download +``` + +**Manual command line:** + +```bash +cd Other/Downloader +yt-dlp -f "ba" -x --audio-format mp3 "https://youtube.com/playlist?list=..." +``` + +--- + +### Example 11: Download Spotify Playlist + +**Use Case:** Download Spotify playlist to local files + +```bash +# 1. Place spotdl.exe in Other/Downloader/ +# 2. Run YT_Spotify_Downloader.ahk +# 3. Paste Spotify playlist URL +# 4. Click Download +``` + +**Manual command line:** + +```bash +cd Other/Downloader +spotdl "https://open.spotify.com/playlist/..." +``` + +--- + +## System Utilities + +### Example 12: Auto Power Plan Switching + +**Use Case:** Switch to High Performance when game launches + +```autohotkey +#Requires AutoHotkey v2.0 + +; Monitor for specific game +processName := "FortniteClient-Win64-Shipping.exe" +highPerfGUID := "{8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c}" +balancedGUID := "{381b4222-f694-41f0-9685-ff5bb260df2e}" + +SetTimer(CheckProcess, 5000) + +CheckProcess() { + if ProcessExist(processName) { + ; Switch to High Performance + Run("powercfg /setactive " highPerfGUID, , "Hide") + } else { + ; Switch to Balanced + Run("powercfg /setactive " balancedGUID, , "Hide") + } +} +``` + +--- + +### Example 13: Controller Quit + +**Use Case:** Quit games with controller combo + +```autohotkey +#Requires AutoHotkey v2.0 + +; Guide + Start + B to close active window +; (Implementation varies by controller library) + +; Simple version using keyboard simulation +^!q:: ; Ctrl+Alt+Q as alternative + if WinExist("A") { + WinClose("A") + } +Return +``` + +--- + +### Example 14: Bulk Image Copy with Robocopy + +**Use Case:** Copy all images from vacation photos to backup + +```cmd +@echo off +REM Copy_vacation_photos.cmd + +set ext=*.jpg *.jpeg *.png *.heic *.raw +robocopy "D:\Vacation 2024" "E:\Backup\Vacation 2024" %ext% /s /MT:32 /v + +echo. +echo Copy complete! +pause +``` + +--- + +### Example 15: 7z Game Compression + +**Use Case:** Compress PS2 games to save space + +```bash +# Compress with maximum compression +7z a -t7z -mx=9 "God of War.7z" "God of War\*" + +# Then use with 7zEmuPrepper for on-the-fly extraction +``` + +--- + +## Advanced Patterns + +### Example 16: Multi-Step Automation + +**Use Case:** Complete emulator setup automation + +```autohotkey +#Requires AutoHotkey v2.0 +#Include A_ScriptDir "\..\Lib\v2\AHK_Common.ahk" +#Include A_ScriptDir "\..\Lib\v2\WindowManager.ahk" + +InitScript(false, true) ; Require admin + +; 1. Apply per-game config +Run("Citra_per_game_config\Pokemon-X.ahk") +Sleep(2000) + +; 2. Launch emulator +citraPath := "C:\Emulators\Citra\citra-qt.exe" +gamePath := "D:\Games\3DS\Pokemon X.3ds" +Run('"' citraPath '" "' gamePath '"', , , &citraPID) + +; 3. Wait and apply fullscreen +if WaitForProcess("citra-qt.exe", 10) { + Sleep(2000) + Send("{F11}") ; Fullscreen +} +``` + +--- + +### Example 17: Conditional Automation + +**Use Case:** Different settings for different times of day + +```autohotkey +#Requires AutoHotkey v2.0 + +currentHour := A_Hour + +if (currentHour >= 22 or currentHour < 6) { + ; Night mode - reduce volume + SoundSetVolume(30) + MsgBox("Night mode activated") +} else { + ; Day mode - normal volume + SoundSetVolume(70) + MsgBox("Day mode activated") +} +``` + +--- + +### Example 18: Error Handling Pattern + +**Use Case:** Robust script with error recovery + +```autohotkey +#Requires AutoHotkey v2.0 + +try { + ; Try to launch emulator + if !FileExist("emulator.exe") { + throw Error("Emulator not found!") + } + + Run("emulator.exe", , , &pid) + + ; Wait for window + if !WinWait("ahk_pid " pid, , 10) { + throw Error("Window did not appear!") + } + + ; Success + MsgBox("Emulator launched successfully!") + +} catch as e { + ; Handle error + MsgBox("Error: " e.Message, "Error", "Icon!") + ExitApp(1) +} +``` + +--- + +## Tips & Tricks + +### Tip 1: Testing Scripts Safely + +Always test with `/L` flag for file operations: + +```cmd +REM Preview robocopy without copying +robocopy source dest /s /MT:32 /L +``` + +### Tip 2: Debugging AutoHotkey + +```autohotkey +; Add debug output +MsgBox("Debug: Variable = " myVariable) + +; Or use ToolTip for non-blocking +ToolTip("Debug: Step 1 complete") +Sleep(2000) +ToolTip() ; Clear +``` + +### Tip 3: Quick Reload + +Add to scripts for easy reloading: + +```autohotkey +^r::Reload ; Ctrl+R to reload script +^e::Edit ; Ctrl+E to edit script +``` + +--- + +## Resources + +- [README.md](README.md) - Main documentation +- [CLAUDE.md](CLAUDE.md) - Developer guide with detailed patterns +- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) + +--- + +**Last Updated:** 2025-12-26 \ No newline at end of file diff --git a/Lib/README.md b/Lib/README.md new file mode 100644 index 0000000..0f881d1 --- /dev/null +++ b/Lib/README.md @@ -0,0 +1,377 @@ +# Lib - Shared Library Framework + +This directory contains the shared AutoHotkey library files used across all scripts in the repository. The libraries provide common functionality for initialization, window management, and emulator automation. + +## Architecture + +The library uses a **dual-version architecture** to support both AutoHotkey v1.1 and v2.0: + +``` +Lib/ +├── v1/ # AutoHotkey v1.1 libraries +│ ├── AHK_Common.ahk # v1 initialization utilities +│ ├── AutoStartHelper.ahk # v1 auto-fullscreen helpers +│ └── WindowManager.ahk # v1 window manipulation +└── v2/ # AutoHotkey v2.0 libraries + ├── AHK_Common.ahk # v2 initialization utilities + ├── AutoStartHelper.ahk # v2 auto-fullscreen helpers + └── WindowManager.ahk # v2 window manipulation +``` + +## Library Files + +### AHK_Common.ahk + +**Purpose:** Core initialization and setup utilities + +**Functions:** + +- `InitScript(requireUIA, requireAdmin, optimize)` - One-call initialization for common requirements +- `InitUIA()` - Ensures UI Automation support (v1 only; no-op in v2) +- `RequireAdmin()` - Restarts script with administrator privileges +- `SetOptimalPerformance()` - Applies performance optimizations + +**Usage:** + +```autohotkey +; v1 script +#Include %A_ScriptDir%\..\Lib\v1\AHK_Common.ahk +InitScript(true, true) ; Require UIA + Admin + Performance optimization + +; v2 script +#Include A_ScriptDir "\..\Lib\v2\AHK_Common.ahk" +InitScript(true, true) ; Require Admin + Performance optimization (UIA built-in) +``` + +**Performance Optimizations Applied:** + +- `#KeyHistory 0` - Disable key logging +- `ListLines Off` - Disable line logging +- `SetBatchLines -1` - Maximum execution speed +- `SetKeyDelay -1, -1` - No key delays +- `SetMouseDelay -1` - No mouse delays +- `SetDefaultMouseSpeed 0` - Instant mouse movement +- `SetWinDelay -1` - No window operation delays +- `SetControlDelay -1` - No control operation delays +- `SendMode Input` - Fastest send mode (v1) / `SendMode "Input"` (v2) + +### WindowManager.ahk + +**Purpose:** Window manipulation and multi-monitor management + +**Functions:** + +- `ToggleFakeFullscreenMultiMonitor(winTitle)` ⭐ Most used + - Multi-monitor aware borderless fullscreen toggle + - Detects current monitor and calculates bounds + - Saves/restores window state + +- `ToggleFakeFullscreen(winTitle)` + - Single-monitor borderless fullscreen toggle + - Always uses primary monitor dimensions + +- `SetWindowBorderless(winTitle)` + - Removes window borders and title bar + - Applies resizable style + +- `MakeFullscreen(winTitle)` + - Combined borderless + maximize operation + +- `RestoreWindowBorders(winTitle)` (v2 only) + - Restores window borders after borderless mode + +- `MaximizeWindow(winTitle)` + - Maximizes window to full screen + +- `WaitForWindow(winTitle, timeout)` + - Safe window waiting with timeout + - Returns true if found, false if timeout + +- `WaitForProcess(processName, timeout)` + - Safe process waiting with timeout + - Returns true if found, false if timeout + +**Usage:** + +```autohotkey +; v1 script +#Include %A_ScriptDir%\..\Lib\v1\WindowManager.ahk + +; Toggle borderless fullscreen on active window +End::ToggleFakeFullscreenMultiMonitor("A") + +; Wait for window with timeout +if !WaitForWindow("ahk_exe game.exe", 10) { + MsgBox, Game window not found! + ExitApp +} + +; v2 script +#Include A_ScriptDir "\..\Lib\v2\WindowManager.ahk" + +; Toggle borderless fullscreen +End::ToggleFakeFullscreenMultiMonitor("A") + +; Wait for window with timeout +if !WaitForWindow("ahk_exe game.exe", 10) { + MsgBox("Game window not found!") + ExitApp +} +``` + +### AutoStartHelper.ahk + +**Purpose:** Automated emulator and application fullscreen launching + +**Functions:** + +- `AutoStartFullscreen(exeName, fullscreenKey, maximize, delay, activate)` + - Waits for process to start + - Activates and maximizes window + - Sends fullscreen key + - Exits after operation + +- `AutoStartFullscreenWithTitle(winTitle, fullscreenKey, maximize, delay)` + - Same as above but waits for window title instead of process + - Useful when multiple instances of same process exist + +**Usage:** + +```autohotkey +; v1 script +#Include %A_ScriptDir%\..\Lib\v1\AutoStartHelper.ahk + +; Launch Citra in fullscreen +AutoStartFullscreen("citra-qt.exe", "F11", true, 0) + +; v2 script +#Include A_ScriptDir "\..\Lib\v2\AutoStartHelper.ahk" + +; Launch emulator with custom key +AutoStartFullscreen("emulator.exe", "{F11}", true, 1000) + +; Wait for specific window title +AutoStartFullscreenWithTitle("Game Title", "{Alt down}{Enter}{Alt up}", true, 500) +``` + +## Version Differences + +### Key Differences Between v1 and v2 + +| Feature | v1 | v2 | +|---------|----|----| +| Include syntax | `#Include %A_ScriptDir%\file.ahk` | `#Include A_ScriptDir "\file.ahk"` | +| Function calls | `MsgBox, text` | `MsgBox("text")` | +| WinGet/WinSet | `WinGet, var, Style` | `var := WinGetStyle()` | +| Timer callbacks | Label-based | Function-based | +| UIA support | External executable | Built-in | +| Error handling | ErrorLevel | try/catch | +| Maps/Objects | `Object()` | `Map()` | + +### Migration Notes + +- v2 has UIA built-in, so `InitUIA()` is a no-op +- v2 uses function syntax for all operations +- v2 has better error handling with try/catch +- v2 requires explicit parameter passing (no implicit parameters) + +## Best Practices + +### Choosing v1 vs v2 + +**Use v1 for:** +- Maintaining existing v1 scripts +- Scripts with complex COM interactions +- Dependencies on v1-only libraries (e.g., tf.ahk) + +**Use v2 for:** +- All new scripts +- Scripts being migrated from v1 +- Modern syntax and error handling +- Better performance in some scenarios + +### Including Libraries + +**Always use relative paths from script directory:** + +```autohotkey +; v1 - Good +#Include %A_ScriptDir%\..\Lib\v1\AHK_Common.ahk + +; v1 - Bad (hardcoded path) +#Include C:\Scripts\Lib\v1\AHK_Common.ahk + +; v2 - Good +#Include A_ScriptDir "\..\Lib\v2\AHK_Common.ahk" + +; v2 - Bad (hardcoded path) +#Include "C:\Scripts\Lib\v2\AHK_Common.ahk" +``` + +### Performance Optimization + +**Always initialize scripts with performance optimizations:** + +```autohotkey +; v1 +InitScript(false, false) ; Just performance optimization + +; v2 +InitScript(false, false) ; Just performance optimization +``` + +**When to skip optimization:** +- Debugging scripts (want to see line execution) +- Scripts that need key/mouse history for troubleshooting + +### Admin Privileges + +**Only require admin when necessary:** + +```autohotkey +; Requires admin (system settings, other windows) +InitScript(false, true) ; (requireUIA, requireAdmin) + +; No admin needed (own window management) +InitScript(false, false) +``` + +**Scripts that need admin:** +- Power plan switching (Powerplan.ahk) +- System-wide hotkeys affecting other apps +- Modifying registry or system files +- Interacting with elevated processes + +### Timeout Handling + +**Always use timeouts for window/process waits:** + +```autohotkey +; v1 - Good +if !WaitForWindow("ahk_exe game.exe", 10) { + MsgBox, Timeout waiting for game + ExitApp +} + +; v1 - Bad (infinite wait) +WinWait, ahk_exe game.exe + +; v2 - Good +if !WaitForWindow("ahk_exe game.exe", 10) { + MsgBox("Timeout waiting for game") + ExitApp +} + +; v2 - Bad (infinite wait) +WinWait("ahk_exe game.exe") +``` + +## Testing Library Changes + +**⚠️ CRITICAL:** Changes to library files affect ALL dependent scripts! + +### Testing Process + +1. **Identify dependent scripts:** + ```bash + # From repository root + grep -r "AHK_Common.ahk" --include="*.ahk" + grep -r "WindowManager.ahk" --include="*.ahk" + grep -r "AutoStartHelper.ahk" --include="*.ahk" + ``` + +2. **Test at least 5 dependent scripts:** + - Pick scripts from different categories + - Test both simple and complex use cases + - Verify no regressions + +3. **Check for breaking changes:** + - Function signature changes + - Return value changes + - Behavior changes + - New required parameters + +4. **Update documentation:** + - CLAUDE.md + - This README + - Inline comments + +## Common Issues + +### Issue: Script not requesting admin + +**Problem:** Script doesn't elevate when it should + +**Solution:** +```autohotkey +; Ensure RequireAdmin is called +InitScript(false, true) ; Second parameter = require admin + +; Or call directly +RequireAdmin() +``` + +### Issue: Window operations failing + +**Problem:** Window functions return errors or have no effect + +**Solution:** +```autohotkey +; Add error checking +if !WaitForWindow("ahk_exe game.exe", 10) { + MsgBox, Window not found! + ExitApp +} + +; Verify window title/exe matches exactly +; Use Window Spy (comes with AHK) to get exact title +``` + +### Issue: Performance slower than expected + +**Problem:** Scripts feel sluggish + +**Solution:** +```autohotkey +; Ensure optimizations are applied +InitScript(false, false, true) ; Third parameter = optimize (default) + +; Or call directly +SetOptimalPerformance() +``` + +### Issue: UIA not working (v1 only) + +**Problem:** Cannot interact with modern Windows UI elements + +**Solution:** +```autohotkey +; Ensure UIA initialization +InitScript(true, false) ; First parameter = require UIA + +; Make sure you're using AutoHotkey_H UIA build +; Run: Other/UIA Install.ahk +``` + +## Contributing + +When modifying library files: + +1. **Document all changes** in function headers +2. **Test thoroughly** with dependent scripts +3. **Update version-specific libraries** (v1 and v2) +4. **Update CLAUDE.md** with changes +5. **Add migration notes** if breaking changes + +See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed guidelines. + +## Additional Resources + +- [CLAUDE.md](../CLAUDE.md) - Comprehensive developer guide +- [AutoHotkey v1 Documentation](https://www.autohotkey.com/docs/v1/) +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) +- [v1 to v2 Migration Guide](https://www.autohotkey.com/docs/v2/v2-changes.htm) + +--- + +**Last Updated:** 2025-12-26 diff --git a/Links.md b/Links.md index 34a61ff..79456a9 100644 --- a/Links.md +++ b/Links.md @@ -1,2 +1,84 @@ -- https://www.autohotkey.com/boards/viewtopic.php?t=6413 -- https://www.elitepvpers.com/forum/s4-league/4027859-guide-optimize-autohotkey-timing.html +# Useful Links & Resources + +This document contains useful links and resources related to AutoHotkey optimization, Windows automation, and emulation. + +## AutoHotkey Resources + +### Optimization & Performance + +- [AHK Performance Optimization Guide](https://www.autohotkey.com/boards/viewtopic.php?t=6413) - Comprehensive guide to optimizing AutoHotkey scripts +- [ElitePvpers - AutoHotkey Timing Guide](https://www.elitepvpers.com/forum/s4-league/4027859-guide-optimize-autohotkey-timing.html) - Advanced timing and precision techniques + +### Official Documentation + +- [AutoHotkey v2 Documentation](https://www.autohotkey.com/docs/v2/) - Official v2 docs +- [AutoHotkey v1 Documentation](https://www.autohotkey.com/docs/v1/) - Official v1 docs +- [v1 to v2 Migration Guide](https://www.autohotkey.com/docs/v2/v2-changes.htm) - Changes and migration path + +### Community + +- [AutoHotkey Forum](https://www.autohotkey.com/boards/) - Official community forum +- [AutoHotkey Reddit](https://reddit.com/r/AutoHotkey) - Reddit community + +## Window Management + +- [Window Styles Reference](https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles) - Microsoft documentation on window styles +- [Extended Window Styles](https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles) - Extended styles documentation + +## External Tools + +### Media Downloaders + +- [yt-dlp](https://github.com/yt-dlp/yt-dlp) - YouTube downloader (fork of youtube-dl) +- [spotdl](https://github.com/spotDL/spotify-downloader) - Spotify downloader + +### Emulation + +- [Citra Emulator](https://citra-emu.org/) - Nintendo 3DS emulator +- [Yuzu](https://yuzu-emu.org/) - Nintendo Switch emulator +- [Ryujinx](https://ryujinx.org/) - Nintendo Switch emulator +- [RPCS3](https://rpcs3.net/) - PlayStation 3 emulator +- [PCSX2](https://pcsx2.net/) - PlayStation 2 emulator +- [Dolphin](https://dolphin-emu.org/) - GameCube/Wii emulator + +### System Utilities + +- [MultiMonitorTool](https://www.nirsoft.net/utils/multi_monitor_tool.html) - NirSoft's multi-monitor management tool +- [7-Zip](https://www.7-zip.org/) - File compression utility +- [FFMPEG](https://ffmpeg.org/) - Multimedia framework for audio/video processing + +## Emulation Resources + +- [3DS Title ID Database](https://www.3dsdb.com/) - Database of 3DS game title IDs +- [GameBanana 3DS Mods](https://gamebanana.com/games/4965) - Community mods for 3DS games +- [Citra Compatibility List](https://citra-emu.org/game/) - Game compatibility database + +## Development Resources + +### Git & Version Control + +- [GitHub Desktop](https://desktop.github.com/) - GUI for Git +- [Conventional Commits](https://www.conventionalcommits.org/) - Commit message convention + +### CI/CD + +- [GitHub Actions Documentation](https://docs.github.com/en/actions) - Official Actions docs +- [Ahk2Exe Compiler](https://www.autohotkey.com/docs/v2/Scripts.htm#ahk2exe) - AutoHotkey compiler docs + +## PowerShell Resources + +- [PowerShell Documentation](https://learn.microsoft.com/en-us/powershell/) - Official PowerShell docs +- [PowerShell Gallery](https://www.powershellgallery.com/) - Module repository +- [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) - PowerShell linter + +## Related Projects + +- [7zEmuPrepper](https://github.com/UnluckyForSome/7zEmuPrepper) - Original on-the-fly decompression project + +## Contributing + +Have a useful resource to add? See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on submitting additions. + +--- + +**Last Updated:** 2025-12-26 diff --git a/Other/7zEmuPrepper/README.md b/Other/7zEmuPrepper/README.md new file mode 100644 index 0000000..b81ecb9 --- /dev/null +++ b/Other/7zEmuPrepper/README.md @@ -0,0 +1,285 @@ +# 7zEmuPrepper + +On-the-fly game decompression utility for emulation front-ends. Based on [7zEmuPrepper by UnluckyForSome](https://github.com/UnluckyForSome/7zEmuPrepper). + +## Overview + +7zEmuPrepper is a utility that decompresses disc-based games **on-the-fly** when launching from emulation front-ends like Playnite, Launchbox, or EmulationStation. This allows you to keep games compressed in 7z format, saving significant disk space while still being able to launch them normally. + +## Features + +- **Automatic Decompression** - Games are extracted when launched +- **Space Saving** - Keep games compressed (saves 50-80% disk space) +- **Front-end Integration** - Works with Playnite, Launchbox, etc. +- **7-Zip Support** - Uses 7-Zip for maximum compression +- **Transparent** - Games launch as if uncompressed +- **No Manual Work** - Set it up once and forget it + +## How It Works + +1. You compress your game files to `.7z` format +2. Configure your front-end to use 7zEmuPrepper as a launcher +3. When you launch a game: + - 7zEmuPrepper extracts the game to a temporary location + - The emulator launches with the extracted file + - After closing, the temporary files are cleaned up +4. Your compressed archive remains intact + +## Prerequisites + +- **7-Zip** - [Download](https://www.7-zip.org/) +- **PowerShell 5.1+** or **PowerShell 7+** +- **Windows 10/11** +- **Emulation Front-end** (Playnite, Launchbox, etc.) +- **Compressed game files** (.7z format) + +## Installation + +### Step 1: Install 7-Zip + +Download and install 7-Zip from [7-zip.org](https://www.7-zip.org/) + +### Step 2: Compress Your Games + +```powershell +# Compress a game folder +7z a -t7z -mx=9 "GameName.7z" "GameFolder\*" + +# Compress with ultra compression +7z a -t7z -mx=9 -m0=lzma2 -mmt=on "GameName.7z" "GameFolder\*" +``` + +**Recommended structure:** +``` +D:\Games\PS2\ +├── Game1.7z +├── Game2.7z +└── Game3.7z +``` + +### Step 3: Configure Front-End + +#### For Playnite + +1. **Edit game** in Playnite +2. **Set Actions:** + - Name: `Play` + - Type: `File` + - Path: `powershell.exe` + - Arguments: `-ExecutionPolicy Bypass -File "path\to\7zEmuPrepper.ps1" -Archive "{ImagePath}" -Emulator "emulator.exe"` + - Working Directory: `{InstallDir}` + +#### For Launchbox + +1. **Edit Emulator** +2. **Command-line parameters:** + ``` + powershell.exe -ExecutionPolicy Bypass -File "path\to\7zEmuPrepper.ps1" -Archive "%rompath%\%romfile%" -Emulator "emulator.exe" + ``` + +## Files + +| File | Purpose | +|------|---------| +| `7zEmuPrepper.ps1` | Main PowerShell script | +| `Final.ahk` | AutoHotkey v2 launcher wrapper | +| `ps2exe.ps1` | Script to compile PS1 to EXE (optional) | +| `README.md` | This file | + +## Usage + +### PowerShell Script + +```powershell +.\7zEmuPrepper.ps1 -Archive "Game.7z" -Emulator "emulator.exe" +``` + +**Parameters:** +- `-Archive` - Path to compressed game file (.7z) +- `-Emulator` - Emulator executable to launch +- `-TempDir` (optional) - Custom temporary extraction directory + +### AutoHotkey Wrapper + +The `Final.ahk` script provides an AutoHotkey interface: + +```ahk +; Edit Final.ahk with your paths +Run "powershell.exe -File 7zEmuPrepper.ps1 -Archive 'Game.7z' -Emulator 'emulator.exe'" +``` + +## Configuration + +### Custom Temp Directory + +By default, games are extracted to `%TEMP%\7zEmuPrepper\`. To change: + +```powershell +.\7zEmuPrepper.ps1 -Archive "Game.7z" -Emulator "emulator.exe" -TempDir "D:\Temp" +``` + +### Emulator Parameters + +Pass additional parameters to the emulator: + +```powershell +.\7zEmuPrepper.ps1 -Archive "Game.7z" -Emulator "emulator.exe -fullscreen -gpu opengl" +``` + +## Trade-offs + +### Advantages ✅ + +- **Huge space savings** (50-80% reduction) +- **No manual decompression** needed +- **Original archives remain intact** +- **Works with any emulator** + +### Disadvantages ❌ + +- **Longer launch time** (depends on game size and CPU) +- **Requires disk space** for temporary extraction +- **Adds complexity** to your setup + +## Performance + +**Extraction times** (approximate, depends on CPU): + +| Game Size (Uncompressed) | Compressed Size | Extraction Time | +|--------------------------|-----------------|-----------------| +| 500 MB | ~200 MB | 5-10 seconds | +| 2 GB | ~800 MB | 15-30 seconds | +| 4 GB | ~1.5 GB | 30-60 seconds | +| 8 GB | ~3 GB | 1-2 minutes | + +**Recommended for:** +- Games you play occasionally +- Large game collections with limited disk space +- Slower systems (extraction is CPU-bound, not disk-bound) + +**NOT recommended for:** +- Games you play frequently (keep uncompressed) +- Very large games (>10 GB) unless you have fast CPU +- Systems with slow HDDs (extraction + disk IO = slow) + +## Troubleshooting + +### Issue: "7-Zip not found" error + +**Solution:** +1. Install 7-Zip from [7-zip.org](https://www.7-zip.org/) +2. Verify installation: `7z --help` +3. Add 7-Zip to PATH if needed + +### Issue: Game doesn't launch + +**Solution:** +1. Test extraction manually: `7z x Game.7z` +2. Verify emulator path is correct +3. Check PowerShell execution policy: `Get-ExecutionPolicy` +4. Enable script execution: `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser` + +### Issue: Temp files not cleaned up + +**Solution:** +1. Manually delete: `%TEMP%\7zEmuPrepper\` +2. Check script has permissions to delete +3. Close emulator properly (don't force kill) + +### Issue: Extraction too slow + +**Solution:** +1. Use faster compression level when creating archives: `-mx=5` instead of `-mx=9` +2. Store frequently-played games uncompressed +3. Use SSD for temp directory +4. Upgrade CPU (extraction is CPU-intensive) + +## Advanced Usage + +### Compile PowerShell to EXE + +Use `ps2exe.ps1` to create a standalone executable: + +```powershell +.\ps2exe.ps1 -InputFile 7zEmuPrepper.ps1 -OutputFile 7zEmuPrepper.exe +``` + +Benefits: +- No need to set PowerShell execution policy +- Easier to distribute +- Slightly faster startup + +### Batch Compress Games + +```powershell +# Compress all games in a directory +Get-ChildItem -Directory | ForEach-Object { + 7z a -t7z -mx=9 "$($_.Name).7z" "$($_.FullName)\*" +} +``` + +### Integration with Emulation Station + +Edit `es_systems.cfg`: + +```xml +powershell.exe -ExecutionPolicy Bypass -File "path\to\7zEmuPrepper.ps1" -Archive "%ROM%" -Emulator "emulator.exe" +``` + +## Best Practices + +1. **Test first** - Try with one game before compressing your entire library +2. **Keep backups** - Don't delete originals until you verify compressed versions work +3. **Optimize compression** - Balance between file size and extraction time +4. **Use for archives** - Best for games you don't play often +5. **Monitor temp space** - Ensure enough space for largest game + +## Compression Recommendations + +### Maximum Compression (Slowest) + +```bash +7z a -t7z -mx=9 -m0=lzma2 -mmt=on "Game.7z" "Game\*" +``` +- Best compression ratio +- Slowest compression and extraction +- Use for long-term storage + +### Balanced (Recommended) + +```bash +7z a -t7z -mx=7 "Game.7z" "Game\*" +``` +- Good compression ratio +- Reasonable extraction speed +- Best for most users + +### Fast (Least Compression) + +```bash +7z a -t7z -mx=3 "Game.7z" "Game\*" +``` +- Lower compression ratio +- Fastest extraction +- Use for frequently-played games + +## Resources + +- [Original 7zEmuPrepper Project](https://github.com/UnluckyForSome/7zEmuPrepper) +- [7-Zip Official Site](https://www.7-zip.org/) +- [7-Zip Command Line Documentation](https://sevenzip.osdn.jp/chm/cmdline/index.htm) + +## See Also + +- [AutoStartManager](../AutoStartManager.ahk) - Auto-fullscreen for emulators +- [Playnite_fullscreen_v2](../Playnite_fullscreen_v2/) - Playnite automation + +## Contributing + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines. + +--- + +**Note:** This is a fork/adaptation of the original 7zEmuPrepper project. The caveat is that launch times will be longer due to on-the-fly decompression. + +**Last Updated:** 2025-12-26 diff --git a/Other/7zEmuPrepper/readme.md b/Other/7zEmuPrepper/readme.md deleted file mode 100644 index 45ad9c1..0000000 --- a/Other/7zEmuPrepper/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -## [7zEmuPrepper](https://github.com/UnluckyForSome/7zEmuPrepper) - -This is a utility to decompress disc-based games on-the-fly for various front-ends. IT works with 7z/7zip (its in the name afterall). -This saves a lot of space due to high compression and no manual work. The only caveat is that the launch time is going to be longer. diff --git a/Other/Citra_mods/README.MD b/Other/Citra_mods/README.MD deleted file mode 100644 index 6322fbe..0000000 --- a/Other/Citra_mods/README.MD +++ /dev/null @@ -1,3 +0,0 @@ -You need to manually change the filepaths to apply to your system. You also need to add the name of the game and the game id in [Destination.csv](/Other/Citra_mods/Destination.csv) .Other than that just keep the 2 files in the same folder and you're good to go - -![img](/Other/Citra_mods/Citra_Mod_Manager.avif) diff --git a/Other/Citra_mods/README.md b/Other/Citra_mods/README.md new file mode 100644 index 0000000..11fb371 --- /dev/null +++ b/Other/Citra_mods/README.md @@ -0,0 +1,285 @@ +# Citra 3DS Mod Manager + +GUI-based mod manager for Citra 3DS emulator with HD texture pack support. + +## Overview + +These AutoHotkey v1 scripts provide a graphical interface for managing mods and HD texture packs for Nintendo 3DS games in the Citra emulator. Easily enable/disable mods without manually editing configuration files or moving directories. + +## Features + +- **Mod Management** - Enable/disable mods per game +- **HD Texture Packs** - Toggle high-resolution texture packs +- **Game Database** - CSV-based game configuration +- **GUI Interface** - No command-line or manual file editing required +- **Per-Game Settings** - Separate mod configurations for each game + +## Scripts + +| Script | Purpose | +|--------|---------| +| `Citra_Mod_Manager.ahk` | Main mod manager (mods and cheat codes) | +| `Citra_3DS_Manager.ahk` | HD texture pack manager | +| `Destination.csv` | Game database (name and title ID) | + +## Prerequisites + +### Required Software + +- **Citra Emulator** - [Download](https://citra-emu.org/) +- **AutoHotkey v1.1.37.02+** - [Download](https://www.autohotkey.com/) +- **3DS Game ROMs** - Legal backups of games you own +- **Mods/Texture Packs** (optional) - Downloaded from community + +## Installation + +### Step 1: Configure File Paths + +Both scripts require you to **edit the file paths** to match your system. + +**Citra_Mod_Manager.ahk:** +```autohotkey +; Edit these paths in the script +CitraModsPath := "C:\Users\YourName\AppData\Roaming\Citra\load\mods" +CitraConfigPath := "C:\Users\YourName\AppData\Roaming\Citra\config" +``` + +**Citra_3DS_Manager.ahk:** +```autohotkey +; Edit these paths in the script +CitraDataPath := "C:\Users\YourName\AppData\Roaming\Citra" +TexturePacksPath := CitraDataPath . "\load\textures" +``` + +### Step 2: Add Games to Database + +Edit `Destination.csv` to add your games: + +```csv +Game Name,Title ID +Super Mario 3D Land,0004000000053F00 +New Super Mario Bros,000400000007AF00 +Mario Kart 7,0004000000030700 +``` + +**Format:** +- Column 1: Friendly game name (any name you want) +- Column 2: 16-digit title ID (must be exact) + +**Finding Title IDs:** + +1. **Method 1: From Citra** + - Right-click game in Citra + - Select "Properties" or "Open Mod Location" + - The folder name is the title ID + +2. **Method 2: From 3DS Database** + - Search: [3dsdb.com](https://www.3dsdb.com/) + - Or check: [Citra Compatibility List](https://citra-emu.org/game/) + +3. **Method 3: From File Name** + - Some ROM files include the title ID in the name + - Format: `[Title ID]` + +**Example entries:** +```csv +The Legend of Zelda: Ocarina of Time 3D,0004000000033500 +Pokemon X,0004000000055D00 +Pokemon Y,0004000000055E00 +Animal Crossing: New Leaf,0004000000086300 +Fire Emblem Awakening,0004000000049000 +``` + +### Step 3: Organize Mod Files + +**Citra mod structure:** +``` +C:\Users\YourName\AppData\Roaming\Citra\load\ +├── mods\ +│ └── [Title ID]\ # e.g., 0004000000053F00 +│ ├── mod1\ +│ │ └── romfs\ +│ └── mod2\ +│ └── code.ips +└── textures\ + └── [Title ID]\ # e.g., 0004000000053F00 + └── tex1_*.png +``` + +**Where to find mods:** +- [GameBanana](https://gamebanana.com/games/4965) +- [Citra Community Forums](https://community.citra-emu.org/) +- [Reddit r/Citra](https://reddit.com/r/Citra) + +### Step 4: Keep Files Together + +Ensure these files are in the same folder: +``` +Other/Citra_mods/ +├── Citra_Mod_Manager.ahk +├── Citra_3DS_Manager.ahk +└── Destination.csv +``` + +## Usage + +### Managing Mods + +1. **Launch the mod manager:** + ```bash + Citra_Mod_Manager.ahk + ``` + +2. **Select a game** from the dropdown list + +3. **Enable/disable mods** using checkboxes + +4. **Apply changes** and restart Citra + +### Managing HD Texture Packs + +1. **Launch the texture manager:** + ```bash + Citra_3DS_Manager.ahk + ``` + +2. **Select a game** from the list + +3. **Toggle HD textures** on/off + +4. **Apply settings** - Citra config is updated automatically + +## Configuration + +### Adding More Games + +1. Open `Destination.csv` +2. Add a new line: + ```csv + Game Name,Title ID + ``` +3. Save the file +4. Restart the manager script + +### Changing Citra Paths + +If you use a portable Citra installation or custom paths: + +```autohotkey +; Edit in Citra_Mod_Manager.ahk +CitraModsPath := "D:\Emulators\Citra\user\load\mods" + +; Edit in Citra_3DS_Manager.ahk +CitraDataPath := "D:\Emulators\Citra\user" +``` + +### Custom Mod Locations + +If your mods are in a different location: + +```autohotkey +; Edit in the script +CustomModPath := "D:\My3DSMods" +``` + +## Troubleshooting + +### Issue: Games not showing in dropdown + +**Cause:** `Destination.csv` not found or incorrectly formatted + +**Solution:** +1. Verify `Destination.csv` is in the same folder as the script +2. Check CSV format (comma-separated, no extra spaces) +3. Ensure no empty lines at the end + +### Issue: Mods not applying + +**Cause:** Incorrect file paths or title IDs + +**Solution:** +1. Verify Citra paths in script match your installation +2. Double-check title ID is **exact** (16 characters) +3. Ensure mod files are in correct folder structure +4. Restart Citra after applying changes + +### Issue: Script crashes on launch + +**Cause:** AutoHotkey v1 not installed or wrong version + +**Solution:** +1. Install AutoHotkey v1.1.37.02+ +2. Right-click script → "Run as Administrator" + +### Issue: HD textures not loading + +**Cause:** Citra config not updated or cache issue + +**Solution:** +1. Clear Citra shader cache +2. Check `qt-config.ini` for correct settings: + ```ini + [Renderer] + use_custom_textures=true + ``` +3. Ensure texture pack files are in correct format + +## Advanced Usage + +### Batch Enable/Disable + +Edit script to add "Enable All" / "Disable All" buttons: + +```autohotkey +; Add to GUI +Gui Add, Button, gEnableAll, Enable All Mods + +EnableAll: + ; Loop through all checkboxes and enable + Loop, Files, %CitraModsPath%\%CurrentTitleID%\*.*, D + { + ; Enable mod logic here + } +Return +``` + +### Auto-Backup + +Add automatic backup before changing settings: + +```autohotkey +; Before modifying config +BackupFile := CitraConfigPath . "\qt-config.ini.bak" +FileCopy, %CitraConfigPath%\qt-config.ini, %BackupFile%, 1 +``` + +## Known Limitations + +1. **Requires manual path configuration** - No auto-detection +2. **CSV-based database** - Must be maintained manually +3. **Citra restart required** - Changes don't apply to running instance +4. **No mod download feature** - Must obtain mods separately + +## Screenshot + +![Citra Mod Manager](Citra_Mod_Manager.avif) + +## Resources + +- [Citra Emulator](https://citra-emu.org/) +- [Citra Mods Guide](https://citra-emu.org/wiki/user-directory/) +- [3DS Title ID Database](https://www.3dsdb.com/) +- [GameBanana 3DS Mods](https://gamebanana.com/games/4965) + +## See Also + +- [Citra_per_game_config](../Citra_per_game_config/) - Per-game emulator settings +- [AutoStartManager](../AutoStartManager.ahk) - Auto-fullscreen for Citra + +## Contributing + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines. + +--- + +**Last Updated:** 2025-12-26 diff --git a/Other/Citra_per_game_config/README.MD b/Other/Citra_per_game_config/README.MD deleted file mode 100644 index b31966b..0000000 --- a/Other/Citra_per_game_config/README.MD +++ /dev/null @@ -1 +0,0 @@ -Keep tf.ahk in the same folder as the other scripts. You need to change the filepaths to fit your system. diff --git a/Other/Citra_per_game_config/README.md b/Other/Citra_per_game_config/README.md new file mode 100644 index 0000000..cdb31f3 --- /dev/null +++ b/Other/Citra_per_game_config/README.md @@ -0,0 +1,344 @@ +# Citra Per-Game Configuration + +AutoHotkey v1 scripts for automatically applying per-game configuration settings to the Citra 3DS emulator. + +## Overview + +This collection of scripts allows you to automatically configure Citra emulator settings for specific games. When launched, these scripts modify Citra's `qt-config.ini` file to enable or disable features like: + +- HD textures +- Custom shaders +- Resolution scaling +- Audio settings +- Input configurations +- Performance optimizations + +## Features + +- **Per-Game Profiles** - Different settings for each game +- **Automatic Configuration** - Applies settings before launching +- **Easy Customization** - Duplicate and modify existing profiles +- **Safe Defaults** - Base configuration to restore standard settings +- **INI File Management** - Uses tf.ahk library for reliable editing + +## Scripts + +| Script | Purpose | +|--------|---------| +| `Citra-base.ahk` | Base configuration template | +| `Citra-per-game.ahk` | Template for per-game configurations | +| `Default.ahk` | Restore default Citra settings | +| `tf.ahk` | Text file manipulation library (required) | + +## Prerequisites + +- **Citra Emulator** - [Download](https://citra-emu.org/) +- **AutoHotkey v1.1.37.02+** - [Download](https://www.autohotkey.com/) +- **3DS Game ROMs** - Legal backups of games you own + +## Installation + +### Step 1: Configure File Paths + +**IMPORTANT:** You must edit file paths in each script to match your system. + +Open any `.ahk` script and find this line: +```autohotkey +global CitraConfigFile := "C:\Users\YourName\AppData\Roaming\Citra\config\qt-config.ini" +``` + +Change to your actual path: +```autohotkey +; Find your Citra config folder: +; Usually: C:\Users\[YourUsername]\AppData\Roaming\Citra\config\ +global CitraConfigFile := "C:\Users\ActualUsername\AppData\Roaming\Citra\config\qt-config.ini" +``` + +**Finding your Citra config:** +1. Press `Win+R` +2. Type: `%appdata%\Citra\config` +3. Press Enter +4. Copy the full path shown in Explorer's address bar +5. Add `\qt-config.ini` at the end + +### Step 2: Keep Files Together + +Ensure all files are in the same directory: +``` +Other/Citra_per_game_config/ +├── Citra-base.ahk +├── Citra-per-game.ahk +├── Default.ahk +└── tf.ahk # REQUIRED - Do not delete! +``` + +**⚠️ Important:** `tf.ahk` must be in the same folder as the other scripts! + +### Step 3: Backup Original Config + +Before using these scripts: +```bash +# Navigate to Citra config folder +cd %appdata%\Citra\config + +# Create backup +copy qt-config.ini qt-config.ini.backup +``` + +## Usage + +### Using Pre-Configured Game Profiles + +1. **Edit the script** for your game +2. **Update file paths** (see Installation) +3. **Run the script:** + ```bash + # Double-click the .ahk file + Citra-per-game.ahk + ``` +4. **Launch Citra** normally - settings are applied + +### Restoring Default Settings + +```bash +# Run the default script +Default.ahk + +# Or manually restore backup +copy qt-config.ini.backup qt-config.ini +``` + +## Creating Custom Game Profiles + +### Method 1: Duplicate Existing Script + +1. **Copy** `Citra-per-game.ahk` +2. **Rename** to your game: + ``` + Pokemon-X.ahk + Zelda-OOT.ahk + ``` +3. **Edit** the settings inside +4. **Update** file paths + +### Method 2: Start from Template + +**Template structure:** +```autohotkey +#Include %A_ScriptDir%\tf.ahk + +; ============================================ +; Game: Your Game Name +; ============================================ + +; Set your Citra config path +global CitraConfigFile := "C:\Users\YourName\AppData\Roaming\Citra\config\qt-config.ini" + +; Enable HD Textures +tf_Replace(CitraConfigFile, "custom_textures\use_custom_textures=false", "custom_textures\use_custom_textures=true") + +; Set Resolution Scale +tf_Replace(CitraConfigFile, "resolution_factor\default=true", "resolution_factor\default=false") +tf_Replace(CitraConfigFile, "resolution_factor=1", "resolution_factor=3") + +; Enable VSYNC +tf_Replace(CitraConfigFile, "use_vsync_new=false", "use_vsync_new=true") + +MsgBox, Configuration applied for Your Game Name! +ExitApp +``` + +## Common Settings + +### Graphics Settings + +**Enable HD Textures:** +```autohotkey +tf_Replace(CitraConfigFile, "custom_textures\use_custom_textures=false", "custom_textures\use_custom_textures=true") +``` + +**Resolution Scaling:** +```autohotkey +; Disable auto resolution +tf_Replace(CitraConfigFile, "resolution_factor\default=true", "resolution_factor\default=false") + +; Set scale (1-10) +tf_Replace(CitraConfigFile, "resolution_factor=1", "resolution_factor=3") +; 1 = Native (400x240) +; 2 = 2x (800x480) +; 3 = 3x (1200x720) +; 4 = 4x (1600x960) +``` + +**Enable Shaders:** +```autohotkey +tf_Replace(CitraConfigFile, "shaders_accurate_mul=false", "shaders_accurate_mul=true") +``` + +### Performance Settings + +**Enable Frame Limit:** +```autohotkey +tf_Replace(CitraConfigFile, "use_frame_limit=false", "use_frame_limit=true") +tf_Replace(CitraConfigFile, "frame_limit=100", "frame_limit=100") +``` + +**Enable VSync:** +```autohotkey +tf_Replace(CitraConfigFile, "use_vsync_new=false", "use_vsync_new=true") +``` + +**CPU Clock Speed:** +```autohotkey +tf_Replace(CitraConfigFile, "cpu_clock_percentage=100", "cpu_clock_percentage=150") +; 100 = Default +; 150 = 1.5x speed (may improve performance) +``` + +### Audio Settings + +**Enable Audio Stretching:** +```autohotkey +tf_Replace(CitraConfigFile, "enable_audio_stretching=false", "enable_audio_stretching=true") +``` + +**Set Audio Backend:** +```autohotkey +tf_Replace(CitraConfigFile, "output_engine=auto", "output_engine=cubeb") +; Options: auto, cubeb, sdl2 +``` + +## Finding INI Settings + +### Method 1: Compare Configs + +1. Make a backup: `copy qt-config.ini before.ini` +2. Change setting in Citra GUI +3. Close Citra +4. Compare files: + ```bash + fc before.ini qt-config.ini + ``` +5. Note the changed line + +### Method 2: Search INI File + +Open `qt-config.ini` in a text editor and search for: +- `[Renderer]` - Graphics settings +- `[System]` - CPU/Region settings +- `[Audio]` - Audio settings +- `[Controls]` - Input settings + +## Troubleshooting + +### Issue: Settings don't apply + +**Cause:** Citra is running when script executes + +**Solution:** +1. Close Citra completely +2. Run the configuration script +3. Launch Citra + +### Issue: "File not found" error + +**Cause:** Incorrect CitraConfigFile path + +**Solution:** +1. Verify path is correct +2. Check for typos +3. Use full absolute path +4. Ensure `qt-config.ini` exists + +### Issue: Script errors with tf.ahk + +**Cause:** tf.ahk not in same folder + +**Solution:** +1. Download or copy tf.ahk +2. Place in same directory as other scripts +3. Verify with: `dir tf.ahk` + +### Issue: Settings revert after Citra closes + +**Cause:** Citra overwrites config on exit + +**Solution:** +- Apply settings while Citra is closed +- Or mark `qt-config.ini` as read-only (not recommended) + +## Advanced Usage + +### Backup Before Changes + +```autohotkey +; Add at start of script +BackupFile := CitraConfigFile . ".backup-" . A_Now +FileCopy, %CitraConfigFile%, %BackupFile% +``` + +### Conditional Settings + +```autohotkey +; Check current value before changing +currentValue := tf_ReadLine(CitraConfigFile, "resolution_factor=") + +if (InStr(currentValue, "resolution_factor=1")) { + ; Only change if currently at 1x + tf_Replace(CitraConfigFile, "resolution_factor=1", "resolution_factor=3") +} +``` + +### Launch Citra After Config + +```autohotkey +; At end of script, after applying settings +CitraPath := "C:\Program Files\Citra\citra-qt.exe" +GamePath := "D:\Games\3DS\MyGame.3ds" + +Run, "%CitraPath%" "%GamePath%" +ExitApp +``` + +## Game-Specific Recommendations + +### Pokemon X/Y +- Resolution: 2x-3x +- Enable HD textures if available +- CPU Clock: 100% (higher may cause issues) + +### Legend of Zelda: Ocarina of Time 3D +- Resolution: 4x+ +- Enable accurate shader multiplication +- HD textures strongly recommended + +### Super Mario 3D Land +- Resolution: 3x-4x +- VSync: On +- Frame limit: 100% + +## Known Limitations + +1. **Manual path configuration required** - No auto-detection +2. **Citra must be closed** - Settings won't apply to running instance +3. **No GUI** - Command-line/script-based only +4. **Backup recommended** - No built-in config restore + +## Resources + +- [Citra Wiki - User Directory](https://citra-emu.org/wiki/user-directory/) +- [Citra Configuration Guide](https://citra-emu.org/wiki/dumping-save-data-from-a-3ds-console/) +- [tf.ahk Library](https://www.autohotkey.com/board/topic/78271-txt-file-manipulation-functions/) + +## See Also + +- [Citra_mods](../Citra_mods/) - Mod and texture pack manager +- [AutoStartManager](../AutoStartManager.ahk) - Auto-fullscreen for Citra + +## Contributing + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines. + +--- + +**Last Updated:** 2025-12-26 diff --git a/Other/Downloader/README.MD b/Other/Downloader/README.MD deleted file mode 100644 index ae37182..0000000 --- a/Other/Downloader/README.MD +++ /dev/null @@ -1,3 +0,0 @@ -You need to download [yt-dl](https://github.com/yt-dlp/yt-dlp/releases) and [spotdl](https://github.com/spotDL/spotify-downloader/releases) and put them in the same folder as the scripts for it to work. It will download the music/video files to your music folder under your user account. You also need to get FFMPEG, get it by simply running the cmd file in the same directory as you have your spotdl executable. PS: rename the spotdl exe file to "spotdl.exe" - -![alt text](https://github.com/Ven0m0/Scripts/blob/main/Other/Downloader/Downloader.avif) diff --git a/Other/Downloader/README.md b/Other/Downloader/README.md new file mode 100644 index 0000000..78a62e2 --- /dev/null +++ b/Other/Downloader/README.md @@ -0,0 +1,317 @@ +# YouTube & Spotify Downloader + +GUI-based media downloaders for YouTube videos/audio and Spotify playlists/tracks. + +## Overview + +This directory contains AutoHotkey v1 scripts that provide a user-friendly graphical interface for downloading media from YouTube and Spotify using `yt-dlp` and `spotdl` backends. + +## Features + +- **YouTube Downloader** - Download videos or extract audio from YouTube +- **Spotify Downloader** - Download songs from Spotify playlists or tracks +- **Combined Downloader** - All-in-one interface for both services +- **Quality Selection** - Choose video resolution and audio bitrate +- **GUI Interface** - No command-line knowledge required +- **Automatic Updates** - Update yt-dlp via included script + +## Scripts + +| Script | Purpose | +|--------|---------| +| `YT_Spotify_Downloader.ahk` | Combined YouTube/Spotify downloader (recommended) | +| `update.cmd` | Updates yt-dlp to the latest version | + +## Prerequisites + +### Required Downloads + +1. **yt-dlp** (YouTube downloader backend) + - Download: [yt-dlp releases](https://github.com/yt-dlp/yt-dlp/releases) + - Get: `yt-dlp.exe` (Windows executable) + - Place in the same folder as the scripts + +2. **spotdl** (Spotify downloader backend) + - Download: [spotdl releases](https://github.com/spotDL/spotify-downloader/releases) + - Get: `spotdl.exe` (Windows executable) + - **Important:** Rename the file to exactly `spotdl.exe` + - Place in the same folder as the scripts + +3. **FFMPEG** (Required for audio processing) + - Run the included `update.cmd` file to automatically download FFMPEG + - Or download manually from [ffmpeg.org](https://ffmpeg.org/download.html) + - Place `ffmpeg.exe` in the same folder + +### Software Requirements + +- **AutoHotkey v1.1.37.02+** - [Download](https://www.autohotkey.com/) +- **Windows 10/11** - Required for the executables +- **Internet connection** - For downloading media + +## Installation + +### Quick Setup + +1. **Download dependencies:** + ```bash + # Place these files in Other/Downloader/: + - yt-dlp.exe + - spotdl.exe (renamed from spotdl-*.exe) + - ffmpeg.exe (run update.cmd or download manually) + ``` + +2. **Verify file structure:** + ``` + Other/Downloader/ + ├── YT_Spotify_Downloader.ahk + ├── update.cmd + ├── yt-dlp.exe ← Download this + ├── spotdl.exe ← Download and rename this + └── ffmpeg.exe ← Run update.cmd or download + ``` + +3. **Run the downloader:** + ```bash + # Double-click to run + YT_Spotify_Downloader.ahk + ``` + +### Detailed Setup Steps + +#### Step 1: Download yt-dlp + +1. Go to [yt-dlp releases](https://github.com/yt-dlp/yt-dlp/releases) +2. Download `yt-dlp.exe` from the latest release +3. Move it to `Other/Downloader/` + +#### Step 2: Download spotdl + +1. Go to [spotdl releases](https://github.com/spotDL/spotify-downloader/releases) +2. Download the Windows executable (e.g., `spotdl-4.2.0-win32.exe`) +3. **Rename it to exactly `spotdl.exe`** +4. Move it to `Other/Downloader/` + +#### Step 3: Get FFMPEG + +**Method 1: Automatic (Recommended)** +```bash +# Run the update script +update.cmd +``` + +**Method 2: Manual** +1. Download FFMPEG from [ffmpeg.org](https://ffmpeg.org/download.html) +2. Extract `ffmpeg.exe` from the archive +3. Move it to `Other/Downloader/` + +## Usage + +### YouTube Downloads + +1. **Launch the downloader:** + ```bash + YT_Spotify_Downloader.ahk + ``` + +2. **Enter YouTube URL:** + - Paste video URL (e.g., `https://youtube.com/watch?v=...`) + - Or playlist URL + +3. **Select quality:** + - Video: 1080p, 720p, 480p, etc. + - Audio: MP3, M4A, FLAC + +4. **Click Download** + +5. **Files saved to:** + ``` + C:\Users\YourName\Music\ + ``` + +### Spotify Downloads + +1. **Launch the downloader** + +2. **Enter Spotify URL:** + - Track: `https://open.spotify.com/track/...` + - Playlist: `https://open.spotify.com/playlist/...` + - Album: `https://open.spotify.com/album/...` + +3. **Click Download** + +4. **Files saved to:** + ``` + C:\Users\YourName\Music\ + ``` + +### Output Location + +By default, all downloads are saved to your **Music folder**: +``` +C:\Users\[YourUsername]\Music\ +``` + +## Configuration + +### Changing Output Directory + +Edit the script to change where files are saved: + +```autohotkey +; Find this line in YT_Spotify_Downloader.ahk +outputPath := A_MyDocuments . "\Music" + +; Change to your preferred location +outputPath := "D:\Downloads\Music" +``` + +### Changing Default Quality + +```autohotkey +; YouTube default quality (find and edit) +defaultQuality := "1080" ; Change to: 720, 480, 360 + +; Audio default format +defaultFormat := "mp3" ; Change to: m4a, flac, wav +``` + +## Updating + +### Update yt-dlp + +```bash +# Run the update script +update.cmd + +# Or download latest manually from GitHub +``` + +### Update spotdl + +1. Download latest release +2. Rename to `spotdl.exe` +3. Replace old file + +## Troubleshooting + +### Issue: "File not found" error + +**Cause:** Dependencies not in correct location + +**Solution:** +1. Verify all files are in `Other/Downloader/` directory +2. Check file names are **exact**: + - `yt-dlp.exe` (not `yt-dlp-*.exe`) + - `spotdl.exe` (not `spotdl-4.2.0-win32.exe`) + - `ffmpeg.exe` (not `ffmpeg-*.exe`) + +### Issue: Downloads fail + +**Cause:** Outdated yt-dlp or spotdl + +**Solution:** +```bash +# Update yt-dlp +update.cmd + +# Redownload spotdl latest version +``` + +### Issue: No audio in video + +**Cause:** Missing FFMPEG + +**Solution:** +1. Run `update.cmd` to get FFMPEG +2. Or download manually and place in folder + +### Issue: Spotify downloads incomplete + +**Possible causes:** +1. Invalid Spotify URL +2. Private playlist +3. Spotdl not authenticated + +**Solution:** +- Ensure playlist/track is public +- Check URL is correct format +- Try re-downloading spotdl + +### Issue: Script won't run + +**Cause:** AutoHotkey not installed or wrong version + +**Solution:** +1. Install AutoHotkey v1.1.37.02+ +2. Right-click script → Run as Administrator + +## Security Note + +⚠️ **Input Validation:** The scripts have been updated with input validation to prevent command injection vulnerabilities. Do not modify the validation code unless you understand the security implications. + +```autohotkey +; Security feature - do not remove +ValidateInput(input) { + if RegExMatch(input, "[&|;<>()`$^""]") { + return false + } + return true +} +``` + +## Legal Notice + +**Important:** Downloading copyrighted content may violate laws in your country. These tools are provided for: + +- Downloading your own content +- Content with explicit permission +- Public domain content +- Fair use purposes + +**The authors are not responsible for any misuse of these tools.** + +## Known Limitations + +1. **YouTube:** + - Age-restricted videos may require cookies + - Some videos may be geo-blocked + - Live streams not supported + +2. **Spotify:** + - Requires songs to be on YouTube (uses YouTube as source) + - May not match exact Spotify version + - Quality depends on YouTube source + +## Advanced Usage + +### Custom yt-dlp Parameters + +Edit script to add custom parameters: + +```autohotkey +; Add custom yt-dlp options +customParams := "--add-metadata --embed-thumbnail" +cmd := ytdlpPath . " " . customParams . " " . url +``` + +### Batch Downloads + +For multiple URLs, create a text file with one URL per line, then modify script to read from file. + +## Screenshot + +![Downloader Interface](Downloader.avif) + +## Resources + +- [yt-dlp Documentation](https://github.com/yt-dlp/yt-dlp#readme) +- [spotdl Documentation](https://github.com/spotDL/spotify-downloader#readme) +- [FFMPEG Documentation](https://ffmpeg.org/documentation.html) + +## Contributing + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines. + +--- + +**Last Updated:** 2025-12-26 diff --git a/Other/Robocopy/README.md b/Other/Robocopy/README.md new file mode 100644 index 0000000..93cd99a --- /dev/null +++ b/Other/Robocopy/README.md @@ -0,0 +1,95 @@ +# Robocopy Utilities + +Batch script wrappers for Windows Robocopy command, optimized for fast file copying and filtering by extension. + +## Overview + +This directory contains CMD/Batch scripts that simplify using Microsoft's **Robocopy** (Robust File Copy) utility for common file management tasks. These scripts are pre-configured for specific use cases like copying images or performing fast mass copies. + +## Features + +- **Extension Filtering** - Copy only specific file types +- **Multi-threaded** - Faster copying with parallel operations +- **Recursive** - Automatically copy subdirectories +- **Logging** - Optional copy operation logs +- **Simple Configuration** - Edit paths directly in script + +## Scripts + +| Script | Purpose | +|--------|---------| +| `Copy_images.cmd` | Copy image files (jpg, png, webp, bmp, ico) | +| `robocopy_wrapper.cmd` | General-purpose robocopy wrapper | +| `Fast_mass_copy.txt` | Documentation for fast copy parameters | + +## Prerequisites + +- **Windows 10/11** - Robocopy is built-in +- **Source files** - Files to copy +- **Destination folder** - Must exist or will be created + +## Usage + +### Copy Images + +**Purpose:** Copy all image files from one location to another, including subdirectories. + +1. **Edit the script** `Copy_images.cmd`: + ```cmd + set ext=*.jpg *.png *.webp *.bmp *.ico + robocopy "input Path" "output path" %ext% /s /MT:32 + ``` + +2. **Configure paths:** + - Replace `"input Path"` with your source directory + - Replace `"output path"` with your destination directory + +3. **Run the script:** + ```cmd + Copy_images.cmd + ``` + +## Customization + +### Add More File Extensions + +```cmd +set ext=*.jpg *.png *.gif *.svg *.webp +``` + +### Change Thread Count + +```cmd +/MT:8 # Fewer threads (safer) +/MT:32 # Default (balanced) +/MT:64 # More threads (faster) +``` + +## Examples + +### Copy Photos Only + +```cmd +set ext=*.jpg *.jpeg *.png *.raw +robocopy "C:\Pictures" "D:\Backup" %ext% /s /MT:32 +``` + +### Copy Videos + +```cmd +set ext=*.mp4 *.mkv *.avi *.mov +robocopy "D:\Videos" "E:\Backup" %ext% /s /MT:16 +``` + +## Resources + +- [Robocopy Documentation](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy) +- [Fast_mass_copy.txt](Fast_mass_copy.txt) - Additional parameters + +## Contributing + +See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines. + +--- + +**Last Updated:** 2025-12-26 diff --git a/Other/Robocopy/TODO.md b/Other/Robocopy/TODO.md deleted file mode 100644 index 3ea3ed1..0000000 --- a/Other/Robocopy/TODO.md +++ /dev/null @@ -1 +0,0 @@ -robocopy ahk or cmd wrappper diff --git a/Other/Robocopy/readme.md b/Other/Robocopy/readme.md deleted file mode 100644 index 89bfb37..0000000 --- a/Other/Robocopy/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -![Image copy script](/Other/Robocopy/Copy_images.cmd) - -It copies only file extentions for images. You can modify the input, output and file extentions for you needs diff --git a/README.md b/README.md index 30d8733..72c6a52 100644 --- a/README.md +++ b/README.md @@ -239,23 +239,29 @@ This repository has undergone a **comprehensive migration** to AutoHotkey v2.0 w ### For Users -- **This README** - Quick start and overview +- **[README.md](README.md)** (this file) - Quick start and overview +- **[EXAMPLES.md](EXAMPLES.md)** - Common usage patterns and practical examples - **Script-specific READMEs** - See subdirectories: - - `Other/Downloader/README.MD` - - `Other/Citra_mods/README.MD` - - `Other/Citra_per_game_config/README.MD` - - `AHK/GUI/README.md` + - [Other/Downloader/](Other/Downloader/README.md) + - [Other/Citra_mods/](Other/Citra_mods/README.md) + - [Other/Citra_per_game_config/](Other/Citra_per_game_config/README.md) + - [AHK_v2/](AHK_v2/README.md) + - [AHK_v2/GUI/](AHK_v2/GUI/README.md) + - [Lib/](Lib/README.md) ### For Developers & AI Assistants +- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Contribution guidelines and standards - **[CLAUDE.md](CLAUDE.md)** - Comprehensive development guide (1700+ lines) - Codebase structure and conventions - v2 migration strategy and syntax reference - Common patterns and templates - Known issues and technical debt - CI/CD workflows and testing - - **[GEMINI.md](GEMINI.md)** - Additional AI assistant documentation +- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** - Community guidelines +- **[CHANGELOG.md](CHANGELOG.md)** - Version history and release notes +- **[Links.md](Links.md)** - Useful resources and external links ---