Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix training, skills, protection, party, inventory, items, map and statistics #692

Merged
merged 20 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d3cb1e9
fix: Fix how the plugin RSBot.Protection is loading default values
DaydreamsDev Aug 2, 2023
e7f301a
fix: Fix RSBot.Protection SDUI.Controls.NumUpDown
DaydreamsDev Aug 2, 2023
a377c2d
fix: Fix RSBot.Training LoadSettings
DaydreamsDev Aug 2, 2023
777f3a5
fix: Fix RSBot.Skills LoadSettings
DaydreamsDev Aug 2, 2023
8e01ed4
Merge pull request #1 from DaydreamsDev/fix/ui-skills
DaydreamsDev Aug 2, 2023
2cefe6d
fix: Other files are using the new stored values in RSBot.Training
DaydreamsDev Aug 2, 2023
16fc127
Merge pull request #2 from DaydreamsDev/fix/ui-training
DaydreamsDev Aug 2, 2023
196df34
fix: Other files are using the new stored values in RSBot.Skills
DaydreamsDev Aug 3, 2023
4c7cbaf
fix: Fix RSBot.Statistics LoadSettings
DaydreamsDev Aug 3, 2023
46aea7d
fix: Fix RSBot.Map LoadSettings
DaydreamsDev Aug 3, 2023
6d43e7d
fix: Fix RSBot.Inventory LoadSettings
DaydreamsDev Aug 3, 2023
dfd8ff3
Merge pull request #3 from DaydreamsDev/fix/ui-inventory
DaydreamsDev Aug 4, 2023
6b73776
docs: Main_Load comment
DaydreamsDev Aug 4, 2023
ebf3046
Merge pull request #4 from DaydreamsDev/fix/ui-map
DaydreamsDev Aug 4, 2023
eb6baf5
docs: Main_Load comment
DaydreamsDev Aug 4, 2023
8b170a8
Merge pull request #5 from DaydreamsDev/fix/ui-skills
DaydreamsDev Aug 4, 2023
61a7f3d
docs: Main_Load comment
DaydreamsDev Aug 4, 2023
d3e7b8e
Merge pull request #6 from DaydreamsDev/fix/ui-statistics
DaydreamsDev Aug 4, 2023
efd4afb
fix: Fix RSBot.Party tab Auto Party LoadSettings
DaydreamsDev Aug 4, 2023
6ba5170
fix: Fix RSBot.Items LoadSettings
DaydreamsDev Aug 4, 2023
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
23 changes: 12 additions & 11 deletions Application/RSBot/Views/Main.Designer.cs

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

16 changes: 15 additions & 1 deletion Application/RSBot/Views/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ private void menuItemExit_Click(object sender, EventArgs e)
}

var exitDialog = new ExitDialog();
if (exitDialog.ShowDialog(this) != DialogResult.Yes)
if (exitDialog.ShowDialog(this) != DialogResult.Yes)
return;

GlobalConfig.Save();
Expand Down Expand Up @@ -919,5 +919,19 @@ private void donateButton_Click(object sender, EventArgs e)
Process.Start(new ProcessStartInfo { FileName = "https://github.com/sponsors/SDClowen", UseShellExecute = true });
Process.Start(new ProcessStartInfo { FileName = "https://www.patreon.com/sdclowen", UseShellExecute = true });
}

/// <summary>
/// Occurs before a tab is selected, enabling a handler to cancel the tab change.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tabMain_Selecting(object sender, TabControlCancelEventArgs e)
{
var selectedTab = (sender as System.Windows.Forms.TabControl).SelectedTab;
if (!selectedTab.Enabled)
{
e.Cancel = true;
}
}
}
}
62 changes: 1 addition & 61 deletions Application/RSBot/Views/Main.resx
Original file line number Diff line number Diff line change
@@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down
2 changes: 1 addition & 1 deletion Botbases/RSBot.Default/Bot/Botbase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void Tick()
item?.Use();
}

var noAttack = PlayerConfig.Get("RSBot.Skills.NoAttack", false);
var noAttack = PlayerConfig.Get("RSBot.Skills.checkBoxNoAttack", false);

//Check for protection
Bundles.Protection.Invoke();
Expand Down
4 changes: 2 additions & 2 deletions Botbases/RSBot.Default/Bundle/Attack/AttackBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void Invoke()
//if (Game.Player.InAction && !SkillManager.IsLastCastedBasic)
// return;

var useTeleportSkill = PlayerConfig.Get("RSBot.Skills.UseTeleportSkill", false);
var useTeleportSkill = PlayerConfig.Get("RSBot.Skills.checkUseTeleportSkill", false);
if (useTeleportSkill && CastTeleportation())
return;

Expand All @@ -62,7 +62,7 @@ public void Invoke()
if (Game.Player.InAction)
return;

if (PlayerConfig.Get("RSBot.Skills.UseDefaultAttack", true))
if (PlayerConfig.Get("RSBot.Skills.checkUseDefaultAttack", true))
SkillManager.CastAutoAttack();

return;
Expand Down
8 changes: 4 additions & 4 deletions Botbases/RSBot.Default/Bundle/Berzerk/BerzerkBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public void Refresh()
{
Config = new BerzerkConfig
{
WhenFull = PlayerConfig.Get<bool>("RSBot.Berzerk.WhenFull"),
BeeingAttackedByAwareMonster = PlayerConfig.Get<bool>("RSBot.Berzerk.MonsterAvoidance"),
SurroundedByMonsters = PlayerConfig.Get<bool>("RSBot.Berzerk.MonsterAmount"),
SurroundingMonsterAmount = PlayerConfig.Get<byte>("RSBot.Berzerk.MonsterAmountNumber", 5)
WhenFull = PlayerConfig.Get<bool>("RSBot.Training.checkBerzerkWhenFull"),
BeeingAttackedByAwareMonster = PlayerConfig.Get<bool>("RSBot.Training.checkBerzerkAvoidance"),
SurroundedByMonsters = PlayerConfig.Get<bool>("RSBot.Training.checkBerzerkMonsterAmount"),
SurroundingMonsterAmount = PlayerConfig.Get<byte>("RSBot.Training.numBerzerkMonsterAmount", 5)
};
}

Expand Down
8 changes: 4 additions & 4 deletions Botbases/RSBot.Default/Bundle/Loop/LoopBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public void Refresh()
Config = new LoopConfig
{
WalkScript = PlayerConfig.Get<string>("RSBot.Walkback.File"),
UseSpeedDrug = PlayerConfig.Get<bool>("RSBot.Walkback.UseSpeedDrug"),
UseVehicle = PlayerConfig.Get<bool>("RSBot.Walkback.UseMount", true),
CastBuffs = PlayerConfig.Get<bool>("RSBot.Walkback.CastBuffs", true),
UseReverse = PlayerConfig.Get<bool>("RSBot.Walkback.UseReverse", false)
UseSpeedDrug = PlayerConfig.Get<bool>("RSBot.Training.checkUseSpeedDrug"),
UseVehicle = PlayerConfig.Get<bool>("RSBot.Training.checkUseMount", true),
CastBuffs = PlayerConfig.Get<bool>("RSBot.Training.checkCastBuffs", true),
UseReverse = PlayerConfig.Get<bool>("RSBot.Training.checkBoxUseReverse", false)
};
}

Expand Down
4 changes: 2 additions & 2 deletions Botbases/RSBot.Default/Bundle/Movement/MovementBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public void Refresh()
{
Config = new MovementConfig
{
WalkAround = PlayerConfig.Get<bool>("RSBot.Area.WalkAround"),
WalkToCenter = PlayerConfig.Get<bool>("RSBot.Area.GoToCenter", true)
WalkAround = PlayerConfig.Get<bool>("RSBot.Training.radioWalkAround"),
WalkToCenter = PlayerConfig.Get<bool>("RSBot.Training.radioCenter", true)
};
}

Expand Down
2 changes: 1 addition & 1 deletion Botbases/RSBot.Default/Bundle/Resurrect/ResurrectBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void Invoke()
Game.Player.HasActiveVehicle)
return;

if (!PlayerConfig.Get<bool>("RSBot.Skills.ResurrectPartyMembers"))
if (!PlayerConfig.Get<bool>("RSBot.Skills.checkResurrectParty"))
return;

foreach (var member in Game.Party.Members)
Expand Down
8 changes: 4 additions & 4 deletions Botbases/RSBot.Default/Bundle/Target/TargetBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void Invoke()
return;
}

var warlockModeEnabled = PlayerConfig.Get<bool>("RSBot.Skills.WarlockMode", false);
var warlockModeEnabled = PlayerConfig.Get<bool>("RSBot.Skills.checkWarlockMode", false);
if (warlockModeEnabled && Game.SelectedEntity.State.HasTwoDots())
return;

Expand All @@ -94,7 +94,7 @@ public void Invoke()

private SpawnedMonster GetFromCurrentAttackers()
{
var attackWeakerFirst = PlayerConfig.Get<bool>("RSBot.Advanced.AttackWeakerMobsFirst");
var attackWeakerFirst = PlayerConfig.Get<bool>("RSBot.Training.checkAttackWeakerFirst");
if (!attackWeakerFirst || !IsEmergencySituation())
return null;

Expand All @@ -118,8 +118,8 @@ private bool IsEmergencySituation()
/// <returns></returns>
private SpawnedMonster GetNearestEnemy()
{
var warlockModeEnabled = PlayerConfig.Get<bool>("RSBot.Skills.WarlockMode");
var ignorePillar = PlayerConfig.Get<bool>("RSBot.Ignores.DimensionPillar");
var warlockModeEnabled = PlayerConfig.Get<bool>("RSBot.Skills.checkWarlockMode");
var ignorePillar = PlayerConfig.Get<bool>("RSBot.Training.checkBoxDimensionPillar");

if (!SpawnManager.TryGetEntities<SpawnedMonster>(m =>
m.State.LifeState == LifeState.Alive &&
Expand Down
Loading