[question] Anyone found a way to mouse navigate with C#? menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Learner's Avatar Member
    Reputation
    1
    Join Date
    May 2007
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [question] Anyone found a way to mouse navigate with C#?

    NOTE: this is for Aion (but prolly pretty similar in WOW)

    I am able to send a mouse-down event using keybd_event and also using sendinput, but I cannot simulate actually moving the mouse.

    I have tried the Cursor.Position command (mouse down -> cursor.position -> mouse up), and it does place the cursor in the new spot, but the actual movement part is lost... I think the cursor command simply redraws the mouse in the new spot - there are definitely some finer mouse monitoring steps that are being lost by the game when I do this =(

    So, I was just wondering if anyone has found a way to make this work?

    I suspect I will be fine using just the movement keys, but prefer the finer granularity of the mouse movement... AND, it would allow me to quickly reset the camera view in a clean way if the bot borks the camer angle.

    [question] Anyone found a way to mouse navigate with C#?
  2. #2
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Normally I wouldn't bump, but since this is probably a common question I decided to post anyway.

    Code:
    using System;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using System.Drawing;
    
    namespace Eradicator
    {
        public static class Mouse
        {
            [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
            private static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
    
            public static void Click(MouseButton button, int x, int y)
            {
                Cursor.Position = new Point(x, y);
                mouse_event((int)button, x, y, 0, 0);
            }
        }
    
        [Flags]
        public enum MouseButton : int
        {
            LeftDown = 0x02,
            LeftUp = 0x04,
    
            RightDown = 0x08,
            RightUp = 0x10,
    
            LeftClick = LeftDown | LeftUp,
            RightClick = RightDown | RightUp,
        }
    }
    Then using it, this would click button1.

    Code:
                Point p = this.PointToScreen(Point.Empty);
                Mouse.Click(MouseButton.LeftClick, p.X + button1.Left + 5, p.Y + button1.Top + 5);
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  3. #3
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [vb.net, but..]
    add a new module (or..wherever you want a public struct) and..
    Public Enum MouseFlags As Int32
    LEFTDOWN = &H2
    LEFTUP = &H4
    MIDDLEDOWN = &H20 'not used
    MIDDLEUP = &H40 'not used
    MOVE = &H1 'used the most
    ABSOLUTE = &H8000 'not used
    RIGHTDOWN = &H8
    RIGHTUP = &H10
    End Enum

    ::turn_left a little //assumes the mouse is over the wow form (in a right-click-turn area) and it is the active application
    mouse_event(Flags.RightDown,0,0,0,0)
    mouse_event(Flags.Move,-20,0,0,0)
    mouse_event(Flags.RightUp,0,0,0,0)
    ::::::::::::::::::::::::::::::::::::::::

    ..a weird run_forward::
    mouse_event(Flags.RightDown,0,0,0,0)
    threading.thead.sleep(250)
    mouse_event(Flags.LeftDown,0,0,0,0)
    //both mouse buttons are down (RIGHT first)..should be running forward
    Last edited by abuckau907; 02-24-2010 at 05:03 AM.

Similar Threads

  1. Anyone know any way of bgs/arenas with locked xp? [Twink]
    By bloodboilz in forum World of Warcraft General
    Replies: 4
    Last Post: 01-19-2015, 05:59 AM
  2. Questions anyone.
    By Xx Killjoy xX in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 11-02-2007, 04:52 PM
  3. Has anyone found a way
    By adtech21 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 09-01-2007, 07:44 AM
  4. [Question] Anyone got any guide about chaning your weapon sheet?
    By Kakan1337 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 07-30-2007, 03:58 PM
  5. Model to Model: someone found a way
    By w1liam in forum World of Warcraft Model Editing
    Replies: 55
    Last Post: 01-30-2007, 09:45 AM
All times are GMT -5. The time now is 08:47 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search