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?
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
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.
WoWMovement.ClickToMove(WoWPoint) or something of the sorts. With visual studio you cam find it fairly easy.
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.
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?!
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.
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.
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
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.
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 }
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.
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.
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.
you can get all created frames(buttons included), even unnamed ones via EnumerateFrames().EnumerateFrames - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons . Could identify the button by unique properties such as parent, size,location, etc
I should've been more specific, sorry. The way Auctioneer is written, calling Click does nothing. Maybe you know something I don't but i've tried everything.
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.
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?