public async Task Update() { Log.Logger.Information("Updating Fight State"); if (_target.Reader.IsDead) { if (!_player.Reader.IsInCombat) { _botStates.Pop(); _botStates.Push(new LootState(_botStates, _player, _keyBindSender)); await _keyBindSender.SimulateKeyPress(KeyBinding.TARGETLASTTARGET); return; } } if (_player.Reader.IsInCombat) { if (_player.Target.Target.Name == _player.Reader.Name) { _lastSpellFailedCode = await _player.Spells.CastSpell(133); } else { await _keyBindSender.SimulateKeyPress(KeyBinding.TARGETNEARESTENEMY); return; } } else { _lastSpellFailedCode = await _player.Spells.CastSpell(133); } switch (_lastSpellFailedCode) { case SpellFailedCode.Success: return; case SpellFailedCode.OutOfRange: await _keyBindSender.SimulateKeyPress(KeyBinding.INTERACTTARGET); return; //case SpellFailedCode.UnitNotInFront: } }
public async Task Update() { Log.Logger.Information("Updating Loot State"); if (!_target.Reader.Exists) { await _keyBindSender.SimulateKeyPress(KeyBinding.TARGETLASTTARGET); } await _keyBindSender.SimulateKeyPress(KeyBinding.INTERACTTARGET); await Task.Delay(4000); _botStates.Pop(); _botStates.Push(new RestState(_botStates, _player)); }
public async Task Update() { Log.Logger.Information("Updating Acquire Target State"); await _keyBindSender.SimulateKeyPress(KeyBinding.TARGETNEARESTENEMY); if (_target.Reader.Exists && !_target.Reader.IsDead && !_target.Reader.IsTapped) { await _keyBindSender.SimulateKeyPress(KeyBinding.STOPAUTORUN); _botStates.Push(new MoveToTargetState(_botStates, _player, _keyBindSender)); return; } await _keyBindSender.SimulateKeyPress(KeyBinding.TURNLEFT); await _keyBindSender.SimulateKeyPress(KeyBinding.TARGETNEARESTENEMY); }
public async Task Update() { Log.Logger.Information("MoveToTarget State: "); if (_player.Spells.CanCast(133)) { _botStates.Pop(); _botStates.Push(new FightState(_botStates, _player, _keyBindSender)); return; } if (!_target.Reader.Exists || _target.Reader.IsDead) { _botStates.Pop(); } else { await _keyBindSender.SimulateKeyPress(KeyBinding.INTERACTTARGET); } }
public async Task <SpellFailedCode> Send() { await _keyBindSender.SimulateKeyPress(_keyBinding); return(_actionsReader.LastFailedSpellId == SpellId ? _actionsReader.FailedCode : SpellFailedCode.Success); }