Exemplo n.º 1
0
        private void onStart(object sender, EventArgs e)
        {
            if (!Mineful.currentMinerStatus())                // Mineful isn't working
            {
                Mineful.setApplicationInfo(Credentials.UID,
                                           Credentials.SECRET);
                Mineful.setCPULimit((int)cpuLimitSpinner.Value);

                if (portComboBox.Text == "Detect")
                {
                    startButton.Enabled = false;
                    startButton.Text    = "Detecting Port...";
                    Mineful.startTestingWithOrders(Credentials.AUTHCODE, new OnFinishedTesting((port) =>
                    {
                        if (port == -1)
                        {
                            startButton.Invoke(new Action(() => {
                                startButton.Text    = "Start";
                                startButton.Enabled = true;
                            }));

                            return;
                        }

                        startButton.Invoke(new Action(() => {
                            startButton.Text    = "Stop";
                            startButton.Enabled = true;
                        }));
                        Mineful.startMiningWithOrders(
                            port,                                       // port number
                            "x",                                        // password
                            SystemInfo.logicalCores() / 2,              // number of cores
                            "warn",                                     // slow memory option
                            amdRadio.Checked ? "amd" :
                            nvidiaRadio.Checked ? "nvidia" :
                            detectRadio.Checked ? "detect" :
                            "none",                                     // gpu mode
                            Credentials.AUTHCODE                        // authorization code
                            );
                    }));
                }
                else
                {
                    Mineful.startMiningWithOrders(
                        Int32.Parse(portComboBox.Text),                 // port number
                        "x",                                            // password
                        SystemInfo.logicalCores() / 2,                  // number of cores
                        "warn",                                         // slow memory option
                        amdRadio.Checked ? "amd" :
                        nvidiaRadio.Checked ? "nvidia" :
                        detectRadio.Checked ? "detect" :
                        "none",                                         // gpu mode
                        Credentials.AUTHCODE                            // authorization code
                        );
                    startButton.Text = "Stop";
                }
            }
            else
            {
                Mineful.stopMining();

                startButton.Text = "Start";
            }
        }
Exemplo n.º 2
0
 private void onAppClosing(object sender, FormClosingEventArgs e)
 {
     Mineful.stopMining();                             // Stop mining
 }