Esempio n. 1
0
        public frmMain()
        {
            InitializeComponent();

            InitializeHelper();
            InitializeWorker();

            // Warp Hack test
            mHotkey.KeyPressed += new EventHandler <Shaiya.Reader.API.HotKey.KeyPressedEventArgs>(mHotkey_HotKeyPressed);
            mHotkey.RegisterHotKey(Shaiya.Reader.API.HotKey.ModifierKeys.Control, Keys.X);
            mHotkey.RegisterHotKey(Shaiya.Reader.API.HotKey.ModifierKeys.Control, Keys.Y);
            mHotkey.RegisterHotKey(Shaiya.Reader.API.HotKey.ModifierKeys.Control, Keys.Z);

            if (Worker.AttachInstance(InstanceName) == false)
            {
                MessageBox.Show("Der Shaiya Prozess konnte nicht gefunden werden!\nBitte starte Shaiya und dann klicke auf \"Attach\"");

                btnAttach.Enabled = true;
                Status.Update();
                UpdateForm();
                return;
            }

            mBackgroundWorker.RunWorkerAsync();
        }
Esempio n. 2
0
        private void UpdateForm()
        {
            RedrawBars();

            if (Worker.IsActive() == false)
            {
                // try re-attach
                Worker.AttachInstance(frmMain.InstanceName);
                if (Worker.IsActive() == false)
                {
                    lblSqlStatus.Text      = "<nicht im Spiel eingelogged>";
                    lblSqlStatus.ForeColor = Color.Maroon;
                    return;
                }
            }
            if (frmMain.ActiveTime == false)
            {
                return;
            }


            btnPause.Enabled       = true;
            lblSqlStatus.ForeColor = Color.ForestGreen;

            TimeSpan time = DateTime.Now - mStartTime - mPausedTimeSpan;

            UpdateLabels(time);
        }
Esempio n. 3
0
        private void mBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            while (true)
            {
                Worker.ReCache();
                Status.Update();

                mBackgroundWorker.ReportProgress(0);

                Thread.Sleep(frmMain.LoopTime);
            }
        }
Esempio n. 4
0
        private void btnAttach_Click(object sender, EventArgs e)
        {
            if (Worker.AttachInstance(frmMain.InstanceName) == false)
            {
                MessageBox.Show("Der Shaiya Prozess konnte nicht gefunden werden!\nBitte starte Shaiya und dann klicke auf \"Attach\"");

                btnAttach.Enabled = true;
                return;
            }

            mStartTime        = DateTime.Now;
            btnAttach.Enabled = false;
            mBackgroundWorker.RunWorkerAsync();
        }
Esempio n. 5
0
        private void mHotkey_HotKeyPressed(object sender, Shaiya.Reader.API.HotKey.KeyPressedEventArgs e)
        {
            if (Worker.Level < 1 || frmMain.ActiveTime == false)
            {
                return;
            }

            switch (e.Key)
            {
            case Keys.X:
                Worker.writeCharFloat(Shaiya.Reader.API.Constants.EOffsets.PositionX, Worker.PositionX + 10);
                break;

            case Keys.Y:
                Worker.writeCharFloat(Shaiya.Reader.API.Constants.EOffsets.PositionY, Worker.PositionY + 10);
                break;

            case Keys.Z:
                Worker.writeCharFloat(Shaiya.Reader.API.Constants.EOffsets.PositionZ, Worker.PositionZ + 10);
                break;
            }
        }
Esempio n. 6
0
        private void UpdateLabels(TimeSpan ExpTimeSpan)
        {
            int neededExp = (Status.ExpMax - Status.Exp);

            lblLevel.Text = Status.Level.ToString();
            lblName.Text  = Status.Name;

            lblStatusAbw.Text = Status.StatusAbw.ToString();
            lblStatusGes.Text = Status.StatusGes.ToString();
            lblStatusGlu.Text = Status.StatusGlu.ToString();
            lblStatusInt.Text = Status.StatusInt.ToString();
            lblStatusStr.Text = Status.StatusStr.ToString();
            lblStatusWei.Text = Status.StatusWei.ToString();

            lblPos.Text = Status.Position.ToString();

            lblExpBisUp.Text    = neededExp.ToString("0,0");
            lblExpLastKill.Text = Status.ExpLastKill.ToString();
            lblRuntime.Text     = ExpTimeSpan.Hours.ToString("00") + ":" + ExpTimeSpan.Minutes.ToString("00") + ":" + ExpTimeSpan.Seconds.ToString("00");

            if (EarnedEXP > 0)
            {
                UpdateEXP(ExpTimeSpan, neededExp);
            }

            // logged in and still Active Game?
            if (btnLogin.Enabled == false && Worker.IsActive() == true)
            {
                UpdateSQL();
            }
            else if (btnLogin.Enabled == true)
            {
                lblSqlStatus.Text      = "<bitte erst Login klicken>";
                lblSqlStatus.ForeColor = Color.Maroon;
            }
        }