julianperrott/FishingFun

Using with Fishing Buddy addon

BanditTech opened this issue · 0 comments

I have to say first of all, wow! Great work creating the algorithms to detect the bobber and its movement.

I poked around and made some modifications to the source so that it would cast with two middle mouse button clicks instead of a key. If using the Fishing Buddy addon it will do all sorts of stuff for you automatically like apply the appropriate lure for the zone you are in!

Works wonderfully for the new shadowlands baits, just make sure to remove the Lost Sole Bait from the DB list and your set :)

Other setup requirements is to configure fishing buddy to opperate on middle mouse click, and to unbind middle mouse click from forward movement within the game Keybindings.

Here are the edits made:

Replace the key press with Middle Mouse Button

// WowProcess.PressKey(castKey);
WowProcess.MiddleClickMouse();
Thread.Sleep(120 + random.Next(0, 87));
WowProcess.MiddleClickMouse();

Add this to wowprocess namespace:

public static void MiddleClickMouse()
{
    var activeProcess = GetActiveProcess();
    var wowProcess = WowProcess.Get();
    if (wowProcess != null)
    {
        var oldPosition = System.Windows.Forms.Cursor.Position;
        PostMessage(wowProcess.MainWindowHandle, Keys.WM_MBUTTONDOWN, Keys.VK_RMB, 0);
        Thread.Sleep(30 + random.Next(0, 47));
        PostMessage(wowProcess.MainWindowHandle, Keys.WM_MBUTTONUP, Keys.VK_RMB, 0);
    }
}

and add the key codes to the keys definition

public const UInt32 WM_MBUTTONDOWN = 0x207;
public const UInt32 WM_MBUTTONUP = 0x208;

I am wondering if this is something you would be willing to receive a pull request for, if I was able to figure out a way to add a toggle to the menu for it?