private void Button3_Click(object sender, EventArgs e) { StarsHostEditor editor = new StarsHostEditor(); editor.Load(@"C:\openwar\Files\game.hst"); editor.SwapPlanets(0x13, 0x16); editor.SwapPlanets(0x130, 40); editor.SwapPlanets(0x14e, 0x3b); editor.SwapPlanets(0x149, 0x2a); editor.SwapPlanets(0x8f, 0x131); editor.SwapPlanets(0x30, 320); editor.SwapPlanets(0xf5, 0x151); editor.SwapPlanets(0x13d, 0x129); editor.SwapPlanets(0x156, 10); editor.SwapPlanets(0x9a, 0x11); editor.SwapPlanets(0xf3, 30); editor.SwapPlanets(0x152, 0x2d); editor.SwapPlanets(0xc6, 0x160); editor.SwapPlanets(0x54, 0x15b); editor.SwapPlanets(50, 0x141); editor.SwapPlanets(11, 0x14b); editor.SaveHST(@"c:\openwar\files\game2.hst"); editor.Save(@"C:\openwar\Files\game.hst", false); Interaction.Beep(); }
private void Button1_Click_1(object sender, EventArgs e) { object obj4; object obj7; int right = 0; int num3 = 0; int num2 = 0; StreamWriter writer = File.CreateText(@"c:\stars\mttest\mttest.txt"); if (ObjectFlowControl.ForLoopControl.ForLoopInitObj(obj4, 100, 100.999, 0.001, ref obj7, ref obj4)) { do { object instance = new StarsHostEditor(); foreach (string str in Strings.Split("hst,m1,x1,xy", ",", -1, CompareMethod.Binary)) { File.Copy(@"c:\stars\mttest\original\game." + str, @"c:\stars\mttest\game." + str, true); } NewLateBinding.LateCall(instance, null, "load", new object[] { @"c:\stars\mttest\game.hst" }, null, null, null, true); Race race = (Race) NewLateBinding.LateIndexGet(RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(instance, null, "races", new object[0], null, null, null)), new object[] { 0 }, null); race.xMTItemBitmap = 0; NewLateBinding.LateCall(instance, null, "save", new object[] { @"c:\stars\mttest\game.hst" }, null, null, null, true); Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.Arguments = @"-g c:\stars\mttest\game.hst"; startInfo.FileName = @"c:\stars\starsjrc4.exe"; startInfo.WorkingDirectory = @"c:\stars\mttest"; startInfo.ErrorDialog = true; startInfo.CreateNoWindow = true; startInfo.WindowStyle = ProcessWindowStyle.Hidden; Process.Start(startInfo).WaitForExit(0xea60); StarsHostEditor editor = new StarsHostEditor(); editor.Load(@"c:\stars\mttest\game.hst"); Race race2 = (Race) NewLateBinding.LateIndexGet(editor.Races(), new object[] { 0 }, null); int left = ((((race2.xEnergyLevel + race2.xWeaponsLevel) + race2.xPropulsionLevel) + race2.xConstructionLevel) + race2.xElectronicsLevel) + race2.xBiologyLevel; num2 |= race2.xMTItemBitmap; writer.WriteLine(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(obj4, ","), Operators.SubtractObject(left, Conversion.Int(RuntimeHelpers.GetObjectValue(obj4)))), ","), race2.xMTItemBitmap)); if (race2.xMTItemBitmap != 0) { right++; } num3 = Conversions.ToInteger(Operators.SubtractObject(num3 + left, Conversion.Int(RuntimeHelpers.GetObjectValue(obj4)))); this.Text = Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.DivideObject(Conversion.Int(Operators.MultiplyObject(obj4, 0x3e8)), 0x3e8), ","), Operators.SubtractObject(left, Conversion.Int(RuntimeHelpers.GetObjectValue(obj4)))), ","), race2.xMTItemBitmap), ",TL"), num3), ",MTc"), right), ",MTi"), num2)); } while (ObjectFlowControl.ForLoopControl.ForNextCheckObj(obj4, obj7, ref obj4)); } writer.Close(); Interaction.MsgBox("Done", MsgBoxStyle.ApplicationModal, null); }