• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Is it possible to emulate a mousecilck?

    Discussion in 'Honorbuddy Support' started by jonny1, Dec 6, 2011.

    1. jonny1

      jonny1 Member

      Joined:
      Jan 15, 2010
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      6
      I have a short and importand question. Is it possible to emulate mouseclicks to a specific position in wow or generally to make a mouseclick on the desktop?
       
    2. no1knowsy

      no1knowsy Well-Known Member

      Joined:
      Feb 28, 2010
      Messages:
      3,927
      Likes Received:
      57
      Trophy Points:
      48
      WoWObject.Interact() simulates a rightclick on the object.
      The click to moves are different.
      But on the desktop no. HB only interfaces with Wow.exe
       
    3. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      yes, possible for both.
       
    4. jonny1

      jonny1 Member

      Joined:
      Jan 15, 2010
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      6
      Thx for your answers.



      The problem is: It has to click to coordinates not to an object - The object has no name, so i can use it not directly.

      I would be very happy to see an liddl example.
       
      Last edited: Dec 6, 2011
    5. no1knowsy

      no1knowsy Well-Known Member

      Joined:
      Feb 28, 2010
      Messages:
      3,927
      Likes Received:
      57
      Trophy Points:
      48
      WoWMovement.ClickToMove(WoWPoint) or something of the sorts.
      With visual studio you cam find it fairly easy.
       
    6. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      WoWMovement.ClickToMove(12.0f,-423.0f, 90.012f); where 12.0f,-423.0f, 90.012f is the coord. You can get the coord by walking up to the location and then opening the 'Developer Tools' window in HB looking at the Position under 'Local Player Info'. hit the refresh button.
       
    7. jonny1

      jonny1 Member

      Joined:
      Jan 15, 2010
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      6
      Sorry. I think i wrote it a liddl hard to understand. I dont need a click to wow position coordinates. I need A click in an interface from wow what has no name. Is this although possible with ctm?!
       
    8. no1knowsy

      no1knowsy Well-Known Member

      Joined:
      Feb 28, 2010
      Messages:
      3,927
      Likes Received:
      57
      Trophy Points:
      48
      You want to click what button?

      Is that button part of a wow add-on?

      Pretty much all built in wow buttons are able to be "pressed", or do something like it was pressed.
       
    9. jonny1

      jonny1 Member

      Joined:
      Jan 15, 2010
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      6
      Yes, its a part of an WoW addon and its not possible to use the button directly without an mouseclickemulation - It has to click X/Y. And there is no other way except rewrite the complete addon.
       
    10. no1knowsy

      no1knowsy Well-Known Member

      Joined:
      Feb 28, 2010
      Messages:
      3,927
      Likes Received:
      57
      Trophy Points:
      48
      I suppose you could, but I don't have the answer for you on this one.

      Also, how can you be certain that the button won't be moving anywhere? Screen sizes, resizing windows, etc...

      Just some things to look at.
      I'll stop filling up the thread now.
      highvolts is amazing. He'll be able to figure something out.
      He did make a Radar plugin for showing enemies/objects :)
       
    11. jonny1

      jonny1 Member

      Joined:
      Jan 15, 2010
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      6
      Thank you very much. You give me some hope :) It would be really nice to get an working answer.
      The position etc. should not be a problem. Just to make the click. Perfect would be wow window coordinates.
       
    12. Smarter

      Smarter Member

      Joined:
      Jan 15, 2010
      Messages:
      763
      Likes Received:
      9
      Trophy Points:
      18
      Honorbuddy slightly wrapped SendMessage: Styx.Helpers.KeyboardManager.SendMessage(uint msg, uint wParam, uint lParam).
      Code:
      
      uint Msg,       // message
                        uint wParam,  // first message parameter [Always 0]
                        uint lParam   // second message parameter [Coordinates]
      
              public int MakeLParam(int LoWord, int HiWord)
              {
                  return ((HiWord << 16) | (LoWord & 0xffff));
              }
      
        public enum WMessages : uint
          {
              WM_LBUTTONDOWN = 0x201, //Left mousebutton down
              WM_LBUTTONUP = 0x202,  //Left mousebutton up
              WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick
              WM_RBUTTONDOWN = 0x204, //Right mousebutton down
              WM_RBUTTONUP = 0x205,   //Right mousebutton up
              WM_RBUTTONDBLCLK = 0x206, //Right mousebutton doubleclick
              WM_KEYDOWN = 0x100,  //Key down
              WM_KEYUP = 0x101,   //Key up
          }
       
      Last edited: Dec 6, 2011
    13. seVen

      seVen New Member

      Joined:
      Jan 31, 2010
      Messages:
      589
      Likes Received:
      20
      Trophy Points:
      0
      tell me what addon and i could help you

      edit: or do as smart says - because he is smarter than me
       
    14. Smarter

      Smarter Member

      Joined:
      Jan 15, 2010
      Messages:
      763
      Likes Received:
      9
      Trophy Points:
      18
      I know what he's talking about, I went round and round with Auctioneer and other addons. They declare their buttons locally so it's not possible to "Button:Click()" them as they don't have a public name. It's stupid.
       
    15. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      I read somewhere there wow removes bogus mouse click messages from the message pump and I couldn't get it to work for me so I'm guessing that's probably true.

      An alternative is to find the name of the button you want to press using this macro and call its Click() method.
      Put macro on key bar and mouseover the button you want to grab the name of and press the macro key
      Code:
      /run local f=GetMouseFocus();print(f:GetName() or tostring(f))
      Then make another macro like this.
      Code:
      /run ButtonNameHere:Click()
      and keybind this macro.
      Now you can stimulate a key press like this.
      Code:
      KeyboardManager.KeyUpDown((char)Keys.F10);
      This example presses the F10 key.
       
      Last edited: Dec 6, 2011
      Giwin likes this.
    16. Smarter

      Smarter Member

      Joined:
      Jan 15, 2010
      Messages:
      763
      Likes Received:
      9
      Trophy Points:
      18
      That won't work for what he's asking, as I said. Auctioneer and other addons declare the buttons locally, and they can't be clicked by that method.
       
    17. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      Last edited: Dec 6, 2011
    18. Smarter

      Smarter Member

      Joined:
      Jan 15, 2010
      Messages:
      763
      Likes Received:
      9
      Trophy Points:
      18
    19. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      I tried it briefly on Auctioneer and it worked fine for me. Here is the macro I used to click Batch Post button and the followup confirmation popup.
      Code:
      /run local f=EnumerateFrames(AuctionFrame) while f do if f:GetObjectType() == 'Button' and f:GetText() == 'Batch post' then f:Click('RightButton') end f = EnumerateFrames(f) end if AuctioneerPostPromptYes then  AuctioneerPostPromptYes:Click() end
      I keybound the macro button to F10 and than tested it by running this in HBConsole.
      Code:
      KeyboardManager.KeyUpDown((char)Keys.F10);
      this doesn't run the scan (by holding down Alt key when clicking the 'Batch post' button but shouldn't be hard to add that.
       
    20. Smarter

      Smarter Member

      Joined:
      Jan 15, 2010
      Messages:
      763
      Likes Received:
      9
      Trophy Points:
      18
      Hmmmm. I believe you have just intrigued me ... I tried it with just the name from GetName(), and it never worked properly. How is it you manage to do this in ProfessionBuddy without Hardware Interaction, ResetAfk()? I peeked around SellToAh code, and didn't see anything?
       

    Share This Page