Commit Graph

10 Commits

Author SHA1 Message Date
LemonNexus 426f0a2ad3 fix: QObject signals issue - BasePlugin doesn't inherit from QObject
BUG: SkillScannerPlugin cannot be converted to PyQt6.QtCore.QObject

CAUSE: BasePlugin inherits from ABC, not QObject. Qt signals (pyqtSignal)
must be defined in a QObject subclass.

FIX:
1. Created SignalHelper(QObject) class to hold all signals:
   - hotkey_triggered
   - update_status_signal
   - update_session_table_signal
   - update_counters_signal
   - enable_scan_button_signal

2. In SkillScannerPlugin.initialize():
   - Create self._signals = SignalHelper()
   - Connect signals from self._signals (not self)

3. In get_ui():
   - Connect enable_scan_button_signal after scan_page_btn is created

4. Updated all signal emits to use self._signals.emit()

This allows the plugin to use Qt signals for thread-safe UI updates
without requiring BasePlugin to inherit from QObject (which would
break other plugins).
2026-02-15 01:01:31 +00:00
LemonNexus 0155eb0be0 feat: Constrain skill scanner to only Entropia game window
BUG: OCR was reading text from Discord, EU-Utility UI, and other windows.

FIX:
1. Added find_entropia_window() - Uses win32gui + psutil on Windows to find
   the game window by process name 'Entropia.exe' and window title containing
   'Entropia Universe'. Returns (left, top, width, height).

2. Added capture_entropia_region() - Captures only the game window region,
   falls back to full screen if window not found.

3. Added is_valid_skill_text() - Filters out non-game text patterns:
   - Discord, Event Bus, Game Reader, Test, Page Scanner, HOTKEY MODE
   - UI elements like 'Skill Tracker', 'Calculator', 'Nexus Search'
   - Debug text like '[SkillScanner]', 'Parsed:', 'Cleared'
   - Process names like 'Entropia.exe', 'Client (64 bit)', 'Arkadia'
   - Lines with >10 words (skills aren't that long)

4. Added recognize_image() method to OCRService for convenience.

5. Modified SkillOCRThread.run() to:
   - Capture only Entropia window
   - Filter text before parsing
   - Use _parse_skills_filtered() which validates each line

6. Added _parse_skills_filtered() method that:
   - Splits text by lines
   - Only keeps lines containing a valid rank
   - Validates each line with is_valid_skill_text()
   - Logs filtered lines for debugging

RESULT:
- Scanner now ONLY reads from the game window
- Invalid text (Discord, UI, debug) is filtered out
- Much cleaner skill parsing results

Note: Window title varies by location (e.g., '[Arkadia]', '[Calypso]')
but process name is always 'Entropia.exe'.
2026-02-15 00:55:37 +00:00
LemonNexus 05f8c06312 fix: Replace all invokeMethod calls with Qt signals for thread-safety
BUG: QMetaObject.invokeMethod with Q_ARG doesn't work properly in PyQt6
and was causing TypeError exceptions.

FIX:
- Added proper Qt signals at class level:
  * update_status_signal(str, bool, bool)
  * update_session_table_signal(object)
  * update_counters_signal()
  * enable_scan_button_signal(bool)

- Connected all signals to slot methods in initialize()
- Replaced all invokeMethod calls with signal.emit()
- Thread callbacks now emit signals instead of calling invokeMethod
- UI updates happen in main Qt thread via signal/slot mechanism

This is the correct PyQt6 way to do cross-thread communication.
All UI updates are now thread-safe and won't cause TypeErrors.
2026-02-15 00:51:15 +00:00
LemonNexus d0ccb791f7 fix: Fix hotkey thread-safety issue in Skill Scanner
BUG: TypeError when using F12 hotkey - invokeMethod syntax was wrong
for PyQt6.

FIX:
1. Added hotkey_triggered = pyqtSignal() at class level
2. Connected signal to _scan_page_for_multi in initialize()
3. _hotkey_scan() now just emits the signal (thread-safe)
4. Signal ensures scan runs on main Qt thread

This is the proper Qt way to handle cross-thread communication.
The hotkey callback runs in keyboard library's thread, but the
scan must run in Qt's main thread to update UI safely.
2026-02-15 00:47:10 +00:00
LemonNexus e132a80f2b feat: Add Smart Auto-Scan with Hotkey Fallback to Skill Scanner
NEW FEATURE - Smart Multi-Page Scanning:

MODES:
1. 🤖 Smart Auto + Hotkey Fallback (default)
   - Tries to auto-detect page changes
   - Monitors page number area (1/12, 2/12, etc.)
   - If detection fails, falls back to F12 hotkey
   - User gets notified: 'Auto-detect unreliable. Use F12!'

2. ⌨️ Manual Hotkey Only
   - User navigates pages in EU
   - Presses F12 to scan each page
   - Simple and 100% reliable

3. 🖱️ Manual Click Only
   - Original click-based scanning
   - Click button, wait for beep, next page

SMART AUTO FEATURES:
- Checks page number area every 500ms
- Detects when page number changes (1→2, 2→3, etc.)
- Automatically triggers scan on page change
- Tracks failures - after 10 failures, falls back to hotkey
- Plays beep sound on successful auto-scan

HOTKEY FEATURES:
- F12 key registered globally
- Works even when EU-Utility not focused
- Triggers scan immediately
- Can be used as primary mode or fallback

UI UPDATES:
- Mode selector dropdown
- Dynamic instructions based on mode
- Hotkey info displayed (F12 = Scan)
- Status shows when auto-detect vs hotkey is active

TECHNICAL:
- Uses keyboard library for global hotkeys
- QTimer for auto-detection polling
- Tesseract OCR for page number reading
- Graceful fallback when auto fails

This gives users the best of both worlds:
- Try auto for convenience
- Fallback to hotkey for reliability
2026-02-15 00:42:37 +00:00
LemonNexus 482ec9aea4 feat: Add Multi-Page Scanner to Skill Scanner plugin
NEW FEATURE - Multi-Page Scanner:

WORKFLOW:
1. User positions Skills window to show skills
2. User clicks 'Scan Current Page'
3. App scans, shows checkmark , plays BEEP sound
4. Status shows: 'Page X scanned! Click Next Page in game →'
5. User manually clicks Next Page in EU
6. User clicks 'Scan Current Page' again
7. Repeat until all pages scanned
8. User clicks 'Save All' to store combined results

FEATURES:
-  Checkmark icon and green text on successful scan
- 🔊 Beep sound (Windows MessageBeep) to notify user
- 📊 Live counters: Pages scanned, Total skills
- 🗑 Clear Session button to start over
- 💾 Save All button merges session into main data
- 📝 Session table shows all skills collected so far

UI ELEMENTS:
- Instructions panel explaining the workflow
- Status label with color-coded feedback
- Pages: X counter
- Skills: X counter
- Three buttons: Scan Page, Save All, Clear Session
- Session table showing accumulated skills

TECHNICAL:
- current_scan_session dict accumulates skills across pages
- pages_scanned counter tracks progress
- Thread-safe UI updates via QMetaObject.invokeMethod
- Windows beep via winsound module (with fallback)

This gives users full control while guiding them through
multi-page scanning without any auto-clicking!
2026-02-15 00:35:50 +00:00
LemonNexus 46a76a91e8 fix: Parse ALL skills from window and clean category names
FIXES:
1. Changed from re.search (finds first) to re.finditer (finds ALL)
   - Now extracts all skills visible in the skills window
   - Not just the first skill

2. Added category name cleaning
   - Removes: Attributes, Combat, Design, Construction, etc.
   - Prevents 'Attributes Laser Weaponry Technology' issues
   - Now correctly extracts just 'Laser Weaponry Technology'

3. Normalizes whitespace after removing categories
   - Joins all text into single space-separated string
   - Helps with multi-line skill parsing

4. Added validation for skill name length
   - Must be more than 2 characters
   - Filters out false positives

ABOUT YOUR FEATURE REQUESTS:

Multi-Page Scanning:
- To scan all pages automatically would require:
  1. Detect the skills window is open
  2. Click the 'next page' button automatically
  3. Wait for page transition
  4. Repeat until last page (detect via page counter)
  5. This requires UI automation (pyautogui)
  6. Risk: Could interfere with gameplay

Progress Bar Detection:
- The green bars represent % progress to next level
- To measure them would require:
  1. Image processing (OpenCV) to detect bar length
  2. Comparing green pixels to total bar width
  3. Converting to percentage
  4. This is complex and computationally expensive
  5. Alternative: Track skill gains via chat.log instead

RECOMMENDATION:
For tracking skill progress precisely, the best approach is:
1. Use chat.log parsing (already implemented)
2. It catches every skill gain with exact values
3. No OCR needed - 100% accurate
4. Works in background automatically
2026-02-15 00:29:41 +00:00
LemonNexus 1538508b63 fix: Add Arch Master rank and Reset button to Skill Scanner
FIXES:
1. Added 'Arch Master' to the list of multi-word ranks
   - Multi-word ranks are now matched first to prevent partial matches
   - Changed rank matching order: ['Arch Master', 'Grand Master'] + single ranks
   - This fixes 'Laser Weaponry Technology Arch' being parsed incorrectly
   - Now correctly parses as: 'Laser Weaponry Technology', 'Arch Master', 8805

2. Added 'Reset Data' button to Skill Scanner plugin
   - Red button next to 'Scan Skills Window'
   - Shows confirmation dialog before clearing
   - Clears: skills_data, skill_gains, and the UI tables
   - Also clears the data file (skill_tracker.json)

3. Clean skill names by removing 'Skill' prefix
   - OCR sometimes reads 'Skill Laser Weaponry Technology'
   - Now strips 'Skill' or 'SKILL' prefix from skill names

4. Updated both Skill Scanner and Game Reader Test plugins
   - Both now use the same improved parsing logic
   - Both handle multi-word ranks correctly
2026-02-15 00:23:13 +00:00
LemonNexus a30bcbaba7 fix: Improve skill scanner parser for 3-column layout
The previous parser was too simple and couldn't handle the merged text
from OCR on the skills window.

IMPROVEMENTS:
1. Clean up common headers and category names from OCR text
2. Better regex pattern that handles merged text
3. Alternative parser as fallback for heavily merged text
4. Debug logging to show parsed skills
5. Validation to filter out bad matches

PARSING LOGIC:
- Finds pattern: SkillName Rank Points
- Handles multi-word skill names (e.g., 'Combat Reflexes')
- Recognizes all EU skill ranks (Newbie through Awesome)
- Validates points are reasonable numbers

This should correctly parse skills like:
  Aim Amazing 5524
  Combat Reflexes Incredible 5991
  Handgun Grand Master 8621
2026-02-15 00:05:05 +00:00
LemonNexus d64cf8da1f fix: Clean repository - remove workspace pollution
Removed workspace files that should not be in EU-Utility repo:
- AGENTS.md, SOUL.md, BOOTSTRAP.md (workspace config)
- memory/ (session logs)
- skills/ (OpenClaw skills)
- projects/ (other projects)
- tests/ (workspace tests)
- ui/ (old UI files)

Now EU-Utility repo contains ONLY EU-Utility code:
- core/ (12 services)
- plugins/ (31 plugins)
- docs/ (15 documentation files)
- tests/ (42 test cases)
- assets/ (icons, sounds)

Repository is now clean and focused.
2026-02-14 03:34:04 +00:00