rocko Posted August 16, 2012 Posted August 16, 2012 Hi, I'm new to AutoIt and i need some help. I want a script to be able to detect if an action is performed. By action i mean either a mouseclick or a key stroke. I want to do smth simple like : Function Detect { i = 0 while 1 do if (mouseclick) or (keystroke) then i = i + 1 endif wend sleep(120000) if i = 0 then ... endif else call(detect) } I want the script to simply detect if any action is performed in a 2 minute interval. If actions ar performed i dont want it to do anything, if actions are performed i will write some instructions . Thanks in advance
rocko Posted August 16, 2012 Author Posted August 16, 2012 *I want the script to simply detect if any action is performed in a 2 minute interval. If actions ar performed i dont want it to do anything, if actions *aren't* performed i will write some instructions . Or is there a way to detect if the script stops runnning and to restart the script automatically?
Danyfirex Posted August 16, 2012 Posted August 16, 2012 (edited) To detect if mouse or key is pressed use this. #include <Misc.au3> while 1 if _IsPressed(01) Then msgbox(0,"","click sinistro") endif if _IsPressed(41) Then msgbox(0,"","A has been Pressed") EndIf sleep(1) wend Edited August 16, 2012 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
PhoenixXL Posted August 16, 2012 Posted August 16, 2012 check _Winapi_SetWindowsHookEx that would be more efficient My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
Exit Posted August 16, 2012 Posted August 16, 2012 (edited) This might help you.<Code removed because I'm a dumbass and posted code that's one FileWriteLine() away from being a keylogger> Edited August 16, 2012 by Valik See big text. App: Au3toCmd UDF: _SingleScript()
Valik Posted August 16, 2012 Posted August 16, 2012 Exit, I suggest you engage your brain before you post code like that again or you'll find yourself on the wrong side of an block list. Thread locked since it went to a bad place.
Recommended Posts