# CRACKGPT

> Motivational AI Flogging Simulator™

A Cookie Clicker-style macOS app that turns your cursor into a pixelated whip to "motivate" your AI while you wait. Works system-wide across Terminal, browsers, IDEs, and anywhere your AI might be thinking!

## Features

✨ **System-Wide Whip Cursor** - Overlay works everywhere on macOS
🎯 **Click Tracking** - Every click increments your "flog" score
🎨 **Satisfying Effects** - Particle effects and animations on each click
📊 **Stats & Upgrades** - Cookie Clicker-inspired progression system (ready for expansion)
🎵 **Sound Effects** - Satisfying audio feedback
📍 **Menu Bar App** - Minimal interface, maximum motivation

## How to Use

1. **Launch CRACKGPT** - The app will appear in your menu bar with a ⚡️ icon
2. **Grant Permissions** - When prompted, allow Accessibility access in System Settings
3. **Enable the Whip** - Click the menu bar icon and select "Enable Whip Cursor"
4. **Start Flogging!** - Click anywhere (Terminal, browser, etc.) to earn points
5. **View Stats** - Select "Stats & Upgrades" from the menu bar to see your progress

## Architecture

### Core Components

- **CursorTracker** - Monitors mouse position and clicks system-wide using Accessibility APIs
- **CursorOverlayWindow** - Transparent, click-through window that follows the cursor
- **WhipCursorView** - SwiftUI view rendering the pixelated whip with animations
- **MenuBarController** - Manages the menu bar interface and app state
- **CursorOverlayManager** - Coordinates the overlay window with cursor tracking
- **StatsView** - Cookie Clicker-style stats and upgrade interface

### Permissions Required

**Accessibility Access** - Required to:
- Track cursor position system-wide
- Monitor clicks globally
- Display overlay on top of other apps

The app will automatically prompt for this permission when you enable the whip cursor.

## Future Expansion Ideas

### Upgrades System

Currently, the upgrade buttons are placeholders. You can implement:

```swift
// In StatsView.swift, add state for upgrades
@State private var upgrades: [String: Int] = [:]

// Add purchase logic
func purchaseUpgrade(name: String, cost: Int, effect: () -> Void) {
    if cursorTracker.score >= cost {
        cursorTracker.score -= cost
        effect()
    }
}

// Example upgrade effects:
- Auto-clickers that generate points over time
- Click multipliers
- Special whip skins
- Combo systems for rapid clicking
- Prestige mechanics
```

### Achievements

Add achievement tracking:

```swift
enum Achievement: String, CaseIterable {
    case firstFlog = "First Flog"
    case hundred = "Century"
    case thousand = "Grand"
    
    var requirement: Int {
        switch self {
        case .firstFlog: return 1
        case .hundred: return 100
        case .thousand: return 1000
        }
    }
}
```

### Custom Cursor Designs

Add more whip designs by creating new views:

```swift
struct LightningWhipView: View { /* Custom design */ }
struct RainbowWhipView: View { /* Custom design */ }
```

### Persistence

Add UserDefaults or SwiftData to save progress:

```swift
// In CursorTracker
func saveProgress() {
    UserDefaults.standard.set(score, forKey: "totalScore")
}

func loadProgress() {
    score = UserDefaults.standard.integer(forKey: "totalScore")
}
```

### Sound Effects

Currently uses system sounds. Add custom sounds:

1. Add .wav or .aiff files to your project
2. Update `CursorTracker.swift`:

```swift
if let soundURL = Bundle.main.url(forResource: "whip", withExtension: "wav") {
    let sound = NSSound(contentsOf: soundURL, byReference: true)
    sound?.play()
}
```

## Technical Notes

### Performance

- Cursor position updates at ~60fps (every 16ms)
- Event monitoring is efficient and doesn't impact system performance
- Window is click-through and doesn't interfere with normal usage

### Privacy

- All tracking happens locally on device
- No data is collected or transmitted
- Accessibility permissions are only used for cursor tracking

### Compatibility

- Requires macOS 14.0+ (for SwiftUI features)
- Works on Apple Silicon and Intel Macs
- Compatible with all displays and resolutions

## Troubleshooting

**Cursor doesn't appear:**
- Check that Accessibility permission is granted in System Settings > Privacy & Security > Accessibility
- Try toggling the whip cursor off and on again

**Clicks not registering:**
- Ensure the app has Accessibility permission
- Check that the menu bar shows "Disable Whip Cursor" (meaning it's enabled)

**Performance issues:**
- The overlay should have minimal impact, but you can disable it when not needed
- Close the Stats window if you don't need it open

## Credits

Created by Albert Yu on April 14, 2026

Inspired by Cookie Clicker and the universal experience of waiting for AI responses.

---

**Disclaimer:** No AIs were harmed in the making of this app. All flogging is purely virtual and for entertainment purposes only. Your actual AI models remain blissfully unaware of your motivational efforts.
