Lukeprox Posted November 9, 2011 Posted November 9, 2011 Hi I need a simple script and i dont know, how to create that. I need this: If i press left mouse button for exactly 5 secs (NO MORE OR LESS), it will press X button (If left mouse button will be released earlier, nothing will happen - time must be exactly 5 sec in row - without any pause) When it press X button, it needs to be ready to do it all again. Any ideas? Thx Lucas (From Czech republic....so sry my English)
careca Posted November 9, 2011 Posted November 9, 2011 ok, think i got it... checks if you are pressing left mouse button every second, after 5 seconds of continuously pressing it, automatically presses X. Go on and test it, then say something. expandcollapse popup#include <Misc.au3> Global $dll $dll = DllOpen("user32.dll") While 1 If _IsPressed ("01", $dll) Then pressed() EndIf WEnd DllClose ($dll) Func pressed() Sleep (1000) If _IsPressed ("01", $dll) Then check() EndIf EndFunc Func check() Sleep (1000) If _IsPressed ("01", $dll) Then check2() EndIf EndFunc Func check2() Sleep (1000) If _IsPressed ("01", $dll) Then check3() EndIf EndFunc Func check3() Sleep (1000) If _IsPressed ("01", $dll) Then check4() EndIf EndFunc Func check4() Sleep (1000) If _IsPressed ("01", $dll) Then Send ("x") EndIf EndFunc Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Hmmm...interesting idea to check every specific time ...my previous idea was something like this: If LMB !down! Then add time counts (1 + 1 for every sec.) until 5 apears If count = exactly 5 then press X and reset count numbers If LMB !Up! Then reset count numbers ...something like this... But i will try yours Thx for answer
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 ok, think i got it... checks if you are pressing left mouse button every second, after 5 seconds of continuously pressing it, automatically presses X. Go on and test it, then say something. expandcollapse popup#include <Misc.au3> Global $dll $dll = DllOpen("user32.dll") While 1 If _IsPressed ("01", $dll) Then pressed() EndIf WEnd DllClose ($dll) Func pressed() Sleep (1000) If _IsPressed ("01", $dll) Then check() EndIf EndFunc Func check() Sleep (1000) If _IsPressed ("01", $dll) Then check2() EndIf EndFunc Func check2() Sleep (1000) If _IsPressed ("01", $dll) Then check3() EndIf EndFunc Func check3() Sleep (1000) If _IsPressed ("01", $dll) Then check4() EndIf EndFunc Func check4() Sleep (1000) If _IsPressed ("01", $dll) Then Send ("x") EndIf EndFunc OMG My autoIT dont know function _IsPressed ^^
careca Posted November 9, 2011 Posted November 9, 2011 (edited) Gotta have the#Include <Misc.au3>If you already put it, then maybe its down to the version u got.i got v3.3.6.1If LMB !down! Thenadd time counts (1 + 1 for every sec.) until 5 apearsIf count = exactly 5 then press X and reset count numbersIf LMB !Up! Thenreset count numbersLet us know if you do it, how you did it. Edited November 9, 2011 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Gotta have the#Include <Misc.au3>If you already put it, then maybe its down to the version u got.i got v3.3.6.1I have misc.au3 in "include" directory. I copied your script in to that directory as well...so it should work. Maybe i have bad version...ill try to reinstall.
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Gotta have the#Include <Misc.au3>If you already put it, then maybe its down to the version u got.i got v3.3.6.1Let us know if you do it, how you did it. Reinstaled &same error
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Gotta have the#Include <Misc.au3>If you already put it, then maybe its down to the version u got.i got v3.3.6.1Let us know if you do it, how you did it. Sry my fault ^^ i know where was mistake. Its work now and im gonna to try that
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Gotta have the#Include <Misc.au3>If you already put it, then maybe its down to the version u got.i got v3.3.6.1Let us know if you do it, how you did it. Anyway it not work (i mean that script)
careca Posted November 9, 2011 Posted November 9, 2011 Works here man, just did, i opened a txt file and kept pressed left mouse button inside the notepad, after 5 secs a "X" apeared. Maybe i understood wrong what you wanted, you want, left mouse button pressed for 5 secs press X key. right? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Works here man, just did, i opened a txt file and kept pressed left mouse button inside the notepad, after 5 secs a "X" apeared.Maybe i understood wrong what you wanted, you want, left mouse button pressed for 5 secs press X key. right?U understand that correctly and i did same thing with that notepad...but didnt work. Ill try once more
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Works here man, just did, i opened a txt file and kept pressed left mouse button inside the notepad, after 5 secs a "X" apeared.Maybe i understood wrong what you wanted, you want, left mouse button pressed for 5 secs press X key. right?Yup, not work. I opened notepad, run that script and after 5 sec X didnt appeard.
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Works here man, just did, i opened a txt file and kept pressed left mouse button inside the notepad, after 5 secs a "X" apeared.Maybe i understood wrong what you wanted, you want, left mouse button pressed for 5 secs press X key. right?But its weird...i replaced that pressing X with msgbox, and that works
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 Works here man, just did, i opened a txt file and kept pressed left mouse button inside the notepad, after 5 secs a "X" apeared.Maybe i understood wrong what you wanted, you want, left mouse button pressed for 5 secs press X key. right?And it works perfectly - exactly as i wanted that. Thx...i will make a few upgrades...like decreasing time, becouse its after 7 sec not 5, and make few more stuff...this was exactly key i needed. Thx again
careca Posted November 9, 2011 Posted November 9, 2011 (edited) hmm weird, but if the msgbox opens, its all good till there, just the sendkey thingy is messed up... EDIT: so the key does work? Edited November 9, 2011 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Lukeprox Posted November 9, 2011 Author Posted November 9, 2011 hmm weird, but if the msgbox opens, its all good till there, just the sendkey thingy is messed up...EDIT: so the key does work?Keys not work, wich is another big problem. It will ctreate msg box, but dont write that X in to notes (when i checking it)Another big problem is, that when i run this script my CPU speed comes to 100%
careca Posted November 9, 2011 Posted November 9, 2011 The window has to be active, for it to write there, anyway if it still doesnt work, dont know how can i help anymore. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now