Пример #1
0
        // Connection and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP     = TextBoxIP.Text;
                cfg.Port   = Port;
                Connection = cfg.CreateSync();
                Connection.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = false;
                TextBoxPort.Enabled      = false;
                ButtonSysbotRead.Enabled = true;
                // Player
                SysBotPouchItem1Count.Enabled   = true;
                SysBotPouchItem2Count.Enabled   = true;
                SysBotPouchItem3Count.Enabled   = true;
                SysBotPouchItem4Count.Enabled   = true;
                SysBotPouchItem5Count.Enabled   = true;
                SysBotHunterCoordXCount.Enabled = true;
                SysBotHunterCoordYCount.Enabled = true;
                SysBotHunterCoordZCount.Enabled = true;
                // Quest
                SysBotMonsterHPCount.Enabled = true;
                SysBotHunterHPCount.Enabled  = true;

                Connected          = true;
                ButtonConnect.Text = "Diconnect";
            }
            else
            {
                // Disconnect button behaviour
                Connection.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = true;
                TextBoxPort.Enabled      = true;
                ButtonSysbotRead.Enabled = false;
                // Player
                SysBotPouchItem1Count.Enabled   = false;
                SysBotPouchItem2Count.Enabled   = false;
                SysBotPouchItem3Count.Enabled   = false;
                SysBotPouchItem4Count.Enabled   = false;
                SysBotPouchItem5Count.Enabled   = false;
                SysBotHunterCoordXCount.Enabled = false;
                SysBotHunterCoordYCount.Enabled = false;
                SysBotHunterCoordZCount.Enabled = false;
                // Quest
                SysBotMonsterHPCount.Enabled = false;
                SysBotHunterHPCount.Enabled  = false;

                Connected          = false;
                ButtonConnect.Text = "Connect";
            }
        }
Пример #2
0
        // sb and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP   = TextBoxIP.Text;
                cfg.Port = Port;
                sb       = cfg.CreateSync();
                sb.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = false;
                TextBoxPort.Enabled      = false;
                ButtonSysbotRead.Enabled = true;

                StatusConnection.ForeColor = Color.Green;
                StatusConnection.Text      = "Connected";
                Connected          = true;
                ButtonConnect.Text = "Disconnect";
                SysBotLog.Text    += Environment.NewLine + "Successfully connected.";
            }
            else
            {
                // Disconnect button behaviour
                sb.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = true;
                TextBoxPort.Enabled      = true;
                ButtonSysbotRead.Enabled = false;
                // Player
                SysBotZeniCount.Enabled         = false;
                SysBotPointsCount.Enabled       = false;
                SysBotPouchItem1Count.Enabled   = false;
                SysBotPouchItem2Count.Enabled   = false;
                SysBotPouchItem3Count.Enabled   = false;
                SysBotPouchItem4Count.Enabled   = false;
                SysBotPouchItem5Count.Enabled   = false;
                SysBotHunterCoordXCount.Enabled = false;
                SysBotHunterCoordYCount.Enabled = false;
                SysBotHunterCoordZCount.Enabled = false;
                // Quest
                SysBotHunterHPCount.Enabled      = false;
                SysBotHunterStaminaCount.Enabled = false;
                SysBotMonster1HPCount.Enabled    = false;

                StatusConnection.ForeColor = Color.Red;
                StatusConnection.Text      = "Disconnected";
                Connected          = false;
                ButtonConnect.Text = "Connect";
                SysBotLog.Text    += Environment.NewLine + "Successfully disconnected.";
            }
        }
Пример #3
0
        // sb and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP   = TextBoxIP.Text;
                cfg.Port = Port;
                sb       = cfg.CreateSync();
                sb.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled          = false;
                TextBoxPort.Enabled        = false;
                ButtonSysbotRead.Enabled   = true;
                PointsTotalNumeric.Enabled = true;

                StatusConnection.ForeColor = Color.Green;
                StatusConnection.Text      = "Connected";
                Connected          = true;
                ButtonConnect.Text = "Disconnect";
                SysBotLog.Text    += Environment.NewLine + "Successfully connected.";
            }
            else
            {
                // Disconnect button behaviour
                sb.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled          = true;
                TextBoxPort.Enabled        = true;
                ButtonSysbotRead.Enabled   = false;
                PointsTotalNumeric.Enabled = false;

                StatusConnection.ForeColor = Color.Red;
                StatusConnection.Text      = "Disconnected";
                Connected          = false;
                ButtonConnect.Text = "Connect";
                SysBotLog.Text    += Environment.NewLine + "Successfully disconnected.";
            }
        }