static void bSelectCraftOutput_Hit(object sender, EventArgs e) { try { txtCraftOutput.Text = Deadeye.CurrentSelectionName(); saveSettings(); } catch { } }
static void StartAutoFletcher() { Deadeye.PrintMessageToWindow("Auto-fletching enabled!"); bToggleStartStop.Text = "Stop"; IsEnabled = true; aTimer.Start(); aTimer.Enabled = true; }
private static void CharacterFilter_Logoff(object sender, LogoffEventArgs e) { PluginCore.MyCore.CharacterFilter.Logoff -= CharacterFilter_Logoff; saveSettings(); StopAutoFletcher(); aTimer.Elapsed -= new ElapsedEventHandler(OnTimedEvent); aTimer = null; Deadeye.RemoveEventHandlers(); Deadeye.PrintMessageToWindow("Log off detected!"); }
private static void OnTimedEvent(object sender, ElapsedEventArgs e) { try { Deadeye.MakeIfLow(txtCraftOutput.Text, sldLow.Position, txtCraftInputA.Text, txtCraftInputB.Text); } catch { Deadeye.PrintMessageToWindow("Unknown Error!"); } }
public static void ViewInit() { try { Deadeye.PrintMessageToWindow("Deadeye Starting!"); View = MyClasses.MetaViewWrappers.ViewSystemSelector.CreateViewResource(PluginCore.MyHost, "ExamplePlugin.ViewXML.testlayout.xml"); bSelectCraftOutput = (MyClasses.MetaViewWrappers.IButton)View["bSelectCraftOutput"]; bSelectCraftInputA = (MyClasses.MetaViewWrappers.IButton)View["bSelectCraftInputA"]; bSelectCraftInputB = (MyClasses.MetaViewWrappers.IButton)View["bSelectCraftInputB"]; bToggleStartStop = (MyClasses.MetaViewWrappers.IButton)View["bToggleStartStop"]; txtCraftOutput = (MyClasses.MetaViewWrappers.ITextBox)View["txtCraftOutput"]; txtLow = (MyClasses.MetaViewWrappers.IStaticText)View["txtLow"]; txtCraftInputA = (MyClasses.MetaViewWrappers.ITextBox)View["txtCraftInputA"]; txtCraftInputB = (MyClasses.MetaViewWrappers.ITextBox)View["txtCraftInputB"]; txtCommandOnLogin = (MyClasses.MetaViewWrappers.ITextBox)View["txtCommandOnLogin"]; chkStartOnLogin = (MyClasses.MetaViewWrappers.ICheckBox)View["chkStartOnLogin"]; chkLifetankOnLogin = (MyClasses.MetaViewWrappers.ICheckBox)View["chkLifetankOnLogin"]; sldLow = (MyClasses.MetaViewWrappers.ISlider)View["sldLow"]; sldLow.Change += new EventHandler <MyClasses.MetaViewWrappers.MVIndexChangeEventArgs>(sldLow_Change); bSelectCraftOutput.Hit += new EventHandler(bSelectCraftOutput_Hit); bSelectCraftInputA.Hit += new EventHandler(bSelectCraftInputA_Hit); bSelectCraftInputB.Hit += new EventHandler(bSelectCraftInputB_Hit); chkLifetankOnLogin.Change += ChkLifetankOnLogin_Change; chkStartOnLogin.Change += ChkStartOnLogin_Change; txtCommandOnLogin.Change += TxtCommandOnLogin_Change; PluginCore.MyCore.CharacterFilter.Logoff += CharacterFilter_Logoff; bToggleStartStop.Hit += new EventHandler(bToggleStartStop_Hit); loadConfig(); IsEnabled = DeadeyeSettings.startThisOnLogin; Deadeye.AddEventHandlers(DeadeyeSettings.startLtOnLogin, DeadeyeSettings.startCmdOnLogin); initTimer(); if (IsEnabled) { StartAutoFletcher(); } } catch { Deadeye.PrintMessageToWindow("Unknown issue starting"); } }
public void load() { try { StreamReader sr = new StreamReader(filepath); String line = sr.ReadLine(); while (line != null) { parseConfigLine(line); line = sr.ReadLine(); } sr.Close(); } catch (Exception e) { Deadeye.PrintMessageToWindow("Exception: " + e.Message); } }
public void save() { try { StreamWriter writer = new StreamWriter(filepath, false); writer.WriteLine("a " + inputA); writer.WriteLine("b " + inputB); writer.WriteLine("c " + craftOutput); writer.WriteLine("low " + low); writer.WriteLine("lt " + startLtOnLogin); writer.WriteLine("start " + startThisOnLogin); writer.WriteLine("cmd " + startCmdOnLogin); writer.Close(); Deadeye.PrintMessageToWindow("Saved Deadeye config."); } catch { Deadeye.PrintMessageToWindow("Error saving Deadeye config."); } }
public static void Print(string message) { Deadeye.PrintMessageToWindow(message); }