Quote:
Originally Posted by Dragonelf1337
// Does not work with current patch
|
can you make it work with current patch?
Code:
public frmMain()
{
this.InitializeComponent();
}
// Token: 0x0600001C RID: 28 RVA: 0x00002790 File Offset: 0x00000990
private void cmdStartStop_Click(object sender, EventArgs e)
{
bool flag = !Versioned.IsNumeric(this.txtCloseGameAt.Text);
if (flag)
{
Interaction.MsgBox("Enter a valid number", MsgBoxStyle.OkOnly, null);
}
else
{
bool flag2 = Operators.CompareString(this.cmdStartStop.Text, "Start", false) == 0;
if (flag2)
{
this.cmdStartStop.Text = "Stop";
this.cmdStartStop.BackColor = Color.Firebrick;
this.txtCurrentLife.Text = "";
this.txtMaxLife.Text = "";
this.txtLifePercent.Text = "";
this.tmrChicken.Enabled = true;
}
else
{
this.cmdStartStop.Text = "Start";
this.cmdStartStop.BackColor = Color.Lime;
this.tmrChicken.Enabled = false;
this.txtCurrentLife.Text = "";
this.txtMaxLife.Text = "";
this.txtLifePercent.Text = "";
}
}
}
// Token: 0x0600001D RID: 29 RVA: 0x000028B0 File Offset: 0x00000AB0
private void tmrChicken_Tick(object sender, EventArgs e)
{
bool flag = Process.GetProcessesByName("D2R").Count<Process>() == 0;
if (flag)
{
this.txtCurrentLife.Text = "Game not found";
this.txtMaxLife.Text = "Game not found";
this.txtLifePercent.Text = "Game not found";
}
else
{
GameData gameData = new GameData(Process.GetProcessesByName("D2R").ElementAt(0));
bool flag2 = gameData.mapSeed == 0;
if (flag2)
{
this.txtCurrentLife.Text = "Not in a Game";
this.txtMaxLife.Text = "Not in a Game";
this.txtLifePercent.Text = "Not in a Game";
}
else
{
int num = Conversions.ToInteger(gameData.getStatValue(6));
int num2 = Conversions.ToInteger(gameData.getStatValue(7));
double num3 = Math.Round((double)num / (double)num2, 2) * 100.0;
this.txtCurrentLife.Text = num.ToString();
this.txtMaxLife.Text = num2.ToString();
this.txtLifePercent.Text = num3.ToString();
bool flag3 = num3 < (double)int.Parse(this.txtCloseGameAt.Text);
if (flag3)
{
this.cmdStartStop.PerformClick();
while (Process.GetProcessesByName("D2R").Count<Process>() > 0)
{
try
{
Process.GetProcessesByName("D2R").ElementAt(0).Kill();
}
catch (Exception ex)
{
}
}
}
}
}
}