示例#1
0
        private bool _IsQuestAvailable()
        {
            _scrollQuest.UpdateColor(Screen);

            //if scrollQuest pixels are detected this means the quest has NOT been started.
            _isQuestFound = (L2RBot.Screen.CompareColor(_scrollQuest.Color, Colors.ScrollQuest, 2)) ? true : false;
            return(_isQuestFound);
        }
示例#2
0
文件: Main.cs 项目: grosbok/L2RBot
 /// <summary>
 /// Detects movement using Click(), calls Click if idle is detected.
 /// </summary>
 private void IdleCheck()
 {
     if (Timer.ElapsedMilliseconds > IdleTimeInMs)
     {
         if (movePixel.IsPresent(Screen, 2))
         {
             movePixel.UpdateColor(Screen);
             Click(mainQuest.Point);
         }
         movePixel.UpdateColor(Screen);
         Timer.Stop();
         Timer.Reset();
         Timer.Start();
     }
 }
示例#3
0
        /// <summary>
        /// Detects movement using Click(), calls Click if idle is detected.
        /// </summary>
        private void IdleCheck()
        {
            if (Timer.ElapsedMilliseconds > IdleTimeInMs)//Checks both click timers.
            {
                log.Info(BotName + " IdleCheck() Timer condition has been met.");

                ResetTimer();

                StartTimer();

                if (IsCombatScreenUp() && movePixel.IsPresent(Screen, 2))//Looks to see if your map has moved.
                {
                    log.Info(BotName + " IdleCheck()-->None movement detected.");

                    ToggleCombat();

                    Click(mainQuest.Point);
                }
                movePixel.UpdateColor(Screen);
            }
        }
示例#4
0
        /// <summary>
        /// Starts the Alter of Madness Quest logic
        /// </summary>
        public void Start()
        {
            UpdateScreen(); //updates Screen object in parent class with latest window size and x,y location.

            if (BringToFront == true)
            {
                BringWindowToFront();
            }

            if (_finished == true && _riftMenuOpen == false)
            {
                if (IsCombatScreenUp())
                {
                    OpenRiftMenu();
                }
            }

            if (_finished == true && _riftMenuOpen == true)
            {
                EnterDungeon();
            }

            if (IsCombatScreenUp() && _startQuest == false && _finished == false) //look for combat screen, starts Quest once it is detected.
            {
                Thread.Sleep(TimeSpan.FromSeconds(1));
                if (IsRechargeUp())                       //added it here because of timing issues
                {
                    Click(_closeRechargeWindow[0].Point); //closes recharge window if its present.
                    Thread.Sleep(TimeSpan.FromSeconds(.1));
                }
                _startQuest = true;
                Click(new Point(128, 370)); // clicks the quest go button
                _mapPoint.UpdateColor(Screen);
            }

            if (IsCombatScreenUp() && _startQuest == true && _finished == false)
            {
                if (TimeSpan.FromMilliseconds(Timer.ElapsedMilliseconds) > TimeSpan.FromSeconds(15))
                {
                    //checks if there has been any map movement in the last 15 seconds
                    if (_mapPoint.IsPresent(Screen, 0))
                    {
                        //resets quest status by clicking on the auto combat button 3 times
                        //then changes _startQuest to false so i will start the quest again.
                        Click(new Point(876, 684));
                        Thread.Sleep(TimeSpan.FromSeconds(.1));
                        Click(new Point(876, 684));
                        Thread.Sleep(TimeSpan.FromSeconds(.1));
                        Click(new Point(876, 684));
                        Thread.Sleep(TimeSpan.FromSeconds(.1));
                        _startQuest = false;
                    }
                    _mapPoint.UpdateColor(Screen);
                }
            }
            if (NeedRevived())
            {
                Click(SpotRevive[0].Point);
                _startQuest = false;
            }
            if (IsGadgetUp())
            {
                Click(_closeGadgetWindow[0].Point);
                Thread.Sleep(TimeSpan.FromSeconds(.1));
            }
            if (IsRechargeUp())
            {
                Click(_closeRechargeWindow[0].Point);//closes recharge window if its present
                Thread.Sleep(TimeSpan.FromSeconds(.1));
            }
            if (_partyAccept[0].IsPresent(Screen, 2) && _partyAccept[1].IsPresent(Screen, 2))
            {
                Click(PartyAccept[0].Point);
                Thread.Sleep(TimeSpan.FromSeconds(.1));
            }
            if (IsFinished())
            {
                DoAgain();
            }
            Helper.Start();
        }