コード例 #1
0
ファイル: Form1.cs プロジェクト: tobsa/TimeClickerBot
        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 };
        }
コード例 #2
0
        public override void Execute(IActionData data = null)
        {
            var sc = new Screen();
            var img = sc.CaptureScreen();

            var handler = new ConfigHandler("Data/cf.dat");
            var imageName = DateTime.Now.ToString("yyyy.MM.dd-H.mm.ss");

            img.Save("Data\\Images\\Image_" + imageName + "_TimeLine-" + handler.TotalTimeLines + ".png", ImageFormat.Png);
        }