public TimeClickerForm() { InitializeComponent(); hotKeyHandler.Register(Handle, GetType().GetHashCode(), Keys.F6); hotKeyHandler.Register(Handle, GetType().GetHashCode(), Keys.F7); hotKeyHandler.Register(Handle, GetType().GetHashCode(), Keys.F8); configHandler = new ConfigHandler("Data/cf.dat"); var loader = new ScriptXmlLoader(); var script = new WorkerScript(loader.Load(ScriptInfo.AutoPlayPath)); script.Completed += (source, args) => { configHandler.Load(); configHandler.TotalTimeLines++; configHandler.Save(); }; scriptHandler.Register(ScriptInfo.AutoPlay, script); scriptHandler.Register(ScriptInfo.AutoClick, new WorkerAutoClickScript(10)); scriptHandler.Register(ScriptInfo.AutoBuy, new WorkerScript(loader.Load(ScriptInfo.AutoBuyPath))); StatusLabel.Text = "TimeClickerBot " + Version + " - By Tobias Savinainen"; Text = "TimeClickerBot " + Version; Location = new Point() { X = configHandler.StartLocationX, Y = configHandler.StartLocationY }; }
private void ReloadScriptToolStripMenuItem_Click(object sender, EventArgs e) { var loader = new ScriptXmlLoader(); var script = new WorkerScript(loader.Load(ScriptInfo.AutoPlayPath)); script.Completed += (source, args) => { configHandler.Load(); configHandler.TotalTimeLines++; configHandler.Save(); }; configHandler.Load(); scriptHandler.ReloadScript(ScriptInfo.AutoPlay, script); scriptHandler.ReloadScript(ScriptInfo.AutoBuy, new WorkerScript(loader.Load(ScriptInfo.AutoBuyPath))); }