BrAiNee Posted November 12, 2020 Share Posted November 12, 2020 Hi, i have a problem, i use the function _IsPressed("01") but this will also detect the button is pressed when the script is pressing it. so is there a way to detect only the real mouse button and not the "software buttons" ? While _IsPressed("01") MouseUp("left") ;do stuff while pressing the real mouse button WEnd the MouseUp event will also disable the while, but the real mouse button is pressed... how to fix ? dllcall something ???? Link to comment Share on other sites More sharing options...
Nine Posted November 12, 2020 Share Posted November 12, 2020 Not sure I fully understand your issue. Can you show a real example of what is not working ? And what is the application you are trying to automate. Mouse Clicks is not the best way to automation, unless it is for a video game, is it ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
markyrocks Posted November 12, 2020 Share Posted November 12, 2020 theres really not a whole heck of alot of difference between a virtual keypress and a real one. As far as i know the only difference is a real key press gets a "flag" from a signed driver that theres only 1 way that i know of to fake that, its a pita and probably would get this topic shut down. I'm sure theres easier ways to go about whatever it is you're attempting to do . Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
GokAy Posted November 12, 2020 Share Posted November 12, 2020 (edited) Well, I don't know if it would work in your case but in general if you want to avoid a specific event from happening, you set a boolean type variable and switch it before and after actions that may trigger it.Then check against the boolean variable inside the function that gets called, and add an if statement, etc. This may work for you perhaps. Can't really say, as I am not sure the order of events. Instead of checking for boolean in the while condition perhaps add an if statement for it inside. Global $g_bBypass = False While _IsPressed("01") and $g_bBypass = False $g_bBypass = True MouseUp("left") $g_bBypass = False ;do stuff while pressing the real mouse button WEnd Edited November 12, 2020 by GokAy BrAiNee 1 Link to comment Share on other sites More sharing options...
markyrocks Posted November 12, 2020 Share Posted November 12, 2020 (edited) Im just sitting here in awe trying to wrap my mind around why in God's name you'd need to use IsPressed from inside of a script to determine if the mouse button was being pressed or not. Theres got to be another trigger that lets the mouse know when to press or not to press..... use whatever that is instead. Unless this is some type of attempt at a keylogger. Edited November 12, 2020 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
BrAiNee Posted November 12, 2020 Author Share Posted November 12, 2020 (edited) 34 minutes ago, Nine said: Not sure I fully understand your issue. Can you show a real example of what is not working ? And what is the application you are trying to automate. Mouse Clicks is not the best way to automation, unless it is for a video game, is it ? yes its for a game, the problem is the game blocks different inputs, i fixxed this by using a second shoot key, but this will also stop the trigger, i try to catch the "real" mouse button then i will deactivate it and let the script do the shooting, so like a mouse proxy i dont know how to describe.... here my function. <snip> Edited November 12, 2020 by JLogan3o13 Musashi 1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 12, 2020 Moderators Share Posted November 12, 2020 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team BrAiNee 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts