Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Application/OasisBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ namespace RSBot;
internal static class Program
{
[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();
private static extern bool FreeConsole();

[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

private const int SW_HIDE = 0;
private const int SW_SHOW = 5;
public static string AssemblyTitle = Assembly
.GetExecutingAssembly()
.GetCustomAttribute<AssemblyProductAttribute>()
Expand Down Expand Up @@ -105,15 +100,14 @@ private static void Main(string[] args)
}
else
{
var handle = GetConsoleWindow();
ShowWindow(handle, SW_HIDE);
FreeConsole();

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);

Main mainForm = new Main();
SplashScreen splashScreen = new SplashScreen(mainForm);
SplashScreen splashScreen = new SplashScreen(mainForm);
splashScreen.ShowDialog();

Application.Run(mainForm);
Expand Down
Binary file modified Application/OasisBot/Resources/tray.ico
Binary file not shown.
Binary file modified Application/OasisBot/Resources/tray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions Application/OasisBot/Views/SplashScreen.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Application/OasisBot/tray.ico
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
RSBot.Main.Character.label3="Oro:"
RSBot.Main.Character.label2="Nivel:"
RSBot.Main.Panel.btnSave="Guardar"
RSBot.Main.fileToolStripMenuItem="Menu"
RSBot.Main.menuItemExit="Salir"
RSBot.Main.viewToolStripMenuItem="Ver"
RSBot.Main.menuSidebar="Barra Lateral"
RSBot.Main.toolsToolStripMenuItem="Bucle"
RSBot.Main.menuScriptRecorder="Grabar Script"
RSBot.Main.menuPlugins="Plugins"
RSBot.Main.languageToolStripMenuItem="Idioma"
RSBot.Main.themeToolStripMenuItem="Tema"
RSBot.Main.darkToolStripMenuItem="Negro"
RSBot.Main.lightToolStripMenuItem="Blanco"
RSBot.Main.coloredToolStripMenuItem="Elegir Color"
RSBot.Main.aboutToolStripMenuItem="Acerca"
RSBot.Main.thisToolStripMenuItem="OasisBot"
RSBot.ScriptRecorder.Panel.labelStatus="<Inactivo>"
RSBot.ScriptRecorder.Panel.btnRunNow="Correr"
RSBot.ScriptRecorder.Panel.btnSave="Guardar"
RSBot.ScriptRecorder.Panel.btnClear="Limpiar"
RSBot.ScriptRecorder.Panel.btnStart="Grabar"
RSBot.ExitDialog.Panel.btnNo="No"
RSBot.ExitDialog.Panel.btnYes="Si"
RSBot.ExitDialog.Panel.checkDontAskAgain="No Preguntar de nuevo"
RSBot.ExitDialog.labelInfo="Está seguro de que desea salir de OasisBot?
Esto lo desconectará del Servidor Silkroad!"
LabelPlayerName="Desconectado"
LabelEntityName="No se ha seleccionado ninguna entidad."
LabelPetName="< Sin nombre >"
NotifyPleaseSelectProperBotBase="Seleccione una base de bots adecuada e inténtelo de nuevo."
NotifyPlayerWasNull="Tu personaje tiene que estar en el juego para iniciar el bot."
Running="Corriendo"
Ready="Listo"
Start="Grabar"
Stop="Detener"
Idle="Inactivo"
Recording="Grabando..."
StopingBot="Deteniendo el bot [{0}]"
StartBot="Iniciar BOT"
StopBot="Detener BOT"
NoBotbaseDetected="¡No se ha detectado ninguna base de bots!"
NoBotbaseDetectedDesc="The bot can not be run without any botbase!\n Please install a proper botbase and try again.\n You can find help at https://silkroad-developer-community.github.io/OasisBot"
SaveRecordedScript="Guardar Script."
RunNow="Correr"
StopRunning="Detener"
OpenFileDialogTitle="Seleccione su archivo ejecutable de Silkroad para continuar..."
ClientTypeInputDialogTitle="¡Selecciona tu tipo de cliente!"
ClientTypeInputDialogContent="¡Seleccione el tipo de juego para que OasisBot funcione correctamente!"
SelectSroDirWarn="¡Seleccione un directorio de Silkroad adecuado!"
ClientTypeNotSelected="Está configurado en 'Vietnam' por ahora porque no ha seleccionado ningún tipo de juego."
ConfigureTrainingAreaBeforeStartBot="Please configure the training area before start the bot!"
PleaseEnterGame="¡Por favor ingrese al juego!"
RSBot.Main.Character.label3="Oro:"
RSBot.Main.Character.label2="Nivel:"
RSBot.Main.Panel.btnSave="Guardar"
RSBot.Main.fileToolStripMenuItem="Menu"
RSBot.Main.menuItemExit="Salir"
RSBot.Main.viewToolStripMenuItem="Ver"
RSBot.Main.menuSidebar="Barra Lateral"
RSBot.Main.toolsToolStripMenuItem="Bucle"
RSBot.Main.menuScriptRecorder="Grabar Script"
RSBot.Main.menuPlugins="Plugins"
RSBot.Main.languageToolStripMenuItem="Idioma"
RSBot.Main.themeToolStripMenuItem="Tema"
RSBot.Main.darkToolStripMenuItem="Negro"
RSBot.Main.lightToolStripMenuItem="Blanco"
RSBot.Main.coloredToolStripMenuItem="Elegir Color"
RSBot.Main.aboutToolStripMenuItem="Acerca"
RSBot.Main.thisToolStripMenuItem="OasisBot"
RSBot.ScriptRecorder.Panel.labelStatus="<Inactivo>"
RSBot.ScriptRecorder.Panel.btnRunNow="Correr"
RSBot.ScriptRecorder.Panel.btnSave="Guardar"
RSBot.ScriptRecorder.Panel.btnClear="Limpiar"
RSBot.ScriptRecorder.Panel.btnStart="Grabar"
RSBot.ExitDialog.Panel.btnNo="No"
RSBot.ExitDialog.Panel.btnYes="Si"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix Spanish accent in confirmation label.

"Si" should be "Sí" in Spanish UI text.

Proposed fix
-RSBot.ExitDialog.Panel.btnYes="Si"
+RSBot.ExitDialog.Panel.btnYes="Sí"
📝 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.

Suggested change
RSBot.ExitDialog.Panel.btnYes="Si"
RSBot.ExitDialog.Panel.btnYes=""
🤖 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 `@Dependencies/Languages/OasisBot/es_ES.rsl` at line 24, Update the Spanish
confirmation label RSBot.ExitDialog.Panel.btnYes to use the correct accented
character: change its value from "Si" to "Sí" (ensure the file is saved with
UTF-8 encoding so the accent persists).

RSBot.ExitDialog.Panel.checkDontAskAgain="No Preguntar de nuevo"
RSBot.ExitDialog.labelInfo="Está seguro de que desea salir de OasisBot?
Esto lo desconectará del Servidor Silkroad!"
LabelPlayerName="Desconectado"
LabelEntityName="No se ha seleccionado ninguna entidad."
LabelPetName="< Sin nombre >"
NotifyPleaseSelectProperBotBase="Seleccione una base de bots adecuada e inténtelo de nuevo."
NotifyPlayerWasNull="Tu personaje tiene que estar en el juego para iniciar el bot."
Running="Corriendo"
Ready="Listo"
Start="Grabar"
Stop="Detener"
Idle="Inactivo"
Recording="Grabando..."
StopingBot="Deteniendo el bot [{0}]"
StartBot="Iniciar BOT"
StopBot="Detener BOT"
NoBotbaseDetected="¡No se ha detectado ninguna base de bots!"
NoBotbaseDetectedDesc="The bot can not be run without any botbase!\n Please install a proper botbase and try again.\n You can find help at https://silkroad-developer-community.github.io/OasisBot"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate remaining English strings in es_ES locale.

These two entries are still English, which breaks localization consistency in Spanish mode.

Proposed fix
-NoBotbaseDetectedDesc="The bot can not be run without any botbase!\n Please install a proper botbase and try again.\n You can find help at https://silkroad-developer-community.github.io/OasisBot"
+NoBotbaseDetectedDesc="¡El bot no puede ejecutarse sin una base de bots!\nPor favor, instala una base de bots adecuada e inténtalo de nuevo.\nPuedes encontrar ayuda en https://silkroad-developer-community.github.io/OasisBot"

-ConfigureTrainingAreaBeforeStartBot="Please configure the training area before start the bot!"
+ConfigureTrainingAreaBeforeStartBot="¡Por favor, configura el área de entrenamiento antes de iniciar el bot!"

Also applies to: 52-52

🤖 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 `@Dependencies/Languages/OasisBot/es_ES.rsl` at line 43, Two localization
entries remain in English; update the Spanish locale by replacing the English
text for NoBotbaseDetectedDesc and the other untranslated entry at the same
block (the string on line 52) with proper Spanish translations. Locate the
NoBotbaseDetectedDesc and the second untranslated key in the es_ES resource
file, provide idiomatic Spanish equivalents (including the help URL), and ensure
newline sequences (\n) are preserved exactly as in the original string.

SaveRecordedScript="Guardar Script."
RunNow="Correr"
StopRunning="Detener"
OpenFileDialogTitle="Seleccione su archivo ejecutable de Silkroad para continuar..."
ClientTypeInputDialogTitle="¡Selecciona tu tipo de cliente!"
ClientTypeInputDialogContent="¡Seleccione el tipo de juego para que OasisBot funcione correctamente!"
SelectSroDirWarn="¡Seleccione un directorio de Silkroad adecuado!"
ClientTypeNotSelected="Está configurado en 'Vietnam' por ahora porque no ha seleccionado ningún tipo de juego."
ConfigureTrainingAreaBeforeStartBot="Please configure the training area before start the bot!"
PleaseEnterGame="¡Por favor ingrese al juego!"
14 changes: 10 additions & 4 deletions Plugins/RSBot.General/GeneralCLICommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using RSBot.Core.Components;
using RSBot.Core.Components.Command;
using System;
using System.Threading.Tasks;

namespace RSBot.General;

Expand All @@ -12,12 +13,17 @@ public class StartClientCommand : ICLICommand

public void Execute(string[] args)
{
GeneralPlugin.Instance.Manager.StartClientAsync().ContinueWith(task =>
_ = Task.Run(async () =>
{
if (task.IsFaulted)
Log.Error($"Failed to start client: {task.Exception?.InnerException?.Message ?? task.Exception?.Message}");
else
try
{
await GeneralPlugin.Instance.Manager.StartClientAsync().ConfigureAwait(false);
Log.Notify("Client started");
}
catch (Exception ex)
{
Log.Error($"Failed to start client: {ex.Message}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Log the full exception for better debuggability.

Logging only ex.Message loses the stack trace and any inner exceptions, making debugging failures more difficult. Consider logging the full exception object.

📝 Proposed fix to log the full exception
-                Log.Error($"Failed to start client: {ex.Message}");
+                Log.Error($"Failed to start client: {ex}");

Alternatively, if you want to keep the prefix message:

-                Log.Error($"Failed to start client: {ex.Message}");
+                Log.Error(ex);
📝 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.

Suggested change
Log.Error($"Failed to start client: {ex.Message}");
Log.Error($"Failed to start client: {ex}");
🤖 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.General/GeneralCLICommands.cs` at line 25, Replace the current
Log.Error call that only logs ex.Message so the full exception (including stack
trace and inner exceptions) is logged; in GeneralCLICommands.cs locate the
Log.Error(...) line that references ex and change it to pass the exception
object into the logger (e.g. use the Log.Error overload that accepts an
Exception and a message) so the log contains both the "Failed to start client"
context and the full exception details.

}
});
}
}
Expand Down
Loading