Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Fixes for newer versions of ASF #15

Closed
wants to merge 3 commits into from
Closed
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: 6 additions & 6 deletions ASFui/ASFProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ private void OutputHandler(object sender, DataReceivedEventArgs e)
var Password = new Password(ASF, e.Data);
Password.ShowDialog();
}
Match match = Regex.Match(e.Data, @".*Key: (.*) \| Status: (OK|DuplicatedKey|InvalidKey|AlreadyOwned|OnCooldown)");
Match match = Regex.Match(e.Data, @".*Key: (.*) \| Status: (NoDetail|DuplicateActivationCode|BadActivationCode|AlreadyPurchased|RateLimited)");
if (match.Success)
{
string key = match.Groups[1].ToString();
string type = match.Groups[2].ToString();
if (("OK".Equals(type) && Properties.Settings.Default.ClearOk) ||
("DuplicatedKey".Equals(type) && Properties.Settings.Default.ClearDuplicated) ||
("InvalidKey".Equals(type) && Properties.Settings.Default.ClearInvalid) ||
("AlreadyOwned".Equals(type) && Properties.Settings.Default.ClearOwned) ||
("OnCooldown".Equals(type) && Properties.Settings.Default.ClearCooldown)) {
if (("NoDetail".Equals(type) && Properties.Settings.Default.ClearOk) ||
("DuplicateActivationCode".Equals(type) && Properties.Settings.Default.ClearDuplicated) ||
("BadActivationCode".Equals(type) && Properties.Settings.Default.ClearInvalid) ||
("AlreadyPurchased".Equals(type) && Properties.Settings.Default.ClearOwned) ||
("RateLimited".Equals(type) && Properties.Settings.Default.ClearCooldown)) {
_asf.tbInput.Invoke(new MethodInvoker(() => {
_asf.tbInput.Text = Regex.Replace(_asf.tbInput.Text.Replace(key, ""), @"\s+", Environment.NewLine);
if (_asf.tbInput.Text.Length < 2) // remove the last newline, if we removed all keys.
Expand Down
14 changes: 7 additions & 7 deletions ASFui/ASFui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public void GetBotList()
{
cbBotList.Invoke(new MethodInvoker(() => cbBotList.Items.Clear()));

var status = Util.SendCommand("statusall");
var matches = Regex.Matches(status, @"Bot (.*) is");
var status = Util.SendCommand("status ASF");
var matches = Regex.Matches(status, @"<(.+?)> Bot is");
cbBotList.Invoke(new MethodInvoker(() =>
{
foreach (Match m in matches)
Expand Down Expand Up @@ -313,7 +313,7 @@ private void btnLootAll_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
sendCommand("lootall");
sendCommand("loot ASF");
});
}

Expand Down Expand Up @@ -373,11 +373,11 @@ private void btnOwnAll_Click(object sender, EventArgs e)
{
if (!tbInput.Text.Equals(""))
{
sendCommand(Util.GenerateCommand("ownsall", string.Empty, Util.MultiToOne(tbInput.Lines)));
sendCommand(Util.GenerateCommand("owns", "ASF", Util.MultiToOne(tbInput.Lines)));
}
else
{
Logging.Error(@"Input required (!ownsall)");
Logging.Error(@"Input required (!owns ASF)");
MessageBox.Show(@"An input is required.", @"Input required", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
Expand Down Expand Up @@ -409,7 +409,7 @@ private void btnStartBot_Click(object sender, EventArgs e)

private void btnStartAll_Click(object sender, EventArgs e)
{
sendCommand("startall");
sendCommand("start ASF");
GetBotList();
}

Expand Down Expand Up @@ -445,7 +445,7 @@ private void btnStatusBot_Click(object sender, EventArgs e)

private void btnStatusAll_Click(object sender, EventArgs e)
{
sendCommand("statusall");
sendCommand("status ASF");
}

#endregion
Expand Down