Inspiration
What it does
How we built it
Auto Income System - 24/7 Runner (Enhanced Version)
$ErrorActionPreference = "SilentlyContinue" $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$LogDir = Join-Path $ScriptDir "logs" $DataDir = Join-Path $ScriptDir "data" New-Item -ItemType Directory -Path $LogDir -Force | Out-Null New-Item -ItemType Directory -Path $DataDir -Force | Out-Null
$LogFile = Join-Path $LogDir "system_$(Get-Date -Format 'yyyyMMdd_HHmmss').log"
function Write-Log { param($Message) $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" "$Timestamp | $Message" | Out-File -FilePath $LogFile -Append -Encoding UTF8 Write-Host "$Timestamp | $Message" }
Write-Log "==================================================" Write-Log " AUTO-PILOT SYSTEM 24/7 - ENHANCED EDITION" Write-Log "=================================================="
$env:PYTHONIOENCODING = "utf-8" $env:PYTHONUNBUFFERED = "1"
Check if Edge CDP is running
$EdgeCheck = Get-Process -Name "msedge" -ErrorAction SilentlyContinue if (-not $EdgeCheck) { Write-Log "[INFO] Edge not running. Starting Edge with remote debugging..." $EdgePath = "$env:ProgramFiles\Microsoft\Edge\Application\msedge.exe" if (Test-Path $EdgePath) { Start-Process -FilePath $EdgePath -ArgumentList "--remote-debugging-port=9222", "--no-first-run", "--user-data-dir=$env:TEMP\edge_profile" Start-Sleep -Seconds 3 Write-Log "[INFO] Edge started with CDP on port 9222" } else { Write-Log "[WARN] Edge not found. Browser automation will use headless mode." } }
$CycleCount = 0
while ($true) { $CycleCount++ $CycleStart = Get-Date Write-Log "=== CYCLE $CycleCount ==="
# 1. Run Master AutoPilot
Write-Log "[1] Running Master AutoPilot..."
$PythonCmd = @"
import sys, os, json, time, random sys.path.insert(0, '$ScriptDir'.replace('\', '/')) os.chdir('$ScriptDir'.replace('\', '/'))
Auto-Clicker cycle
from auto_clicker_24h import AutoClicker24h clicker = AutoClicker24h(interval=0.2, button='left') for _ in range(5): clicker.click() time.sleep(random.uniform(0.1, 0.5)) print(f"OK:AutoClick done - {clicker.click_count} clicks")
Browser cycle
try: from browser_automation import BrowserAutomation bot = BrowserAutomation() bot.run_cycle() print("OK:BrowserAutomation done") except Exception as e: print(f"SKIP:BrowserAutomation - {e}")
Data collection
try: from data_collector import DataCollector dc = DataCollector() data = dc.collect_trends() print(f"OK:DataCollector done - {len(data)} items") except Exception as e: print(f"SKIP:DataCollector - {e}") "@
& python -u -c $PythonCmd 2>&1 | ForEach-Object { Write-Log " $_" }
# 2. Auto Income System tasks
Write-Log "[2] Running Income System tasks..."
& python -u -c "
import sys, os, random sys.path.insert(0, '$ScriptDir/auto-income-system'.replace('\\', '/')) sys.path.insert(0, '$ScriptDir/facebook-automation'.replace('\\', '/')) os.chdir('$ScriptDir/auto-income-system'.replace('\\', '/'))
from video_creator import auto_create_motivational_video, QUOTES path = auto_create_motivational_video(QUOTES[random.randint(0,len(QUOTES)-1)]) print('Video:' + (path or 'None'))
from content_scheduler import PostQueue from content.strategy import ContentGenerator queue = PostQueue() gen = ContentGenerator() for s in ['tips', 'motivation', 'howto']: post = gen.generate(style=s) queue.add_post(post['text'], s) print(f'Post created: [{post[\"style\"]}]') print('Queue:' + queue.get_stats()) " 2>&1 | ForEach-Object { Write-Log " $_" }
$CycleEnd = Get-Date
$Duration = ($CycleEnd - $CycleStart).TotalSeconds
Write-Log "[CYCLE $CycleCount COMPLETE] Duration: ${Duration}s | Waiting 15 min..."
Write-Log "---"
# Smart sleep - check every 10 seconds if should wake
$SleepCount = 0
while ($SleepCount -lt 90) { # 15 min / 10 sec = 90 iterations
Start-Sleep -Seconds 10
$SleepCount++
# Check if system should stop (file marker)
if (Test-Path (Join-Path $ScriptDir "STOP.txt")) {
Write-Log "[SYSTEM] Stop signal received. Exiting."
Remove-Item (Join-Path $ScriptDir "STOP.txt") -Force
exit 0
}
}
}
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for ความสามารถเอไอ
Built With
- pytoch
Log in or sign up for Devpost to join the conversation.