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."); }
public static void applyLure(ConsoleKey rodKey, ConsoleKey lureKey) { logger.Info($"Applying lure with key {lureKey} on rod key {rodKey}."); WowProcess.PressKey(lureKey); Thread.Sleep(250); WowProcess.PressKey(rodKey); // Wait for the lure to be applied // We also need longer sleep for re-applying to be not too soon Thread.Sleep(15000); }
/// <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); } }
private void Play_Click(object sender, RoutedEventArgs e) { if (bot == null) { WowProcess.PressKey(ConsoleKey.Spacebar); System.Threading.Thread.Sleep(1500); SetButtonStates(false); botThread = new System.Threading.Thread(new System.Threading.ThreadStart(this.BotThread)); botThread.Start(); // Hide cards after 10 minutes var timer = new Timer { Interval = 1000 * 60 * 10, AutoReset = false }; timer.Elapsed += (s, ev) => this.Dispatch(() => this.LogFlipper.IsFlipped = this.GraphFlipper.IsFlipped = true); timer.Start(); } }