public void Start() { biteWatcher.FishingEventHandler = (e) => FishingEventHandler?.Invoke(this, e); isEnabled = true; DoTenMinuteKey(); while (isEnabled) { try { logger.Info($"Pressing key {castKey} to Cast."); PressTenMinKeyIfDue(); FishingEventHandler?.Invoke(this, new FishingEvent { Action = FishingAction.Cast }); WowProcess.PressKey(castKey); Watch(2000); WaitForBite(); } catch (Exception e) { logger.Error(e.ToString()); Sleep(2000); } } logger.Error("Bot has Stopped."); }
/// <summary> /// Ten minute key can do anything you want e.g. /// Macro to apply a lure: /// /use Bright Baubles /// /use 16 /// /// Or a macro to delete junk: /// /run for b=0,4 do for s=1,GetContainerNumSlots(b) do local n=GetContainerItemLink(b,s) if n and (strfind(n,"Raw R") or strfind(n,"Raw Spot") or strfind(n,"Raw Glo") or strfind(n,"roup")) then PickupContainerItem(b,s) DeleteCursorItem() end end end /// </summary> private void DoTenMinuteKey() { StartTime = DateTime.Now; logger.Info($"Pressing key {tenMinKey} to run a macro."); FishingEventHandler?.Invoke(this, new FishingEvent { Action = FishingAction.Cast }); foreach (var key in tenMinKey) { WowProcess.PressKey(key); } }
private void PressTenMinKey() { if ((DateTime.Now - StartTime).TotalMinutes > 10 && tenMinKey.Count > 0) { StartTime = DateTime.Now; logger.Info($"Pressing key {tenMinKey} to run a macro."); FishingEventHandler?.Invoke(this, new FishingEvent { Action = FishingAction.Cast }); foreach (var key in tenMinKey) { WowProcess.PressKey(key); } } }
/// <summary> /// Ten minute key can do anything you want e.g. /// Macro to apply a lure: /// /use Bright Baubles /// /use 16 /// /// Or a macro to delete junk: /// /run for b=0,4 do for s=1,GetContainerNumSlots(b) do local n=GetContainerItemLink(b,s) if n and (strfind(n,"Raw R") or strfind(n,"Raw Spot") or strfind(n,"Raw Glo") or strfind(n,"roup")) then PickupContainerItem(b,s) DeleteCursorItem() end end end /// </summary> private void DoTenMinuteKey() { StartTime = DateTime.Now; if (tenMinKey.Count == 0) { logger.Info($"Ten Minute Key: No keys defined in tenMinKey, so nothing to do (Define in call to FishingBot constructor)."); } FishingEventHandler?.Invoke(this, new FishingEvent { Action = FishingAction.Cast }); foreach (var key in tenMinKey) { logger.Info($"Ten Minute Key: Pressing key {key} to run a macro, delete junk fish or apply a lure etc."); WowProcess.PressKey(key); } }