Skip to content

Record last "line guess" at the end of navigation link with segmentation#10

Merged
Egezenn merged 5 commits into
Silkroad-Developer-Community:mainfrom
Egezenn:pathing-line-issue
Jun 5, 2026
Merged

Record last "line guess" at the end of navigation link with segmentation#10
Egezenn merged 5 commits into
Silkroad-Developer-Community:mainfrom
Egezenn:pathing-line-issue

Conversation

@Egezenn

@Egezenn Egezenn commented May 7, 2026

Copy link
Copy Markdown
Member

Adresses Silkroad-Developer-Community/Silkroad-NavLink#1

Correctly creates a segmented path towards the final destination:
image

Summary by CodeRabbit

  • New Features
    • Enhanced navigation path calculation with improved movement interpolation and teleport handling; scripts now generated with timestamps.
    • Added Python API methods to retrieve log directory and path information.
    • Improved skill management with dedicated helpers for imbue, resurrection, and mastery configuration.
    • Skill images now display correctly for item perks.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Egezenn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 46 minutes and 18 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 237c54c9-4cf0-42d6-94f1-b4bdbfdc808b

📥 Commits

Reviewing files that changed from the base of the PR and between d2579dc and b28bd1e.

📒 Files selected for processing (1)
  • SDUI
📝 Walkthrough

Walkthrough

NavigationManager extends navigation caching by storing computed target positions separately. During path calculation, both the semantic-node path and target position are cached. Script generation uses this cached position to emit optimized movement commands with conditional branching: teleport commands when appropriate, or interpolated move segments when distance exceeds 50 units. Filenames now follow a dynamic timestamp format.

Changes

Target-Based Movement Generation

Layer / File(s) Summary
Target Position Caching
Botbases/RSBot.Training/Bot/NavigationManager.cs
Introduces _targetPosition field to cache the computed training-area position, populated during path calculation alongside _activePath.
Script Generation and Movement Commands
Botbases/RSBot.Training/Bot/NavigationManager.cs
GenerateRBSFile reads the cached target position and generates movement commands via AddMoveCommands: interpolates distances >50 into multiple segments, skips negligible (<1) distances, and uses dynamic filename format. Script ends by moving to the cached target position.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code with tiny paws,
Cached targets snug without a pause,
Teleports spring and moves divide,
Fifty-unit hops along the ride,
A dynamic script — now let’s applause!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Botbases/RSBot.Training/Bot/NavigationManager.cs`:
- Around line 259-265: Remove the forced full GC call after storing the new
path: inside the lock that updates _activePath and _targetPosition and clears
_linkage (protected by _linkageLock), delete the GC.Collect() invocation so the
runtime can perform collection naturally; leaving the existing assignment
_linkage = null is sufficient to allow reclamation without pausing the bot
thread.
- Around line 476-487: The generated interpolated waypoints always use
start.Region, so moves that cross regions end up targeting the wrong region;
update the waypoint region when building interpolatedPos in the loop (e.g.
choose end.Region for the final segment or determine the correct region based on
the interpolated coordinates) so the rbsLines.Add string uses the correct region
for each interpolatedPos (refer to Position, start, end, interpolatedPos,
segments, and rbsLines.Add to locate and change the code).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 48328f4f-546d-4c00-a8ae-913155fe90c9

📥 Commits

Reviewing files that changed from the base of the PR and between 23c1922 and ee7477b.

📒 Files selected for processing (1)
  • Botbases/RSBot.Training/Bot/NavigationManager.cs

Comment thread Botbases/RSBot.Training/Bot/NavigationManager.cs Outdated
Comment thread Botbases/RSBot.Training/Bot/NavigationManager.cs
Egezenn added a commit to Silkroad-Developer-Community/ROADMAP that referenced this pull request May 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Plugins/RSBot.Skills/SkillsManager.cs`:
- Around line 73-83: The code dereferences mastery without checking for null;
before using mastery.Level or mastery.Record (in the block that calls
UpdateMastery), add a null-check for the lookup result (the variable mastery
obtained from Game.Player.Skills.Masteries.FirstOrDefault(...) using
selectedMasteryName) and return early (or log and return) if mastery is null so
OnSpUpdated cannot crash; specifically guard the usages in this method (where
mastery.Level and mastery.Record are read) to ensure UpdateMastery is only
called with a non-null mastery.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae4271f9-807a-497a-a503-561fd2c61369

📥 Commits

Reviewing files that changed from the base of the PR and between ee7477b and d2579dc.

📒 Files selected for processing (132)
  • Application/OasisBot/OasisBot.csproj
  • Application/OasisBot/Program.cs
  • Application/OasisBot/Views/Controls/Cos/CosControlBase.cs
  • Application/OasisBot/Views/Main.cs
  • Botbases/RSBot.Alchemy/AlchemyBase.cs
  • Botbases/RSBot.Alchemy/AlchemyView.cs
  • Botbases/RSBot.Alchemy/RSBot.Alchemy.csproj
  • Botbases/RSBot.Alchemy/Views/Main.cs
  • Botbases/RSBot.Lure/LureBotbase.cs
  • Botbases/RSBot.Lure/LureView.cs
  • Botbases/RSBot.Lure/RSBot.Lure.csproj
  • Botbases/RSBot.Trade/RSBot.Trade.csproj
  • Botbases/RSBot.Trade/TradeManager.cs
  • Botbases/RSBot.Trade/TradeView.cs
  • Botbases/RSBot.Training/Bot/NavigationManager.cs
  • Botbases/RSBot.Training/Bundle/PartyBuffing/PartyBuffingBundle.cs
  • Botbases/RSBot.Training/RSBot.Training.csproj
  • Botbases/RSBot.Training/TrainingBase.cs
  • Botbases/RSBot.Training/TrainingManager.cs
  • Botbases/RSBot.Training/TrainingView.cs
  • Botbases/RSBot.Training/Views/Main.cs
  • Library/RSBot.Core/Bot.cs
  • Library/RSBot.Core/BotCL.cs
  • Library/RSBot.Core/Client/ReferenceManager.cs
  • Library/RSBot.Core/Components/ClientManager.cs
  • Library/RSBot.Core/Components/Command/CoreCLICommands.cs
  • Library/RSBot.Core/Components/PickupManager.cs
  • Library/RSBot.Core/Components/ShoppingManager.cs
  • Library/RSBot.Core/Config/GeneralConfig.cs
  • Library/RSBot.Core/Config/GlobalConfig.cs
  • Library/RSBot.Core/Kernel.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityUpdatePvpFlag.cs
  • Library/RSBot.Core/Network/Handler/Agent/Guild/GuildEntityUpdateResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Party/PartyDistributionResponse.cs
  • Library/RSBot.Core/Network/NetworkUtilities.cs
  • Library/RSBot.Core/Network/Packet.cs
  • Library/RSBot.Core/Network/Socket/Server.cs
  • Library/RSBot.Core/Objects/CharacterInventory.cs
  • Library/RSBot.Core/Objects/Inventory/Item/ItemUpdateFlag.cs
  • Library/RSBot.Core/Objects/Inventory/Storage.cs
  • Library/RSBot.Core/Plugins/BotbaseManager.cs
  • Library/RSBot.Core/Plugins/IBotbase.cs
  • Library/RSBot.Core/Plugins/PluginManager.cs
  • Library/RSBot.Core/RSBot.Core.csproj
  • Plugins/RSBot.Chat/Bundle/Chat.cs
  • Plugins/RSBot.Chat/Bundle/Network/ChatResponse.cs
  • Plugins/RSBot.Chat/Bundle/Network/LinkedItemResponseHandler.cs
  • Plugins/RSBot.Chat/ChatCLICommands.cs
  • Plugins/RSBot.Chat/ChatManager.cs
  • Plugins/RSBot.Chat/ChatPlugin.cs
  • Plugins/RSBot.Chat/ChatView.cs
  • Plugins/RSBot.Chat/RSBot.Chat.csproj
  • Plugins/RSBot.Chat/Views/Main.cs
  • Plugins/RSBot.CommandCenter/RSBot.CommandCenter.csproj
  • Plugins/RSBot.General/GeneralCLICommands.cs
  • Plugins/RSBot.General/GeneralManager.cs
  • Plugins/RSBot.General/GeneralPlugin.cs
  • Plugins/RSBot.General/GeneralView.cs
  • Plugins/RSBot.General/RSBot.General.csproj
  • Plugins/RSBot.General/Views/Main.cs
  • Plugins/RSBot.Inventory/InventoryManager.cs
  • Plugins/RSBot.Inventory/InventoryPlugin.cs
  • Plugins/RSBot.Inventory/InventoryView.cs
  • Plugins/RSBot.Inventory/RSBot.Inventory.csproj
  • Plugins/RSBot.Inventory/Views/Main.cs
  • Plugins/RSBot.Items/ItemsManager.cs
  • Plugins/RSBot.Items/ItemsPlugin.cs
  • Plugins/RSBot.Items/ItemsView.cs
  • Plugins/RSBot.Items/RSBot.Items.csproj
  • Plugins/RSBot.Log/LogManager.cs
  • Plugins/RSBot.Log/LogPlugin.cs
  • Plugins/RSBot.Log/LogView.cs
  • Plugins/RSBot.Log/RSBot.Log.csproj
  • Plugins/RSBot.Map/MapManager.cs
  • Plugins/RSBot.Map/MapPlugin.cs
  • Plugins/RSBot.Map/MapView.cs
  • Plugins/RSBot.Map/RSBot.Map.csproj
  • Plugins/RSBot.Map/Views/Main.cs
  • Plugins/RSBot.Party/Bundle/AutoParty/AutoPartyBundle.cs
  • Plugins/RSBot.Party/PartyView.cs
  • Plugins/RSBot.Party/RSBot.Party.csproj
  • Plugins/RSBot.Protection/ProtectionManager.cs
  • Plugins/RSBot.Protection/ProtectionPlugin.cs
  • Plugins/RSBot.Protection/ProtectionView.cs
  • Plugins/RSBot.Protection/RSBot.Protection.csproj
  • Plugins/RSBot.Python/Components/API/Core/API.Core.cs
  • Plugins/RSBot.Python/Components/API/Core/Config/API.Config.cs
  • Plugins/RSBot.Python/Components/API/Core/Entity/API.Entity.cs
  • Plugins/RSBot.Python/Components/API/Core/Inventory/API.Inventory.cs
  • Plugins/RSBot.Python/Components/API/Core/Quests/API.Quests.cs
  • Plugins/RSBot.Python/Components/API/Core/Training/API.Training.cs
  • Plugins/RSBot.Python/Components/API/GUI/API.Gui.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.CheckboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ComboboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.LabelWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ListBoxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.RadioButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.TextboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Wrapper/API.Gui.Wrapper.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonErrorHandler.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonInfoHandler.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/ModuleLoader.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/PythonPlugin.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/StubGenerator.cs
  • Plugins/RSBot.Python/Components/Loader/PythonRuntimeManager.cs
  • Plugins/RSBot.Python/Components/Manager/PythonPluginManager.cs
  • Plugins/RSBot.Python/PythonManager.cs
  • Plugins/RSBot.Python/PythonPlugin.cs
  • Plugins/RSBot.Python/PythonView.cs
  • Plugins/RSBot.Python/RSBot.Python.csproj
  • Plugins/RSBot.Python/Views/Main.cs
  • Plugins/RSBot.Python/Views/View.cs
  • Plugins/RSBot.Quest/QuestPlugin.cs
  • Plugins/RSBot.Quest/QuestView.cs
  • Plugins/RSBot.Quest/RSBot.Quest.csproj
  • Plugins/RSBot.Quest/Views/Main.cs
  • Plugins/RSBot.ServerInfo/RSBot.ServerInfo.csproj
  • Plugins/RSBot.ServerInfo/ServerInfoManager.cs
  • Plugins/RSBot.ServerInfo/ServerInfoPlugin.cs
  • Plugins/RSBot.ServerInfo/ServerInfoView.cs
  • Plugins/RSBot.ServerInfo/Views/Main.cs
  • Plugins/RSBot.Skills/RSBot.Skills.csproj
  • Plugins/RSBot.Skills/SkillsManager.cs
  • Plugins/RSBot.Skills/SkillsPlugin.cs
  • Plugins/RSBot.Skills/SkillsView.cs
  • Plugins/RSBot.Skills/Views/Main.cs
  • Plugins/RSBot.Statistics/RSBot.Statistics.csproj
  • Plugins/RSBot.Statistics/StatisticsManager.cs
  • Plugins/RSBot.Statistics/StatisticsPlugin.cs
  • Plugins/RSBot.Statistics/StatisticsView.cs
💤 Files with no reviewable changes (3)
  • Botbases/RSBot.Lure/LureBotbase.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ButtonWrapper.cs
  • Library/RSBot.Core/Plugins/IBotbase.cs
✅ Files skipped from review due to trivial changes (120)
  • Plugins/RSBot.Chat/ChatCLICommands.cs
  • Plugins/RSBot.General/GeneralView.cs
  • Library/RSBot.Core/Config/GlobalConfig.cs
  • Plugins/RSBot.ServerInfo/ServerInfoPlugin.cs
  • Plugins/RSBot.ServerInfo/ServerInfoManager.cs
  • Plugins/RSBot.Log/LogPlugin.cs
  • Plugins/RSBot.Chat/ChatView.cs
  • Plugins/RSBot.Python/RSBot.Python.csproj
  • Plugins/RSBot.Map/MapManager.cs
  • Botbases/RSBot.Trade/TradeView.cs
  • Plugins/RSBot.Chat/Bundle/Network/LinkedItemResponseHandler.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonErrorHandler.cs
  • Plugins/RSBot.Party/PartyView.cs
  • Plugins/RSBot.Map/MapView.cs
  • Plugins/RSBot.Protection/ProtectionManager.cs
  • Plugins/RSBot.Quest/QuestView.cs
  • Plugins/RSBot.Statistics/StatisticsManager.cs
  • Botbases/RSBot.Training/TrainingBase.cs
  • Library/RSBot.Core/Network/Handler/Agent/Party/PartyDistributionResponse.cs
  • Library/RSBot.Core/Components/Command/CoreCLICommands.cs
  • Plugins/RSBot.ServerInfo/ServerInfoView.cs
  • Library/RSBot.Core/BotCL.cs
  • Library/RSBot.Core/Plugins/BotbaseManager.cs
  • Plugins/RSBot.Map/Views/Main.cs
  • Plugins/RSBot.Statistics/RSBot.Statistics.csproj
  • Plugins/RSBot.Items/ItemsView.cs
  • Library/RSBot.Core/Network/Packet.cs
  • Botbases/RSBot.Trade/TradeManager.cs
  • Plugins/RSBot.Quest/QuestPlugin.cs
  • Plugins/RSBot.Protection/ProtectionView.cs
  • Plugins/RSBot.Statistics/StatisticsPlugin.cs
  • Plugins/RSBot.Quest/Views/Main.cs
  • Botbases/RSBot.Alchemy/AlchemyView.cs
  • Library/RSBot.Core/Components/PickupManager.cs
  • Plugins/RSBot.Log/LogView.cs
  • Plugins/RSBot.General/GeneralCLICommands.cs
  • Plugins/RSBot.Map/MapPlugin.cs
  • Library/RSBot.Core/Objects/Inventory/Storage.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonInfoHandler.cs
  • Plugins/RSBot.Skills/SkillsView.cs
  • Plugins/RSBot.Inventory/RSBot.Inventory.csproj
  • Library/RSBot.Core/Bot.cs
  • Plugins/RSBot.Chat/ChatManager.cs
  • Botbases/RSBot.Trade/RSBot.Trade.csproj
  • Library/RSBot.Core/Kernel.cs
  • Botbases/RSBot.Training/Views/Main.cs
  • Plugins/RSBot.Inventory/Views/Main.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.TextboxWrapper.cs
  • Plugins/RSBot.Statistics/StatisticsView.cs
  • Plugins/RSBot.Skills/SkillsPlugin.cs
  • Library/RSBot.Core/Network/NetworkUtilities.cs
  • Library/RSBot.Core/Objects/CharacterInventory.cs
  • Plugins/RSBot.Inventory/InventoryView.cs
  • Plugins/RSBot.Quest/RSBot.Quest.csproj
  • Library/RSBot.Core/RSBot.Core.csproj
  • Plugins/RSBot.Python/PythonView.cs
  • Botbases/RSBot.Lure/LureView.cs
  • Plugins/RSBot.Skills/RSBot.Skills.csproj
  • Botbases/RSBot.Training/TrainingView.cs
  • Application/OasisBot/OasisBot.csproj
  • Plugins/RSBot.Python/PythonManager.cs
  • Botbases/RSBot.Alchemy/Views/Main.cs
  • Plugins/RSBot.Python/Components/Loader/PythonRuntimeManager.cs
  • Plugins/RSBot.Party/RSBot.Party.csproj
  • Plugins/RSBot.Map/RSBot.Map.csproj
  • Plugins/RSBot.General/GeneralPlugin.cs
  • Plugins/RSBot.Party/Bundle/AutoParty/AutoPartyBundle.cs
  • Library/RSBot.Core/Client/ReferenceManager.cs
  • Plugins/RSBot.Python/Views/View.cs
  • Plugins/RSBot.CommandCenter/RSBot.CommandCenter.csproj
  • Plugins/RSBot.Inventory/InventoryManager.cs
  • Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.LabelWrapper.cs
  • Plugins/RSBot.General/RSBot.General.csproj
  • Botbases/RSBot.Training/TrainingManager.cs
  • Plugins/RSBot.Items/RSBot.Items.csproj
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ComboboxWrapper.cs
  • Botbases/RSBot.Alchemy/AlchemyBase.cs
  • Botbases/RSBot.Training/Bundle/PartyBuffing/PartyBuffingBundle.cs
  • Plugins/RSBot.ServerInfo/RSBot.ServerInfo.csproj
  • Application/OasisBot/Views/Controls/Cos/CosControlBase.cs
  • Plugins/RSBot.ServerInfo/Views/Main.cs
  • Library/RSBot.Core/Config/GeneralConfig.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityUpdatePvpFlag.cs
  • Plugins/RSBot.Items/ItemsPlugin.cs
  • Plugins/RSBot.Chat/Bundle/Network/ChatResponse.cs
  • Plugins/RSBot.Chat/RSBot.Chat.csproj
  • Library/RSBot.Core/Network/Socket/Server.cs
  • Plugins/RSBot.Chat/Bundle/Chat.cs
  • Plugins/RSBot.Inventory/InventoryPlugin.cs
  • Plugins/RSBot.Chat/ChatPlugin.cs
  • Botbases/RSBot.Lure/RSBot.Lure.csproj
  • Plugins/RSBot.Python/Components/API/ModuleLoader/PythonPlugin.cs
  • Botbases/RSBot.Training/RSBot.Training.csproj
  • Plugins/RSBot.Log/LogManager.cs
  • Library/RSBot.Core/Objects/Inventory/Item/ItemUpdateFlag.cs
  • Plugins/RSBot.Log/RSBot.Log.csproj
  • Plugins/RSBot.Python/PythonPlugin.cs
  • Plugins/RSBot.Items/ItemsManager.cs
  • Library/RSBot.Core/Components/ClientManager.cs
  • Plugins/RSBot.Python/Components/Manager/PythonPluginManager.cs
  • Application/OasisBot/Program.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.RadioButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/Core/Training/API.Training.cs
  • Application/OasisBot/Views/Main.cs
  • Plugins/RSBot.Protection/ProtectionPlugin.cs
  • Botbases/RSBot.Alchemy/RSBot.Alchemy.csproj
  • Plugins/RSBot.Python/Components/API/GUI/Wrapper/API.Gui.Wrapper.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/StubGenerator.cs
  • Plugins/RSBot.Protection/RSBot.Protection.csproj
  • Library/RSBot.Core/Components/ShoppingManager.cs
  • Plugins/RSBot.General/Views/Main.cs
  • Plugins/RSBot.Python/Views/Main.cs
  • Plugins/RSBot.Python/Components/API/Core/Quests/API.Quests.cs
  • Plugins/RSBot.Python/Components/API/Core/Inventory/API.Inventory.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.CheckboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ListBoxWrapper.cs
  • Plugins/RSBot.Chat/Views/Main.cs
  • Plugins/RSBot.General/GeneralManager.cs
  • Plugins/RSBot.Python/Components/API/GUI/API.Gui.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Plugins/RSBot.Skills/SkillsManager.cs`:
- Around line 73-83: The code dereferences mastery without checking for null;
before using mastery.Level or mastery.Record (in the block that calls
UpdateMastery), add a null-check for the lookup result (the variable mastery
obtained from Game.Player.Skills.Masteries.FirstOrDefault(...) using
selectedMasteryName) and return early (or log and return) if mastery is null so
OnSpUpdated cannot crash; specifically guard the usages in this method (where
mastery.Level and mastery.Record are read) to ensure UpdateMastery is only
called with a non-null mastery.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae4271f9-807a-497a-a503-561fd2c61369

📥 Commits

Reviewing files that changed from the base of the PR and between ee7477b and d2579dc.

📒 Files selected for processing (132)
  • Application/OasisBot/OasisBot.csproj
  • Application/OasisBot/Program.cs
  • Application/OasisBot/Views/Controls/Cos/CosControlBase.cs
  • Application/OasisBot/Views/Main.cs
  • Botbases/RSBot.Alchemy/AlchemyBase.cs
  • Botbases/RSBot.Alchemy/AlchemyView.cs
  • Botbases/RSBot.Alchemy/RSBot.Alchemy.csproj
  • Botbases/RSBot.Alchemy/Views/Main.cs
  • Botbases/RSBot.Lure/LureBotbase.cs
  • Botbases/RSBot.Lure/LureView.cs
  • Botbases/RSBot.Lure/RSBot.Lure.csproj
  • Botbases/RSBot.Trade/RSBot.Trade.csproj
  • Botbases/RSBot.Trade/TradeManager.cs
  • Botbases/RSBot.Trade/TradeView.cs
  • Botbases/RSBot.Training/Bot/NavigationManager.cs
  • Botbases/RSBot.Training/Bundle/PartyBuffing/PartyBuffingBundle.cs
  • Botbases/RSBot.Training/RSBot.Training.csproj
  • Botbases/RSBot.Training/TrainingBase.cs
  • Botbases/RSBot.Training/TrainingManager.cs
  • Botbases/RSBot.Training/TrainingView.cs
  • Botbases/RSBot.Training/Views/Main.cs
  • Library/RSBot.Core/Bot.cs
  • Library/RSBot.Core/BotCL.cs
  • Library/RSBot.Core/Client/ReferenceManager.cs
  • Library/RSBot.Core/Components/ClientManager.cs
  • Library/RSBot.Core/Components/Command/CoreCLICommands.cs
  • Library/RSBot.Core/Components/PickupManager.cs
  • Library/RSBot.Core/Components/ShoppingManager.cs
  • Library/RSBot.Core/Config/GeneralConfig.cs
  • Library/RSBot.Core/Config/GlobalConfig.cs
  • Library/RSBot.Core/Kernel.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityUpdatePvpFlag.cs
  • Library/RSBot.Core/Network/Handler/Agent/Guild/GuildEntityUpdateResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Party/PartyDistributionResponse.cs
  • Library/RSBot.Core/Network/NetworkUtilities.cs
  • Library/RSBot.Core/Network/Packet.cs
  • Library/RSBot.Core/Network/Socket/Server.cs
  • Library/RSBot.Core/Objects/CharacterInventory.cs
  • Library/RSBot.Core/Objects/Inventory/Item/ItemUpdateFlag.cs
  • Library/RSBot.Core/Objects/Inventory/Storage.cs
  • Library/RSBot.Core/Plugins/BotbaseManager.cs
  • Library/RSBot.Core/Plugins/IBotbase.cs
  • Library/RSBot.Core/Plugins/PluginManager.cs
  • Library/RSBot.Core/RSBot.Core.csproj
  • Plugins/RSBot.Chat/Bundle/Chat.cs
  • Plugins/RSBot.Chat/Bundle/Network/ChatResponse.cs
  • Plugins/RSBot.Chat/Bundle/Network/LinkedItemResponseHandler.cs
  • Plugins/RSBot.Chat/ChatCLICommands.cs
  • Plugins/RSBot.Chat/ChatManager.cs
  • Plugins/RSBot.Chat/ChatPlugin.cs
  • Plugins/RSBot.Chat/ChatView.cs
  • Plugins/RSBot.Chat/RSBot.Chat.csproj
  • Plugins/RSBot.Chat/Views/Main.cs
  • Plugins/RSBot.CommandCenter/RSBot.CommandCenter.csproj
  • Plugins/RSBot.General/GeneralCLICommands.cs
  • Plugins/RSBot.General/GeneralManager.cs
  • Plugins/RSBot.General/GeneralPlugin.cs
  • Plugins/RSBot.General/GeneralView.cs
  • Plugins/RSBot.General/RSBot.General.csproj
  • Plugins/RSBot.General/Views/Main.cs
  • Plugins/RSBot.Inventory/InventoryManager.cs
  • Plugins/RSBot.Inventory/InventoryPlugin.cs
  • Plugins/RSBot.Inventory/InventoryView.cs
  • Plugins/RSBot.Inventory/RSBot.Inventory.csproj
  • Plugins/RSBot.Inventory/Views/Main.cs
  • Plugins/RSBot.Items/ItemsManager.cs
  • Plugins/RSBot.Items/ItemsPlugin.cs
  • Plugins/RSBot.Items/ItemsView.cs
  • Plugins/RSBot.Items/RSBot.Items.csproj
  • Plugins/RSBot.Log/LogManager.cs
  • Plugins/RSBot.Log/LogPlugin.cs
  • Plugins/RSBot.Log/LogView.cs
  • Plugins/RSBot.Log/RSBot.Log.csproj
  • Plugins/RSBot.Map/MapManager.cs
  • Plugins/RSBot.Map/MapPlugin.cs
  • Plugins/RSBot.Map/MapView.cs
  • Plugins/RSBot.Map/RSBot.Map.csproj
  • Plugins/RSBot.Map/Views/Main.cs
  • Plugins/RSBot.Party/Bundle/AutoParty/AutoPartyBundle.cs
  • Plugins/RSBot.Party/PartyView.cs
  • Plugins/RSBot.Party/RSBot.Party.csproj
  • Plugins/RSBot.Protection/ProtectionManager.cs
  • Plugins/RSBot.Protection/ProtectionPlugin.cs
  • Plugins/RSBot.Protection/ProtectionView.cs
  • Plugins/RSBot.Protection/RSBot.Protection.csproj
  • Plugins/RSBot.Python/Components/API/Core/API.Core.cs
  • Plugins/RSBot.Python/Components/API/Core/Config/API.Config.cs
  • Plugins/RSBot.Python/Components/API/Core/Entity/API.Entity.cs
  • Plugins/RSBot.Python/Components/API/Core/Inventory/API.Inventory.cs
  • Plugins/RSBot.Python/Components/API/Core/Quests/API.Quests.cs
  • Plugins/RSBot.Python/Components/API/Core/Training/API.Training.cs
  • Plugins/RSBot.Python/Components/API/GUI/API.Gui.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.CheckboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ComboboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.LabelWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ListBoxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.RadioButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.TextboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Wrapper/API.Gui.Wrapper.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonErrorHandler.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonInfoHandler.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/ModuleLoader.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/PythonPlugin.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/StubGenerator.cs
  • Plugins/RSBot.Python/Components/Loader/PythonRuntimeManager.cs
  • Plugins/RSBot.Python/Components/Manager/PythonPluginManager.cs
  • Plugins/RSBot.Python/PythonManager.cs
  • Plugins/RSBot.Python/PythonPlugin.cs
  • Plugins/RSBot.Python/PythonView.cs
  • Plugins/RSBot.Python/RSBot.Python.csproj
  • Plugins/RSBot.Python/Views/Main.cs
  • Plugins/RSBot.Python/Views/View.cs
  • Plugins/RSBot.Quest/QuestPlugin.cs
  • Plugins/RSBot.Quest/QuestView.cs
  • Plugins/RSBot.Quest/RSBot.Quest.csproj
  • Plugins/RSBot.Quest/Views/Main.cs
  • Plugins/RSBot.ServerInfo/RSBot.ServerInfo.csproj
  • Plugins/RSBot.ServerInfo/ServerInfoManager.cs
  • Plugins/RSBot.ServerInfo/ServerInfoPlugin.cs
  • Plugins/RSBot.ServerInfo/ServerInfoView.cs
  • Plugins/RSBot.ServerInfo/Views/Main.cs
  • Plugins/RSBot.Skills/RSBot.Skills.csproj
  • Plugins/RSBot.Skills/SkillsManager.cs
  • Plugins/RSBot.Skills/SkillsPlugin.cs
  • Plugins/RSBot.Skills/SkillsView.cs
  • Plugins/RSBot.Skills/Views/Main.cs
  • Plugins/RSBot.Statistics/RSBot.Statistics.csproj
  • Plugins/RSBot.Statistics/StatisticsManager.cs
  • Plugins/RSBot.Statistics/StatisticsPlugin.cs
  • Plugins/RSBot.Statistics/StatisticsView.cs
💤 Files with no reviewable changes (3)
  • Botbases/RSBot.Lure/LureBotbase.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ButtonWrapper.cs
  • Library/RSBot.Core/Plugins/IBotbase.cs
✅ Files skipped from review due to trivial changes (120)
  • Plugins/RSBot.Chat/ChatCLICommands.cs
  • Plugins/RSBot.General/GeneralView.cs
  • Library/RSBot.Core/Config/GlobalConfig.cs
  • Plugins/RSBot.ServerInfo/ServerInfoPlugin.cs
  • Plugins/RSBot.ServerInfo/ServerInfoManager.cs
  • Plugins/RSBot.Log/LogPlugin.cs
  • Plugins/RSBot.Chat/ChatView.cs
  • Plugins/RSBot.Python/RSBot.Python.csproj
  • Plugins/RSBot.Map/MapManager.cs
  • Botbases/RSBot.Trade/TradeView.cs
  • Plugins/RSBot.Chat/Bundle/Network/LinkedItemResponseHandler.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonErrorHandler.cs
  • Plugins/RSBot.Party/PartyView.cs
  • Plugins/RSBot.Map/MapView.cs
  • Plugins/RSBot.Protection/ProtectionManager.cs
  • Plugins/RSBot.Quest/QuestView.cs
  • Plugins/RSBot.Statistics/StatisticsManager.cs
  • Botbases/RSBot.Training/TrainingBase.cs
  • Library/RSBot.Core/Network/Handler/Agent/Party/PartyDistributionResponse.cs
  • Library/RSBot.Core/Components/Command/CoreCLICommands.cs
  • Plugins/RSBot.ServerInfo/ServerInfoView.cs
  • Library/RSBot.Core/BotCL.cs
  • Library/RSBot.Core/Plugins/BotbaseManager.cs
  • Plugins/RSBot.Map/Views/Main.cs
  • Plugins/RSBot.Statistics/RSBot.Statistics.csproj
  • Plugins/RSBot.Items/ItemsView.cs
  • Library/RSBot.Core/Network/Packet.cs
  • Botbases/RSBot.Trade/TradeManager.cs
  • Plugins/RSBot.Quest/QuestPlugin.cs
  • Plugins/RSBot.Protection/ProtectionView.cs
  • Plugins/RSBot.Statistics/StatisticsPlugin.cs
  • Plugins/RSBot.Quest/Views/Main.cs
  • Botbases/RSBot.Alchemy/AlchemyView.cs
  • Library/RSBot.Core/Components/PickupManager.cs
  • Plugins/RSBot.Log/LogView.cs
  • Plugins/RSBot.General/GeneralCLICommands.cs
  • Plugins/RSBot.Map/MapPlugin.cs
  • Library/RSBot.Core/Objects/Inventory/Storage.cs
  • Plugins/RSBot.Python/Components/API/Handler/PythonInfoHandler.cs
  • Plugins/RSBot.Skills/SkillsView.cs
  • Plugins/RSBot.Inventory/RSBot.Inventory.csproj
  • Library/RSBot.Core/Bot.cs
  • Plugins/RSBot.Chat/ChatManager.cs
  • Botbases/RSBot.Trade/RSBot.Trade.csproj
  • Library/RSBot.Core/Kernel.cs
  • Botbases/RSBot.Training/Views/Main.cs
  • Plugins/RSBot.Inventory/Views/Main.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.TextboxWrapper.cs
  • Plugins/RSBot.Statistics/StatisticsView.cs
  • Plugins/RSBot.Skills/SkillsPlugin.cs
  • Library/RSBot.Core/Network/NetworkUtilities.cs
  • Library/RSBot.Core/Objects/CharacterInventory.cs
  • Plugins/RSBot.Inventory/InventoryView.cs
  • Plugins/RSBot.Quest/RSBot.Quest.csproj
  • Library/RSBot.Core/RSBot.Core.csproj
  • Plugins/RSBot.Python/PythonView.cs
  • Botbases/RSBot.Lure/LureView.cs
  • Plugins/RSBot.Skills/RSBot.Skills.csproj
  • Botbases/RSBot.Training/TrainingView.cs
  • Application/OasisBot/OasisBot.csproj
  • Plugins/RSBot.Python/PythonManager.cs
  • Botbases/RSBot.Alchemy/Views/Main.cs
  • Plugins/RSBot.Python/Components/Loader/PythonRuntimeManager.cs
  • Plugins/RSBot.Party/RSBot.Party.csproj
  • Plugins/RSBot.Map/RSBot.Map.csproj
  • Plugins/RSBot.General/GeneralPlugin.cs
  • Plugins/RSBot.Party/Bundle/AutoParty/AutoPartyBundle.cs
  • Library/RSBot.Core/Client/ReferenceManager.cs
  • Plugins/RSBot.Python/Views/View.cs
  • Plugins/RSBot.CommandCenter/RSBot.CommandCenter.csproj
  • Plugins/RSBot.Inventory/InventoryManager.cs
  • Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.LabelWrapper.cs
  • Plugins/RSBot.General/RSBot.General.csproj
  • Botbases/RSBot.Training/TrainingManager.cs
  • Plugins/RSBot.Items/RSBot.Items.csproj
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ComboboxWrapper.cs
  • Botbases/RSBot.Alchemy/AlchemyBase.cs
  • Botbases/RSBot.Training/Bundle/PartyBuffing/PartyBuffingBundle.cs
  • Plugins/RSBot.ServerInfo/RSBot.ServerInfo.csproj
  • Application/OasisBot/Views/Controls/Cos/CosControlBase.cs
  • Plugins/RSBot.ServerInfo/Views/Main.cs
  • Library/RSBot.Core/Config/GeneralConfig.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityUpdatePvpFlag.cs
  • Plugins/RSBot.Items/ItemsPlugin.cs
  • Plugins/RSBot.Chat/Bundle/Network/ChatResponse.cs
  • Plugins/RSBot.Chat/RSBot.Chat.csproj
  • Library/RSBot.Core/Network/Socket/Server.cs
  • Plugins/RSBot.Chat/Bundle/Chat.cs
  • Plugins/RSBot.Inventory/InventoryPlugin.cs
  • Plugins/RSBot.Chat/ChatPlugin.cs
  • Botbases/RSBot.Lure/RSBot.Lure.csproj
  • Plugins/RSBot.Python/Components/API/ModuleLoader/PythonPlugin.cs
  • Botbases/RSBot.Training/RSBot.Training.csproj
  • Plugins/RSBot.Log/LogManager.cs
  • Library/RSBot.Core/Objects/Inventory/Item/ItemUpdateFlag.cs
  • Plugins/RSBot.Log/RSBot.Log.csproj
  • Plugins/RSBot.Python/PythonPlugin.cs
  • Plugins/RSBot.Items/ItemsManager.cs
  • Library/RSBot.Core/Components/ClientManager.cs
  • Plugins/RSBot.Python/Components/Manager/PythonPluginManager.cs
  • Application/OasisBot/Program.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.RadioButtonWrapper.cs
  • Plugins/RSBot.Python/Components/API/Core/Training/API.Training.cs
  • Application/OasisBot/Views/Main.cs
  • Plugins/RSBot.Protection/ProtectionPlugin.cs
  • Botbases/RSBot.Alchemy/RSBot.Alchemy.csproj
  • Plugins/RSBot.Python/Components/API/GUI/Wrapper/API.Gui.Wrapper.cs
  • Plugins/RSBot.Python/Components/API/ModuleLoader/StubGenerator.cs
  • Plugins/RSBot.Protection/RSBot.Protection.csproj
  • Library/RSBot.Core/Components/ShoppingManager.cs
  • Plugins/RSBot.General/Views/Main.cs
  • Plugins/RSBot.Python/Views/Main.cs
  • Plugins/RSBot.Python/Components/API/Core/Quests/API.Quests.cs
  • Plugins/RSBot.Python/Components/API/Core/Inventory/API.Inventory.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.CheckboxWrapper.cs
  • Plugins/RSBot.Python/Components/API/GUI/Controls/API.Gui.ListBoxWrapper.cs
  • Plugins/RSBot.Chat/Views/Main.cs
  • Plugins/RSBot.General/GeneralManager.cs
  • Plugins/RSBot.Python/Components/API/GUI/API.Gui.cs
🛑 Comments failed to post (1)
Plugins/RSBot.Skills/SkillsManager.cs (1)

73-83: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Validate selected mastery before dereferencing.

At Line 73, mastery can be null when RSBot.Skills.selectedMastery no longer matches current masteries. Lines 80 and 82 then dereference mastery, which can crash OnSpUpdated at runtime.

Suggested fix
 private void OnSpUpdated()
 {
     var gap = PlayerConfig.Get<decimal>("RSBot.Skills.numMasteryGap");
     var selectedMasteryName = PlayerConfig.Get<string>("RSBot.Skills.selectedMastery");
     var mastery = Game.Player.Skills.Masteries.FirstOrDefault(m => m.Record.NameCode == selectedMasteryName);
     var checkLearnMastery = PlayerConfig.Get<bool>("RSBot.Skills.checkLearnMastery");
     var checkLearnMasteryBotStopped = PlayerConfig.Get<bool>("RSBot.Skills.checkLearnMasteryBotStopped");
-    if (selectedMasteryName == null || !checkLearnMastery)
+    if (string.IsNullOrEmpty(selectedMasteryName) || !checkLearnMastery)
+        return;
+    if (mastery == null)
         return;
-    if (!checkLearnMasteryBotStopped && !Kernel.Bot.Running)
+    if (!checkLearnMasteryBotStopped && !Kernel.Bot.Running)
         return;
-    if (mastery.Level + gap == Game.Player.Level)
+    if (mastery.Level + gap >= Game.Player.Level)
         return;
     UpdateMastery(mastery.Level, mastery.Record, gap);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

            var mastery = Game.Player.Skills.Masteries.FirstOrDefault(m => m.Record.NameCode == selectedMasteryName);
            var checkLearnMastery = PlayerConfig.Get<bool>("RSBot.Skills.checkLearnMastery");
            var checkLearnMasteryBotStopped = PlayerConfig.Get<bool>("RSBot.Skills.checkLearnMasteryBotStopped");
            if (string.IsNullOrEmpty(selectedMasteryName) || !checkLearnMastery)
                return;
            if (mastery == null)
                return;
            if (!checkLearnMasteryBotStopped && !Kernel.Bot.Running)
                return;
            if (mastery.Level + gap >= Game.Player.Level)
                return;
            UpdateMastery(mastery.Level, mastery.Record, gap);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Plugins/RSBot.Skills/SkillsManager.cs` around lines 73 - 83, The code
dereferences mastery without checking for null; before using mastery.Level or
mastery.Record (in the block that calls UpdateMastery), add a null-check for the
lookup result (the variable mastery obtained from
Game.Player.Skills.Masteries.FirstOrDefault(...) using selectedMasteryName) and
return early (or log and return) if mastery is null so OnSpUpdated cannot crash;
specifically guard the usages in this method (where mastery.Level and
mastery.Record are read) to ensure UpdateMastery is only called with a non-null
mastery.

@Egezenn Egezenn merged commit 39d2554 into Silkroad-Developer-Community:main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant