|
|
°²×¿H5»¥¶¯configÅäÖõ÷È¡´æÊ¾Àý
- <!DOCTYPE html>
- <!--
- 🍎½»Á÷ QQ Ⱥ£º711841924£¨ÈºÒ» - Æ»¹ûÄÚ²âȺ£©
- 🍎½»Á÷ QQ Ⱥ£º528816639
- 🍎 AIWROK ÅäÖùÜÀíÆ÷ - ¿ÉÊÓ»¯ÅäÖýçÃæ
- -->
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <title>⚙️ AIWROK ÅäÖùÜÀíÖÐÐÄ</title>
- <style>
- * { margin: 0; padding: 0; box-sizing: border-box; }
-
- :root {
- --primary: #4A90E2;
- --primary-dark: #357ABD;
- --success: #2ECC71;
- --warning: #F39C12;
- --danger: #E74C3C;
- --purple: #9B59B6;
- --bg-dark: #1a1a2e;
- --bg-card: #16213e;
- --bg-input: #0f0f23;
- --text-primary: #ffffff;
- --text-secondary: #a0a0a0;
- --border-color: rgba(255, 255, 255, 0.1);
- }
- body {
- font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
- background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-card) 50%, #0f0f23 100%);
- color: var(--text-primary);
- min-height: 100vh;
- overflow-x: hidden;
- }
- /* QQ ȺÐÅÏ¢À¸ */
- .qq-group-bar {
- background: linear-gradient(90deg, #FF6B6B 0%, #FF8E53 50%, #FFD700 100%);
- padding: 10px 16px;
- text-align: center;
- position: relative;
- z-index: 20;
- box-shadow: 0 2px 10px rgba(0,0,0,0.3);
- }
- .qq-group-text {
- font-size: 13px;
- font-weight: 700;
- color: #fff;
- text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
- }
- .app-container {
- position: relative;
- z-index: 10;
- max-width: 600px;
- margin: 0 auto;
- padding: 16px;
- }
- /* ¶¥²¿±êÌâ */
- .header {
- background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
- border-radius: 20px;
- padding: 24px;
- margin-bottom: 20px;
- box-shadow: 0 10px 40px rgba(74, 144, 226, 0.3);
- text-align: center;
- }
- .header-icon {
- font-size: 48px;
- margin-bottom: 8px;
- }
- .header-title {
- font-size: 24px;
- font-weight: 800;
- margin-bottom: 4px;
- }
- .header-subtitle {
- font-size: 13px;
- opacity: 0.9;
- }
- /* ͳ¼Æ¿¨Æ¬ */
- .stats-row {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 12px;
- margin-bottom: 20px;
- }
- .stat-box {
- background: var(--bg-card);
- border-radius: 16px;
- padding: 16px 8px;
- text-align: center;
- border: 1px solid rgba(74, 144, 226, 0.2);
- }
- .stat-icon {
- font-size: 24px;
- margin-bottom: 4px;
- }
- .stat-value {
- font-size: 20px;
- font-weight: 800;
- color: var(--primary);
- }
- .stat-label {
- font-size: 11px;
- color: var(--text-secondary);
- margin-top: 2px;
- }
- /* ·ÖÀà±êÇ© */
- .category-tabs {
- display: flex;
- gap: 8px;
- margin-bottom: 20px;
- overflow-x: auto;
- padding-bottom: 8px;
- }
- .category-tab {
- padding: 10px 20px;
- background: var(--bg-card);
- border: 1px solid var(--border-color);
- border-radius: 25px;
- font-size: 13px;
- font-weight: 600;
- color: var(--text-secondary);
- cursor: pointer;
- white-space: nowrap;
- transition: all 0.3s ease;
- }
- .category-tab:hover {
- border-color: var(--primary);
- color: var(--primary);
- }
- .category-tab.active {
- background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
- color: white;
- border-color: transparent;
- box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
- }
- /* ÅäÖÃÁбí */
- .config-section {
- background: var(--bg-card);
- border-radius: 20px;
- padding: 20px;
- margin-bottom: 20px;
- border: 1px solid var(--border-color);
- }
- .section-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 16px;
- padding-bottom: 12px;
- border-bottom: 1px solid var(--border-color);
- }
- .section-title {
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 16px;
- font-weight: 700;
- }
- .section-icon {
- font-size: 20px;
- }
- .section-actions {
- display: flex;
- gap: 8px;
- }
- .action-btn {
- padding: 6px 12px;
- border: none;
- border-radius: 8px;
- font-size: 12px;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .btn-reset {
- background: rgba(231, 76, 60, 0.2);
- color: var(--danger);
- }
- .btn-reset:hover {
- background: rgba(231, 76, 60, 0.3);
- }
- .btn-save {
- background: rgba(46, 204, 113, 0.2);
- color: var(--success);
- }
- .btn-save:hover {
- background: rgba(46, 204, 113, 0.3);
- }
- /* ÅäÖÃÏî */
- .config-item {
- margin-bottom: 16px;
- padding-bottom: 16px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.05);
- }
- .config-item:last-child {
- margin-bottom: 0;
- padding-bottom: 0;
- border-bottom: none;
- }
- .config-label {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 8px;
- }
- .label-text {
- font-size: 14px;
- font-weight: 600;
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .label-hint {
- font-size: 11px;
- color: var(--text-secondary);
- font-weight: normal;
- }
- .config-input-wrapper {
- position: relative;
- }
- .config-input {
- width: 100%;
- padding: 12px 16px;
- border: 1px solid var(--border-color);
- border-radius: 10px;
- background: var(--bg-input);
- color: var(--text-primary);
- font-size: 14px;
- outline: none;
- transition: all 0.3s ease;
- }
- .config-input:focus {
- border-color: var(--primary);
- box-shadow: 0 0 10px rgba(74, 144, 226, 0.2);
- }
- .config-input.readonly {
- background: rgba(255, 255, 255, 0.05);
- cursor: not-allowed;
- }
- /* ¿ª¹Ø */
- .switch {
- position: relative;
- width: 50px;
- height: 26px;
- }
- .switch input {
- opacity: 0;
- width: 0;
- height: 0;
- }
- .slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #333;
- transition: .4s;
- border-radius: 26px;
- }
- .slider:before {
- position: absolute;
- content: "";
- height: 20px;
- width: 20px;
- left: 3px;
- bottom: 3px;
- background-color: white;
- transition: .4s;
- border-radius: 50%;
- }
- input:checked + .slider {
- background: linear-gradient(135deg, var(--success) 0%, #27AE60 100%);
- }
- input:checked + .slider:before {
- transform: translateX(24px);
- }
- /* °´Å¥×é */
- .button-group {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 12px;
- margin-top: 20px;
- }
- .main-btn {
- padding: 16px;
- border: none;
- border-radius: 16px;
- font-size: 16px;
- font-weight: 800;
- cursor: pointer;
- transition: all 0.3s ease;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- }
- .btn-primary {
- background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
- color: white;
- box-shadow: 0 8px 32px rgba(74, 144, 226, 0.4);
- }
- .btn-primary:hover {
- transform: translateY(-2px);
- box-shadow: 0 12px 40px rgba(74, 144, 226, 0.5);
- }
- .btn-secondary {
- background: linear-gradient(135deg, var(--purple) 0%, #8E44AD 100%);
- color: white;
- box-shadow: 0 8px 32px rgba(155, 89, 182, 0.4);
- }
- .btn-warning {
- background: linear-gradient(135deg, var(--warning) 0%, #E67E22 100%);
- color: white;
- box-shadow: 0 8px 32px rgba(243, 156, 18, 0.4);
- }
- .btn-danger {
- background: linear-gradient(135deg, var(--danger) 0%, #C0392B 100%);
- color: white;
- box-shadow: 0 8px 32px rgba(231, 76, 60, 0.4);
- }
- /* Toast */
- .toast {
- position: fixed;
- bottom: 100px;
- left: 50%;
- transform: translateX(-50%) translateY(100px);
- background: linear-gradient(135deg, var(--success) 0%, #27AE60 100%);
- color: white;
- padding: 16px 32px;
- border-radius: 50px;
- font-weight: 700;
- opacity: 0;
- transition: all 0.3s ease;
- z-index: 9999;
- box-shadow: 0 8px 32px rgba(46, 204, 113, 0.4);
- }
- .toast.show {
- opacity: 1;
- transform: translateX(-50%) translateY(0);
- }
- .toast.error {
- background: linear-gradient(135deg, var(--danger) 0%, #C0392B 100%);
- }
- /* ÈÕÖ¾´°¿Ú */
- .log-panel {
- background: var(--bg-card);
- border-radius: 20px;
- padding: 20px;
- margin-top: 20px;
- border: 1px solid var(--border-color);
- }
- .log-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 16px;
- }
- .log-title {
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 16px;
- font-weight: 700;
- }
- .log-container {
- background: var(--bg-input);
- border-radius: 12px;
- padding: 12px;
- max-height: 300px;
- overflow-y: auto;
- font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
- font-size: 12px;
- line-height: 1.8;
- }
- .log-entry {
- padding: 4px 8px;
- margin-bottom: 4px;
- border-radius: 4px;
- border-left: 3px solid var(--primary);
- }
- .log-entry.success { border-left-color: var(--success); }
- .log-entry.error { border-left-color: var(--danger); }
- .log-entry.warning { border-left-color: var(--warning); }
- /* ¶¯» */
- @keyframes slideUp {
- from { opacity: 0; transform: translateY(20px); }
- to { opacity: 1; transform: translateY(0); }
- }
- .config-section {
- animation: slideUp 0.4s ease;
- }
- </style>
- </head>
- <body>
- <!-- QQ ȺÐÅÏ¢À¸ -->
- <div class="qq-group-bar">
- <span class="qq-group-text">🍎½»Á÷ QQ Ⱥ£º711841924£¨ÈºÒ» - Æ»¹ûÄÚ²âȺ£©528816639</span>
- </div>
- <div class="app-container">
- <!-- ¶¥²¿±êÌâ -->
- <div class="header">
- <div class="header-icon">⚙️</div>
- <div class="header-title">AIWROK ÅäÖùÜÀíÖÐÐÄ</div>
- <div class="header-subtitle">¿ÉÊÓ»¯ÅäÖùÜÀí ¡¤ ʵʱͬ²½ ¡¤ ÖÇÄÜÍÆ¼ö</div>
- </div>
- <!-- ͳ¼Æ¿¨Æ¬ -->
- <div class="stats-row">
- <div class="stat-box">
- <div class="stat-icon">📊</div>
- <div class="stat-value" id="totalConfigs">0</div>
- <div class="stat-label">×ÜÅäÖÃÊý</div>
- </div>
- <div class="stat-box">
- <div class="stat-icon">✅</div>
- <div class="stat-value" id="configuredCount">0</div>
- <div class="stat-label">ÒÑÅäÖÃ</div>
- </div>
- <div class="stat-box">
- <div class="stat-icon">💾</div>
- <div class="stat-value" id="lastSaveTime">-</div>
- <div class="stat-label">×îºó±£´æ</div>
- </div>
- </div>
- <!-- ·ÖÀà±êÇ© -->
- <div class="category-tabs">
- <div class="category-tab active" data-category="all" onclick="filterCategory('all')">È«²¿</div>
- <div class="category-tab" data-category="game" onclick="filterCategory('game')">🎮 ÓÎÏ·ÅäÖÃ</div>
- <div class="category-tab" data-category="ocr" onclick="filterCategory('ocr')">🔍 OCR ÅäÖÃ</div>
- <div class="category-tab" data-category="ui" onclick="filterCategory('ui')">🎨 UI ÅäÖÃ</div>
- <div class="category-tab" data-category="network" onclick="filterCategory('network')">🌐 ÍøÂçÅäÖÃ</div>
- </div>
- <!-- ÓÎÏ·ÅäÖÃ -->
- <div class="config-section" data-category="game">
- <div class="section-header">
- <div class="section-title">
- <span class="section-icon">🎮</span>
- <span>ÓÎÏ·×Ô¶¯»¯ÅäÖÃ</span>
- </div>
- <div class="section-actions">
- <button class="action-btn btn-reset" onclick="resetGameConfig()">ÖØÖÃ</button>
- <button class="action-btn btn-save" onclick="saveGameConfig()">±£´æ</button>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 📝 ÓÎÏ·Ãû³Æ
- <span class="label-hint">Òª×Ô¶¯»¯µÄÓÎÏ·</span>
- </span>
- </div>
- <input type="text" class="config-input" id="game_name" value="ÃλÃÎ÷ÓÎ" placeholder="ÊäÈëÓÎÏ·Ãû³Æ">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- ⏱️ ÈÎÎñÑÓ³Ù (ºÁÃë)
- <span class="label-hint">²Ù×÷¼ä¸ôʱ¼ä</span>
- </span>
- </div>
- <input type="number" class="config-input" id="task_delay" value="2000" min="500" max="10000">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 🔄 ×î´óÂÖÊý
- <span class="label-hint">×î¶àÖ´ÐÐÂÖ´Î</span>
- </span>
- </div>
- <input type="number" class="config-input" id="max_rounds" value="10" min="1" max="100">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">⚔️ ÆôÓÃ×Ô¶¯Õ½¶·</span>
- <label class="switch">
- <input type="checkbox" id="enable_combat" checked>
- <span class="slider"></span>
- </label>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">💊 ×Ô¶¯ÖÎÁÆ</span>
- <label class="switch">
- <input type="checkbox" id="auto_heal" checked>
- <span class="slider"></span>
- </label>
- </div>
- </div>
- </div>
- <!-- OCR ÅäÖÃ -->
- <div class="config-section" data-category="ocr">
- <div class="section-header">
- <div class="section-title">
- <span class="section-icon">🔍</span>
- <span>OCR ʶ±ðÅäÖÃ</span>
- </div>
- <div class="section-actions">
- <button class="action-btn btn-reset" onclick="resetOcrConfig()">ÖØÖÃ</button>
- <button class="action-btn btn-save" onclick="saveOcrConfig()">±£´æ</button>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 🌐 ʶ±ðÓïÑÔ
- <span class="label-hint">OCR ʶ±ðÓïÑÔ</span>
- </span>
- </div>
- <select class="config-input" id="ocr_language">
- <option value="zh-CN">¼òÌåÖÐÎÄ</option>
- <option value="zh-TW">·±ÌåÖÐÎÄ</option>
- <option value="en">Ó¢ÎÄ</option>
- <option value="ja">ÈÕÎÄ</option>
- <option value="ko">º«ÎÄ</option>
- </select>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 🎯 ÖÃÐŶÈãÐÖµ (%)
- <span class="label-hint">×îµÍʶ±ðÖÃÐŶÈ</span>
- </span>
- </div>
- <input type="number" class="config-input" id="ocr_confidence" value="80" min="50" max="100">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- ⏰ ³¬Ê±Ê±¼ä (ºÁÃë)
- <span class="label-hint">ʶ±ð³¬Ê±ÏÞÖÆ</span>
- </span>
- </div>
- <input type="number" class="config-input" id="ocr_timeout" value="5000" min="1000" max="30000">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">🔄 ÖØÊÔ´ÎÊý</span>
- <label class="switch">
- <input type="number" class="config-input" id="ocr_retry" value="3" min="0" max="10" style="width: 100px; display: inline-block;">
- </label>
- </div>
- </div>
- </div>
- <!-- UI ÅäÖÃ -->
- <div class="config-section" data-category="ui">
- <div class="section-header">
- <div class="section-title">
- <span class="section-icon">🎨</span>
- <span>½çÃæÆ«ºÃÅäÖÃ</span>
- </div>
- <div class="section-actions">
- <button class="action-btn btn-reset" onclick="resetUiConfig()">ÖØÖÃ</button>
- <button class="action-btn btn-save" onclick="saveUiConfig()">±£´æ</button>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">🌓 Ö÷Ìâģʽ</span>
- <select class="config-input" id="ui_theme" style="width: 150px;">
- <option value="dark">ÉîÉ«Ö÷Ìâ</option>
- <option value="light">dzɫÖ÷Ìâ</option>
- <option value="auto">×Ô¶¯¸úËæ</option>
- </select>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 📏 ×ÖÌå´óС (px)
- <span class="label-hint">½çÃæ×ÖÌå´óС</span>
- </span>
- </div>
- <input type="number" class="config-input" id="ui_font_size" value="16" min="12" max="24">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">🧰 ÏÔʾ¹¤¾ßÀ¸</span>
- <label class="switch">
- <input type="checkbox" id="ui_show_toolbar" checked>
- <span class="slider"></span>
- </label>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">✨ ÆôÓö¯»Ð§¹û</span>
- <label class="switch">
- <input type="checkbox" id="ui_animation" checked>
- <span class="slider"></span>
- </label>
- </div>
- </div>
- </div>
- <!-- ÍøÂçÅäÖà -->
- <div class="config-section" data-category="network">
- <div class="section-header">
- <div class="section-title">
- <span class="section-icon">🌐</span>
- <span>ÍøÂçÇëÇóÅäÖÃ</span>
- </div>
- <div class="section-actions">
- <button class="action-btn btn-reset" onclick="resetNetworkConfig()">ÖØÖÃ</button>
- <button class="action-btn btn-save" onclick="saveNetworkConfig()">±£´æ</button>
- </div>
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 🔗 API »ù´¡µØÖ·
- <span class="label-hint">·þÎñÆ÷µØÖ·</span>
- </span>
- </div>
- <input type="text" class="config-input" id="network_base_url" value="https://api.example.com" placeholder="https://api.example.com">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- 📡 API °æ±¾
- <span class="label-hint">API °æ±¾ºÅ</span>
- </span>
- </div>
- <input type="text" class="config-input" id="network_version" value="v2" placeholder="v2">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">
- ⏰ ÇëÇó³¬Ê± (ºÁÃë)
- <span class="label-hint">ÍøÂçÇëÇó³¬Ê±</span>
- </span>
- </div>
- <input type="number" class="config-input" id="network_timeout" value="10000" min="5000" max="60000">
- </div>
- <div class="config-item">
- <div class="config-label">
- <span class="label-text">🔄 ×î´óÖØÊÔ´ÎÊý</span>
- <input type="number" class="config-input" id="network_retries" value="3" min="0" max="10" style="width: 100px; display: inline-block;">
- </div>
- </div>
- </div>
- <!-- ²Ù×÷°´Å¥×é -->
- <div class="button-group">
- <button class="main-btn btn-primary" onclick="saveAllConfigs()">
- 💾 ±£´æËùÓÐÅäÖÃ
- </button>
- <button class="main-btn btn-secondary" onclick="exportConfigs()">
- 📤 µ¼³öÅäÖÃ
- </button>
- <button class="main-btn btn-warning" onclick="importConfigs()">
- 📥 µ¼ÈëÅäÖÃ
- </button>
- <button class="main-btn btn-danger" onclick="resetAllConfigs()">
- 🗑️ »Ö¸´Ä¬ÈÏ
- </button>
- </div>
- <!-- ÈÕÖ¾´°¿Ú -->
- <div class="log-panel">
- <div class="log-header">
- <div class="log-title">
- <span class="section-icon">📋</span>
- <span>²Ù×÷ÈÕÖ¾</span>
- </div>
- </div>
- <div class="log-container" id="logContainer">
- <div class="log-empty" style="text-align: center; padding: 20px; color: #666;">
- µÈ´ý²Ù×÷...
- </div>
- </div>
- </div>
- </div>
- <!-- Toast -->
- <div class="toast" id="toast"></div>
- <script>
- // ============================================
- // AIWROK ÅäÖùÜÀíÖÐÐÄ - ºËÐÄÂß¼
- // ============================================
-
- var CONFIG = {
- VERSION: '1.0.0'
- };
- var state = {
- totalConfigs: 0,
- configuredCount: 0,
- lastSaveTime: null,
- logs: []
- };
- // ĬÈÏÅäÖÃÖµ
- var defaultConfigs = {
- // ÓÎÏ·ÅäÖÃ
- game_name: "ÃλÃÎ÷ÓÎ",
- task_delay: "2000",
- max_rounds: "10",
- enable_combat: "true",
- auto_heal: "true",
-
- // OCR ÅäÖÃ
- ocr_language: "zh-CN",
- ocr_confidence: "80",
- ocr_timeout: "5000",
- ocr_retry: "3",
-
- // UI ÅäÖÃ
- ui_theme: "dark",
- ui_font_size: "16",
- ui_show_toolbar: "true",
- ui_animation: "true",
-
- // ÍøÂçÅäÖÃ
- network_base_url: "https://api.example.com",
- network_version: "v2",
- network_timeout: "10000",
- network_retries: "3"
- };
- // ³õʼ»¯
- document.addEventListener('DOMContentLoaded', function() {
- addLog('⚙️ AIWROK ÅäÖùÜÀíÖÐÐÄ v' + CONFIG.VERSION + ' ÒÑÆô¶¯', 'success');
- loadAllConfigs();
- updateStats();
- });
- // Ìí¼ÓÈÕÖ¾
- function addLog(message, type) {
- type = type || 'info';
- var container = document.getElementById('logContainer');
-
- // ÒÆ³ý¿Õ״̬
- var emptyState = container.querySelector('.log-empty');
- if (emptyState) emptyState.remove();
-
- var entry = document.createElement('div');
- entry.className = 'log-entry ' + type;
- entry.textContent = '[' + new Date().toLocaleTimeString() + '] ' + message;
-
- container.appendChild(entry);
- container.scrollTop = container.scrollHeight;
-
- // ÏÞÖÆÈÕÖ¾ÊýÁ¿
- while (container.children.length > 50) {
- container.removeChild(container.firstChild);
- }
- }
- // ¸üÐÂͳ¼Æ
- function updateStats() {
- document.getElementById('totalConfigs').textContent = Object.keys(defaultConfigs).length;
- document.getElementById('configuredCount').textContent = state.configuredCount;
-
- if (state.lastSaveTime) {
- var time = new Date(state.lastSaveTime);
- document.getElementById('lastSaveTime').textContent =
- time.getHours().toString().padStart(2, '0') + ':' +
- time.getMinutes().toString().padStart(2, '0');
- }
- }
- // ¹ýÂË·ÖÀà
- function filterCategory(category) {
- // ¸üбêǩ״̬
- var tabs = document.querySelectorAll('.category-tab');
- for (var i = 0; i < tabs.length; i++) {
- tabs[i].classList.toggle('active', tabs[i].dataset.category === category);
- }
-
- // ¹ýÂËÅäÖÃÇø¿é
- var sections = document.querySelectorAll('.config-section');
- for (var j = 0; j < sections.length; j++) {
- var section = sections[j];
- if (category === 'all' || section.dataset.category === category) {
- section.style.display = 'block';
- } else {
- section.style.display = 'none';
- }
- }
-
- addLog('📂 Çл»µ½·ÖÀࣺ' + category, 'info');
- }
- // ¼ÓÔØÅäÖÃ
- function loadAllConfigs() {
- addLog('📥 ÕýÔÚ¼ÓÔØÅäÖÃ...', 'info');
-
- // ³¢ÊÔ´ÓÔÉú»·¾³¼ÓÔØ
- for (var key in defaultConfigs) {
- var element = document.getElementById(key);
- if (!element) continue;
-
- var value = getConfigFromNative(key);
- if (value !== null && value !== undefined && value !== '') {
- if (element.type === 'checkbox') {
- element.checked = value === 'true';
- } else {
- element.value = value;
- }
- state.configuredCount++;
- } else {
- if (element.type === 'checkbox') {
- element.checked = defaultConfigs[key] === 'true';
- } else {
- element.value = defaultConfigs[key];
- }
- }
- }
-
- addLog('✅ ÅäÖüÓÔØÍê³É', 'success');
- updateStats();
- }
- // ´ÓÔÉú»·¾³»ñÈ¡ÅäÖã¨ÊÊÅä AIWROK£©
- function getConfigFromNative(key) {
- // ÓÅÏÈʹÓà Android ÇŽӽӿÚ
- if (window.android && typeof window.android.getConfig === 'function') {
- try {
- var value = window.android.getConfig(key, '');
- console.log('´Ó android ½Ó¿Ú»ñÈ¡ÅäÖà ' + key + ': ' + value);
- return value;
- } catch (e) {
- console.error('android ½Ó¿Ú»ñÈ¡ÅäÖÃʧ°Ü:', e);
- }
- }
- // ä¯ÀÀÆ÷»·¾³Ê¹Óà localStorage Ä£Äâ
- try {
- return localStorage.getItem('AIWROK_' + key);
- } catch (e) {
- return null;
- }
- }
- // ÉèÖÃÅäÖõ½ÔÉú»·¾³£¨ÊÊÅä AIWROK£©
- function setConfigToNative(key, value) {
- // ÓÅÏÈʹÓà Android ÇŽӽӿÚ
- if (window.android && typeof window.android.setConfig === 'function') {
- try {
- var result = window.android.setConfig(key, value);
- console.log('ÉèÖÃÅäÖà ' + key + ' = ' + value + ': ' + (result ? '³É¹¦' : 'ʧ°Ü'));
- return result;
- } catch (e) {
- console.error('ÉèÖÃÅäÖÃʧ°Ü:', e);
- return false;
- }
- }
- // ä¯ÀÀÆ÷»·¾³Ê¹Óà localStorage Ä£Äâ
- try {
- localStorage.setItem('AIWROK_' + key, value);
- return true;
- } catch (e) {
- return false;
- }
- }
- // ±£´æµ¥¸ö·ÖÀàµÄÅäÖÃ
- function saveCategoryConfig(category, configKeys) {
- addLog('💾 ÕýÔÚ±£´æ' + category + 'ÅäÖÃ...', 'info');
-
- for (var i = 0; i < configKeys.length; i++) {
- var key = configKeys[i];
- var element = document.getElementById(key);
- if (!element) continue;
-
- var value;
- if (element.type === 'checkbox') {
- value = element.checked ? 'true' : 'false';
- } else {
- value = element.value;
- }
-
- setConfigToNative(key, value);
- addLog(' ✓ ' + key + ' = ' + value, 'success');
- }
-
- state.lastSaveTime = Date.now();
- state.configuredCount = Object.keys(defaultConfigs).length;
- updateStats();
-
- showToast('✅ ' + category + 'ÅäÖÃÒѱ£´æ');
- }
- // ¸÷¸ö·ÖÀàµÄ±£´æº¯Êý
- function saveGameConfig() {
- saveCategoryConfig('ÓÎÏ·', ['game_name', 'task_delay', 'max_rounds', 'enable_combat', 'auto_heal']);
- }
- function saveOcrConfig() {
- saveCategoryConfig('OCR', ['ocr_language', 'ocr_confidence', 'ocr_timeout', 'ocr_retry']);
- }
- function saveUiConfig() {
- saveCategoryConfig('UI', ['ui_theme', 'ui_font_size', 'ui_show_toolbar', 'ui_animation']);
- }
- function saveNetworkConfig() {
- saveCategoryConfig('ÍøÂç', ['network_base_url', 'network_version', 'network_timeout', 'network_retries']);
- }
- // ±£´æËùÓÐÅäÖÃ
- function saveAllConfigs() {
- addLog('💾 ÕýÔÚ±£´æËùÓÐÅäÖÃ...', 'info');
-
- for (var key in defaultConfigs) {
- var element = document.getElementById(key);
- if (!element) continue;
-
- var value;
- if (element.type === 'checkbox') {
- value = element.checked ? 'true' : 'false';
- } else {
- value = element.value;
- }
-
- setConfigToNative(key, value);
- }
-
- state.lastSaveTime = Date.now();
- state.configuredCount = Object.keys(defaultConfigs).length;
- updateStats();
-
- addLog('✅ ËùÓÐÅäÖÃÒѱ£´æ', 'success');
- showToast('✅ ËùÓÐÅäÖÃÒѱ£´æ');
- }
- // ÖØÖÃÅäÖÃ
- function resetCategoryConfig(category, configKeys, displayName) {
- addLog('🗑️ ÕýÔÚÖØÖÃ' + displayName + 'ÅäÖÃ...', 'warning');
-
- for (var i = 0; i < configKeys.length; i++) {
- var key = configKeys[i];
- var element = document.getElementById(key);
- if (!element) continue;
-
- var defaultValue = defaultConfigs[key];
- if (element.type === 'checkbox') {
- element.checked = defaultValue === 'true';
- } else {
- element.value = defaultValue;
- }
-
- addLog(' ✓ ' + key + ' »Ö¸´Îª£º' + defaultValue, 'info');
- }
-
- showToast('🗑️ ' + displayName + 'ÅäÖÃÒÑÖØÖÃ');
- }
- function resetGameConfig() {
- resetCategoryConfig('ÓÎÏ·', ['game_name', 'task_delay', 'max_rounds', 'enable_combat', 'auto_heal'], 'ÓÎÏ·');
- }
- function resetOcrConfig() {
- resetCategoryConfig('OCR', ['ocr_language', 'ocr_confidence', 'ocr_timeout', 'ocr_retry'], 'OCR');
- }
- function resetUiConfig() {
- resetCategoryConfig('UI', ['ui_theme', 'ui_font_size', 'ui_show_toolbar', 'ui_animation'], 'UI');
- }
- function resetNetworkConfig() {
- resetCategoryConfig('ÍøÂç', ['network_base_url', 'network_version', 'network_timeout', 'network_retries'], 'ÍøÂç');
- }
- function resetAllConfigs() {
- if (!confirm('È·¶¨Òª»Ö¸´ËùÓÐÅäÖÃΪĬÈÏÖµÂð£¿')) return;
-
- addLog('🗑️ ÕýÔÚ»Ö¸´ËùÓÐÅäÖÃ...', 'warning');
-
- for (var key in defaultConfigs) {
- var element = document.getElementById(key);
- if (!element) continue;
-
- var defaultValue = defaultConfigs[key];
- if (element.type === 'checkbox') {
- element.checked = defaultValue === 'true';
- } else {
- element.value = defaultValue;
- }
- }
-
- addLog('✅ ËùÓÐÅäÖÃÒѻָ´Ä¬ÈÏÖµ', 'success');
- showToast('🗑️ ËùÓÐÅäÖÃÒѻָ´Ä¬ÈÏ');
- }
- // µ¼³öÅäÖÃ
- function exportConfigs() {
- addLog('📤 ÕýÔÚµ¼³öÅäÖÃ...', 'info');
-
- var exported = {};
- for (var key in defaultConfigs) {
- var element = document.getElementById(key);
- if (!element) continue;
-
- var value;
- if (element.type === 'checkbox') {
- value = element.checked ? 'true' : 'false';
- } else {
- value = element.value;
- }
-
- exported[key] = value;
- }
-
- var jsonStr = JSON.stringify(exported, null, 2);
- addLog('✅ ÅäÖÃÒѵ¼³ö:\n' + jsonStr, 'success');
-
- // ³¢ÊÔ¸´ÖƵ½¼ôÌù°å
- if (navigator.clipboard) {
- navigator.clipboard.writeText(jsonStr).then(function() {
- showToast('📤 ÅäÖÃÒѵ¼³ö²¢¸´ÖƵ½¼ôÌù°å');
- }, function() {
- showToast('📤 ÅäÖÃÒѵ¼³ö£¨Çë²é¿´ÈÕÖ¾£©');
- });
- } else {
- showToast('📤 ÅäÖÃÒѵ¼³ö£¨Çë²é¿´ÈÕÖ¾£©');
- }
- }
- // µ¼ÈëÅäÖÃ
- function importConfigs() {
- var jsonStr = prompt('ÇëÕ³ÌùÅäÖà JSON Êý¾Ý:');
- if (!jsonStr) return;
-
- try {
- var imported = JSON.parse(jsonStr);
- addLog('📥 ÕýÔÚµ¼ÈëÅäÖÃ...', 'info');
-
- for (var key in imported) {
- var element = document.getElementById(key);
- if (!element) continue;
-
- var value = imported[key];
- if (element.type === 'checkbox') {
- element.checked = value === 'true';
- } else {
- element.value = String(value);
- }
-
- addLog(' ✓ µ¼Èë ' + key + ' = ' + value, 'success');
- }
-
- addLog('✅ ÅäÖõ¼ÈëÍê³É', 'success');
- showToast('📥 ÅäÖÃÒѳɹ¦µ¼Èë');
- } catch (e) {
- addLog('❌ ÅäÖõ¼Èëʧ°Ü£º' + e.message, 'error');
- showToast('❌ ÅäÖøñʽ´íÎó');
- }
- }
- // ÏÔʾ Toast
- function showToast(message, isError) {
- var toast = document.getElementById('toast');
- toast.textContent = message;
- toast.className = 'toast show' + (isError ? ' error' : '');
-
- setTimeout(function() {
- toast.className = 'toast';
- }, 3000);
- }
- </script>
- </body>
- </html>
¸´ÖÆ´úÂë
- //³õʼ»¯Ò»¸öactivityÒ³Ãæ
- //🍎½»Á÷QQȺ711841924Ⱥһ£¬Æ»¹ûÄÚ²âȺ£¬528816639
- var ac = new activity();
- ac.loadXML(`
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- >
-
- <WebView
- android:id="@+id/web"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
- </LinearLayout>
- `);
- sleep.millisecond(400);
- // »ñÈ¡ WebView ×é¼þ
- var web1 = ac.findWebViewById('web');
- // ¼ÓÔØ±¾µØ HTML Îļþ£¨Ê¹Óþø¶Ô·¾¶£©
- web1.url('/´úÂë/h5.html');
- // ÈýÃëµ¹¼ÆÊ±
- printl("\n3 ÃëºóÆô¶¯...");
- for (var i = 3; i > 0; i--) {
- printl(i + "...");
- sleep.millisecond(1000);
- }
- printl("Æô¶¯Íê³É£¡\n");
- Import("Ö÷½Å±¾.js");
¸´ÖÆ´úÂë
|
|