Jump to content

Recommended Posts

Posted

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

Posted

*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?

Posted (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 by Danyfirex
Posted

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.

Posted (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 by Valik
See big text.

App: Au3toCmd              UDF: _SingleScript()                             

Posted

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.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...