예제 #1
0
 public static void ResetBar1()
 {
     Logging.Debug("AddKey Reset Bars");
     KeyHelper.AddKey("ResetBars", "None", "1", "Indifferent");
     Logging.Debug("SendKey Reset Bars");
     KeyHelper.SendKey("ResetBars");
 }
예제 #2
0
 public BarSpell(int id, int bar, int key, string name)
 {
     this.SpellId         = id;
     this.Bar             = bar;
     this._globalCooldown = new Ticker(1600.0);
     this.Key             = key;
     this.Name            = name;
     KeyHelper.AddKey(name, "", this.Bar.ToString(), this.Key.ToString());
 }
예제 #3
0
파일: BarSpell.cs 프로젝트: semi420/lazybot
 public BarSpell(int id, int bar, int key, string name)
 {
     SpellId         = id;
     Bar             = bar;
     _globalCooldown = new Ticker(1600);
     Key             = key;
     Name            = name;
     KeyHelper.AddKey(name, "", Bar.ToString(), Key.ToString());
 }
예제 #4
0
 public override void Execute(int globalcooldown)
 {
     if (!this.DoesKeyExist)
     {
         return;
     }
     if (!KeyHelper.HasKey(this._name))
     {
         this._spell = (BarSpell)null;
     }
     if (this._spell == null)
     {
         this._spell = BarMapper.GetSpellByName(this._name);
         this._spell.SetCooldown(globalcooldown);
         KeyHelper.AddKey(this._name, "", this._spell.Bar.ToString(), this._spell.Key.ToString());
     }
     this._spell.CastSpell();
 }
예제 #5
0
        public override void Execute(int globalcooldown)
        {
            if (DoesKeyExist)
            {
                if (!KeyHelper.HasKey(_name))
                {
                    _spell = null;
                }
                //Load the spell and set the global cooldown
                if (_spell == null)
                {
                    _spell = BarMapper.GetSpellByName(_name);
                    _spell.SetCooldown(globalcooldown);
                    KeyHelper.AddKey(_name, "", _spell.Bar.ToString(), _spell.Key.ToString());
                }

                _spell.CastSpell();
            }
        }
예제 #6
0
 public bool EngineStart()
 {
     KeyHelper.AddKey("Lure", "None", FishingSettings.LureBar, FishingSettings.LureKey);
     if (!ObjectManager.InGame)
     {
         Logging.Write(LogType.Info, "Enter game before starting the bot");
         return(false);
     }
     if (!ObjectManager.MyPlayer.IsAlive)
     {
         Logging.Write(LogType.Info, "Please ress before starting the bot");
         return(false);
     }
     FishingStates = new List <MainState>
     {
         new StateFish(),
         new StateLure(),
     };
     return(true);
 }
예제 #7
0
        public bool EngineStart()
        {
            FindNode.LoadHarvest();
            FlyingSettings.LoadSettings();
            KeyHelper.AddKey("FMount", "None", FlyingSettings.FlyingMountBar, FlyingSettings.FlyingMountKey);
            KeyHelper.AddKey("Lure", "None", FlyingSettings.LureBar, FlyingSettings.LureKey);
            KeyHelper.AddKey("Waterwalk", "None", FlyingSettings.WaterwalkBar, FlyingSettings.WaterwalkKey);
            KeyHelper.AddKey("CombatStart", "None", FlyingSettings.ExtraBar, FlyingSettings.ExtraKey);
            if (!ObjectManager.InGame)
            {
                Logging.Write(LogType.Info, "Enter game before starting the bot");
                return(false);
            }
            if (ObjectManager.MyPlayer.IsGhost)
            {
                Logging.Write(LogType.Info, "Please ress before starting the bot");
                return(false);
            }
            if (CurrentProfile == null)
            {
                Logging.Write(LogType.Info, "Please load a profile");
                return(false);
            }
            if (CurrentProfile.WaypointsNormal.Count < 2)
            {
                Logging.Write(LogType.Info, "Profile should have more than 2 waypoints");
                return(false);
            }
            Navigation = new FlyingNavigation(CurrentProfile.WaypointsNormal, true, FlyingWaypointsType.Normal);
            Navigator  = new FlyingNavigator();
            ToTown.SetToTown(false);
            switch (CurrentMode)
            {
            case Mode.Normal:
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateGather(),
                    new StateCombat(),
                    new StateRess(),
                    new StateResting(),
                    new StateMailbox(),
                    new StateToTown(),
                    new StateVendor(),
                    new StateFullBags(),
                };
                break;

            case Mode.TestNormal:
                Logging.Write(LogType.Warning,
                              "Starting flying engine in TestNormal mode, next start will be in normal mode");
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateFullBags(),
                };
                break;

            case Mode.TestToTown:
                Logging.Write(LogType.Warning,
                              "Starting flying engine in TestToTown mode, next start will be in normal mode");
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateCombat(),
                    new StateMailbox(),
                    new StateToTown(),
                    new StateVendor(),
                    new StateFullBags(),
                };
                ToTown.SetToTown(true);     //Set town mode to true
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            Stuck.Run();
            FlyingBlackList.Load();
            CloseWindows();
            CurrentMode = Mode.Normal;
            _harvest    = 0;
            _kills      = 0;
            _death      = 0;
            _startTime  = DateTime.Now;
            UpdateStats(0, 0, 0);
            return(true);
        }