private void b_PD_Stop_Click(object sender, EventArgs e) //make it cancel current script { b_PD_Stop.Enabled = false; b_PD_Fire.Enabled = true; stop = true; CustomScriptCommands.stopScript = true; if (AsyncCamCom.sock.Connected) { CustomScriptCommands.QuickCommand("stop"); } }
public void DoCommand(int index) { try { if (index > buttonList.Count - 1 || MainForm.m.setPage.dgv_Custom_Buttons.Rows[index].Cells[1].Value == null) { return; } string val = MainForm.m.setPage.dgv_Custom_Buttons.Rows[index].Cells[1].Value.ToString(); if (val.ToLower().Trim().StartsWith("preset")) { string presetValue = ""; bool isDigitPresent = false; foreach (char c in val.ToArray()) { if (char.IsDigit(c)) { isDigitPresent = true; presetValue += c.ToString(); } else if (isDigitPresent) { break; } } if (isDigitPresent) { val = "gotopreset " + presetValue; } } CustomScriptCommands.QuickCommand(val, false); } catch (Exception e) { MessageBox.Show("DO COMMAND\n" + index.ToString() + "\n" + e.ToString()); } }
void Send() { string text = tB_Entry.Text; if (text.Length == 0) { return; } if (customCommand) { CustomScriptCommands.QuickCommand(text, false); } else if (int.TryParse(text, out int output)) { CustomScriptCommands.QuickCommand(command + " " + output.ToString(), false); } InfoPanel.i.UpdateNext(); tB_Entry.Text = ""; this.Close(); }