public void Robot() { Action <string, bool> status = new Action <string, bool>(Update); for (int countdown = 5; countdown >= 0; countdown--) { Invoke(status, "还有" + countdown.ToString() + "开始...", false); Thread.Sleep(1000); } for (int r = R; r >= 1; r--) { foreach (string s in process) { string[] tmp = s.Split(','); uint[] code = ProgressReader.Transcoding(Keyset[tmp[0]]); for (int cramp = 5; cramp > 0; cramp--) { Simulator.Press(Gameptr, code[0], code[1], 20); Thread.Sleep(40); } Thread.Sleep(Convert.ToInt32(tmp[1])); } } Invoke(status, "工业化已完成...\r\n", true); }
public void Machine() { Action <string, bool> status = new Action <string, bool>(Update); for (int countdown = 5; countdown >= 0; countdown--) { Invoke(status, "还有" + countdown.ToString() + "开始...", false); Thread.Sleep(1000); } for (int r = R; r >= 1; r--) { Invoke(status, "剩余<" + r.ToString() + ">次作业...", false); for (int k = 0; k <= 10; k++) { Simulator.Press(Gameptr, 0, 0x60, 20); Thread.Sleep(80); } Thread.Sleep(3000); foreach (string s in process) { string[] tmp = s.Split(','); uint[] code = ProgressReader.Transcoding(Keyset[tmp[0]]); Simulator.Press(Gameptr, code[0], code[1], 20); Thread.Sleep(Convert.ToInt32(tmp[1])); } if (Collection) { Thread.Sleep(3000); for (int k = 0; k <= 10; k++) { Simulator.Press(Gameptr, 0, 0x60, 20); Thread.Sleep(80); } } Thread.Sleep(5000); } Invoke(status, "工业化已完成...\r\n", true); }
private void SelectSetting_Click(object sender, EventArgs e) { try { OpenFileDialog LoadSetting = new OpenFileDialog(); LoadSetting.Filter = "文本文档|*.txt"; LoadSetting.Title = "选择配置"; LoadSetting.InitialDirectory = Environment.CurrentDirectory + ""; if (LoadSetting.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Keyset = ProgressReader.ReadKeyset(LoadSetting.FileName); SettingDir.Text = Path.GetFileNameWithoutExtension(LoadSetting.FileName); debug.AppendText("系统初始化已完成...\r\n"); debug.AppendText("等待加载流水线...\r\n"); } StartBtn.Enabled = true; } catch { MessageBox.Show("请检查脚本", "配方加载失败"); Environment.Exit(0); } }
private void SelectProgress_Click(object sender, EventArgs e) { try { OpenFileDialog LoadProgress = new OpenFileDialog(); LoadProgress.Filter = "文本文档|*.txt"; LoadProgress.Title = "选择脚本"; LoadProgress.InitialDirectory = Environment.CurrentDirectory + ""; if (LoadProgress.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Pipeline = LoadProgress.FileName; ProgressDir.Text = Path.GetFileNameWithoutExtension(Pipeline); process = ProgressReader.Preload(Pipeline); debug.AppendText(String.Format("<{0}> 加载完成...\r\n", ProgressDir.Text)); } StartBtn.Enabled = true; } catch { MessageBox.Show("请检查脚本", "配方加载失败"); Environment.Exit(0); } }