Skip to content

Commit

Permalink
Fix training, skills, protection, party, inventory, items, map and st…
Browse files Browse the repository at this point in the history
…atistics (#692)

Fix training, skills, protection, party, inventory, items, map and statistics
  • Loading branch information
DaydreamsDev authored Aug 9, 2023
1 parent 6e7ea31 commit d19fff0
Show file tree
Hide file tree
Showing 28 changed files with 722 additions and 695 deletions.
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

0 comments on commit d19fff0

Please sign in to comment.