Skip to content

Commit

Permalink
Update 2.0.0.3
Browse files Browse the repository at this point in the history
Change:
--> Removed energy charger.
--> We have put the optimizer in the registration window, which will clean the lines when it passes more than or equal to 500.

Bugfixes:
--> Fixed "Spin only EE".
--> Fixed some small problems.
  • Loading branch information
Fede-Coder committed Jun 17, 2019
1 parent d595920 commit 4b8ff94
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 88 deletions.
12 changes: 6 additions & 6 deletions Corvus/DarkOrbit/DarkOrbitAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,14 @@ public async Task<bool> BuildTechAsync(TechFactoryData.TechFactoryItem item, int
return false;
}

public async Task<GateSpinData> SpinGateAsync(GalaxyGate gate, int spinamount)
public async Task<GateSpinData> SpinGateAsync(GalaxyGate gate)
{
var spinUrl = string.Format(Urls.SpinGate, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId,
(int) gate, gate.GetFullName().ToLower(), spinamount);
(int) gate, gate.GetFullName().ToLower());
if (GateData.Samples > 0)
{
spinUrl = string.Format(Urls.SpinGateSample, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId,
(int)gate, gate.GetFullName().ToLower(), spinamount);
(int)gate, gate.GetFullName().ToLower());
}

var resultString = await _httpClient.GetAsyncNoLimit(spinUrl);
Expand All @@ -340,14 +340,14 @@ public async Task<GateSpinData> SpinGateAsync(GalaxyGate gate, int spinamount)
}


EvaluateGateSpin(result, spinamount);
EvaluateGateSpin(result);

return result;
}

private void EvaluateGateSpin(GateSpinData spin, int spinamount)
private void EvaluateGateSpin(GateSpinData spin)
{
GateItemsReceived.TotalSpins += spinamount;
GateItemsReceived.TotalSpins++;
GateData.Samples = spin.Samples;
GateData.EnergyCost.Text = spin.EnergyCost.Text;
GateData.Money = spin.Money;
Expand Down
67 changes: 19 additions & 48 deletions Corvus/FrmMain.Designer.cs

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

47 changes: 17 additions & 30 deletions Corvus/FrmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public FrmMain()
tabPageLogin.Enabled = true;
comboBoxLoginPortal.SelectedIndex = 0;
comboBoxOptionABG.SelectedIndex = 0;
comboBoxEnergyCharge.SelectedIndex = 0;

_prometiumCollectorRow = dgvSkylab.Rows[dgvSkylab.Rows.Add("Prometium Collector", 0, false, "", false)];
_enduriumCollectorRow = dgvSkylab.Rows[dgvSkylab.Rows.Add("Endurium Collector", 0, false, "", false)];
Expand Down Expand Up @@ -896,11 +895,20 @@ private async Task ExecuteSpinAsync()


if (_account.GateData.EnergyCost.Text > _account.GateData.Money && _account.GateData.Samples <= 0)
{
Stopping_gate_mode("no_uridium/ee_left");
if (_account.GateData.Money <= (int) nudMinimumUridium.Value)
return;
}
if (_account.GateData.Money <= (int)nudMinimumUridium.Value)
{
Stopping_gate_mode("minimum_uridium_reached");
return;
}
if (chkSpinOnlyEE.Checked && _account.GateData.Samples <= 0)
{
Stopping_gate_mode("no_ee_left");
return;
}

if (rbBuildABG.Checked)
Log("Spinning ABG...");
Expand All @@ -909,7 +917,7 @@ private async Task ExecuteSpinAsync()
else
Log($"Spinning {GetSelectedGate().GetFullName()}...");

var spin = await _account.SpinGateAsync(GetSelectedGate(), getEnergyCharge());
var spin = await _account.SpinGateAsync(GetSelectedGate());
foreach (var allItem in spin.Items.GetAllItems())
{
if (allItem.Duplicate)
Expand Down Expand Up @@ -1219,6 +1227,12 @@ private void dataGridView_SelectionChanged(object sender, EventArgs e)
rtbLog.AppendText(dt + text + Environment.NewLine);
rtbLog.ScrollToCaret();
}

if (rtbLog.Lines.Length >= 500)
{
rtbLog.Clear();
rtbLog.Focus();
}
}

private void SaveSettings(bool confirm = false)
Expand Down Expand Up @@ -1259,7 +1273,6 @@ private void SaveSettings(bool confirm = false)
iniData["Login"]["Reconnect"] = chkBoxReconnect.Checked.ToString();

iniData["GalaxyGates"]["Spin"] = chkBoxSpinGate.Checked.ToString();
iniData["GalaxyGates"]["EnergyCharge"] = comboBoxEnergyCharge.SelectedItem.ToString();
iniData["GalaxyGates"]["Delay"] = nudGateDelay.Text;
iniData["GalaxyGates"]["Wait"] = nudGateWait.Text;
iniData["GalaxyGates"]["MinUridium"] = nudMinimumUridium.Text;
Expand Down Expand Up @@ -1332,7 +1345,6 @@ private void LoadSettings()
chkBoxReconnect.Checked = bool.Parse(iniData["Login"]["Reconnect"]);

chkBoxSpinGate.Checked = bool.Parse(iniData["GalaxyGates"]["Spin"]);
comboBoxEnergyCharge.SelectedIndex = comboBoxEnergyCharge.Items.IndexOf(iniData["GalaxyGates"]["EnergyCharge"]);
nudGateDelay.Value = decimal.Parse(iniData["GalaxyGates"]["Delay"]);
nudGateWait.Value = decimal.Parse(iniData["GalaxyGates"]["Wait"]);
nudMinimumUridium.Value = decimal.Parse(iniData["GalaxyGates"]["MinUridium"]);
Expand Down Expand Up @@ -1425,23 +1437,6 @@ private String getOptionforABG()
}
}

private int getEnergyCharge()
{
switch (GetSelecetedIndex_comboBoxEnergyCharge())
{
case 0:
return 1;
case 1:
return 5;
case 2:
return 10;
case 3:
return 100;
default:
return 0;
}
}

public void setGatesBuilt(GalaxyGate gate)
{
switch ((int) gate)
Expand Down Expand Up @@ -1510,14 +1505,6 @@ public void Stopping_gate_mode(String value)
_nextRunGalaxyGate = DateTime.Now.AddMinutes((double)nudGateWait.Value);
}

private int GetSelecetedIndex_comboBoxEnergyCharge()
{
if (comboBoxEnergyCharge.InvokeRequired)
return (int)comboBoxEnergyCharge.Invoke(new Func<int>(GetSelecetedIndex_comboBoxEnergyCharge));
else
return comboBoxEnergyCharge.SelectedIndex;
}

private int GetSelecetedIndex_comboBoxOptionABG()
{
if (comboBoxOptionABG.InvokeRequired)
Expand Down
4 changes: 2 additions & 2 deletions Corvus/Http/Urls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public static string Build(string url)
public static string UpgradeSkylab { get; } = "{0}/indexInternal.es?action=internalSkylab&subaction=upgrade&construction={1}&reloadToken={2}";

public static string SpinGate { get; } =
"{0}/flashinput/galaxyGates.php?userID={1}&action=multiEnergy&sid={2}&gateID={3}&{4}=1&multiplier=1&spinamount={5}";
"{0}/flashinput/galaxyGates.php?userID={1}&action=multiEnergy&sid={2}&gateID={3}&{4}=1&multiplier=1";

public static string SpinGateSample { get; } =
"{0}/flashinput/galaxyGates.php?userID={1}&action=multiEnergy&sid={2}&gateID={3}&{4}=1&multiplier=1&sample=1&spinamount={5}";
"{0}/flashinput/galaxyGates.php?userID={1}&action=multiEnergy&sid={2}&gateID={3}&{4}=1&multiplier=1&sample=1";

public static string GateInfo { get; } =
"{0}/flashinput/galaxyGates.php?userID={1}&action=init&sid={2}";
Expand Down
4 changes: 2 additions & 2 deletions Corvus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(true)]
[assembly: Guid("4e3b77da-9856-4d1e-9bba-cb3260dc1f33")]
[assembly: AssemblyVersion("2.0.0.2")]
[assembly: AssemblyFileVersion("2.0.0.2")]
[assembly: AssemblyVersion("2.0.0.3")]
[assembly: AssemblyFileVersion("2.0.0.3")]

0 comments on commit 4b8ff94

Please sign in to comment.