Jump to content

_ispressed help please


Recommended Posts

Hello,

here's what i'm trying to do:

as long as left/primary mouse button is pressed keep clicking the left/primary mousebutton.

here's what i got so far:

#include <misc.au3>
$dll = DllOpen("user32.dll")
HotKeySet ("{esc}","stop")

While 1
    if _IsPressed ("01") Then
        MouseClick("primary")
    EndIf
WEnd




func stop ()

    Exit
    EndFunc

i tried changing the amound of click mouseclick does but that doesn't really solve anything

what happens is that it clicks once/twice and then it stops.

 

 

 

the other thing i tried was:

#include <misc.au3>
$dll = DllOpen("user32.dll")
HotKeySet ("{esc}","stop")

While 1
    if _IsPressed ("01") Then
        MouseDown("primary")
    EndIf
WEnd




func stop ()

    Exit
    EndFunc 

while it sometimes does register like 500 clicks being sent a second (o.o)   it does not allways work.

any help would be appreciated,

thanks.

dg.

Edited by dragonheard
Link to comment
Share on other sites

  • Moderators

dragonheard,

Welcome to the AutoIt forum. :)

But please pay attention to where you post - the "Developer Chat" section where you started this thread is not for general support questions. I have moved the thread for you, but would ask you to be more careful in future. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Hi, dragonheard. Just out of curiosity, what is the window you're trying to interact with? You're coming to see some of the inconsistencies you get with mouseclicks. Often there is an easier way to manipulate the program than spamming the mouse button.

"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

do put sleep(10) after MouseDown("primary") and retest your script, some guis do have problem registering large amount of data sent to them at once so probably other program just brake the input.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • 4 weeks later...

do put sleep(10) after MouseDown("primary") and retest your script, some guis do have problem registering large amount of data sent to them at once so probably other program just brake the input.

i'll try that thanks :D,

& is there any way to let autoit know that a click made by autoit is a different click than an actual mouse click?

cause when i want it to click as long as left mousebutton is pressed it keeps looping cause it clicks the left mousebutton (presses it)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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