Fix MacOS issue with opening logs#627
Open
davidliaos wants to merge 8 commits intopyclashbot:masterfrom
Open
Conversation
…and error logging
Add a new battle strategy option that allows the bot to spam cards at bridge coordinates for efficient crown farming while maintaining intelligent card selection and elixir management. Features: - New UI checkbox 'Bridge spam' mutually exclusive with 'Random plays' - Intelligent card selection using existing logic - Dynamic elixir management via BattleStrategy - Automatic side detection (left/right bridge) - Bridge coordinates based on hog card grouping patterns - Full integration into 1v1 and 2v2 battle modes Implementation details: - Add BRIDGE_SPAM_USER_TOGGLE enum field - Add bridge spam job configuration - Implement _bridge_spam_fight_loop() with same card/elixir logic as normal fights but always plays at bridge coordinates - Integrate into do_fight_state() and do_2v2_fight_state() - Add mutual exclusivity logic between random plays and bridge spam - Fix ttkbootstrap theme TclError handling in _apply_theme() The bridge spam strategy uses coordinates: - Left bridge: [(77, 281), (113, 283), (154, 283)] - Right bridge: [(257, 283), (300, 283), (353, 283)] This allows for efficient crown farming while maintaining the bot's intelligent gameplay mechanics.
Resolved merge conflict in ui.py by keeping updated comment for theme error handling.
Add robust boot check in BlueStacks restart() method to ensure Android is fully loaded before attempting to check for Clash Royale installation. The check verifies: - sys.boot_completed property is set to '1' - pm list packages command succeeds and returns output - Critical system packages are present (systemui, launcher, settings) This prevents false 'app not installed' errors that occur when Android is still booting and package manager queries return incomplete results. Fixes issue where bot checks for Clash Royale before BlueStacks finishes loading, causing premature 'not installed' errors.
Remove all bridge spam related code as the feature doesn't work as intended. Changes reverted: - Removed BRIDGE_SPAM_USER_TOGGLE from enums - Removed bridge spam JobConfig from config - Removed bridge spam from job dictionary - Removed bridge_spam_flag logic from states - Removed bridge_spam_mode parameter from fight functions - Removed _bridge_spam_fight_loop function - Removed bridge spam checkbox from UI - Removed mutual exclusivity logic between random plays and bridge spam
Add comprehensive debug statements to investigate why log folder is empty: - Track log directory and file paths during initialization - Verify log file creation and existence checks - Monitor logging.info() calls and file writes - List files in log folder when opening - Track file size and content after writes These debug statements will help identify: - Whether log_dir path is correct - Whether log files are being created - Whether logging.info() is actually writing to files - Whether there are permission or path issues
The debug output showed that logging.basicConfig() was not creating a FileHandler because logging was already configured (had a StreamHandler to stderr). Fix: - Clear existing handlers before calling basicConfig() - Use force=True to ensure reconfiguration - Add debug statements to verify FileHandler creation This ensures file logging works even if logging was configured earlier by another module or import.
Remove all [DEBUG] print statements that were added for troubleshooting. The logging fix is working correctly - logs are now being written to files. Kept the functional fix: - Clear existing handlers before basicConfig() - Use force=True to ensure reconfiguration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.