Jump to content

mouse click


 Share

Recommended Posts

i'm sure that its been done already, but havnt found it yet.

trying to do something simple, when you click the mouse it will take the postion and break it up to 2 $vars one for the X cord and one for the Y cord. how could i go about doing this.

in the mean time i will keep looking, but havnt found anything yet

Link to comment
Share on other sites

i'm sure that its been done already, but havnt found it yet.

trying to do something simple, when you click the mouse it will take the postion and break it up to 2 $vars one for the X cord and one for the Y cord. how could i go about doing this.

in the mean time i will keep looking, but havnt found anything yet

<{POST_SNAPBACK}>

staright from help

$pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])

8)

NEWHeader1.png

Link to comment
Share on other sites

Im starting to wonder if ppl even read the help files first.

<{POST_SNAPBACK}>

ok yes i know that part, sorry for not explaining that part.

the part i am having the issue is when you click the mouse part. theres no function or anything for on mouse click. I know how to pull the position, but need to do it when the mouse is click. is there a command or function that will do that part when you click the mouse?

Link to comment
Share on other sites

  • Moderators

Look up _IsPressed in search and use MouseGetPos().

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

#include <IsPressed.au3>
While 1
  Sleep(100)  
If _IsPressed('01') = 1 Then
    $pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
EndIf
WEnd

Exit

I got this working for you but I have not figured out how to turn it off at the end


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Or someone could just write it for you :whistle:

BigDod, are you talking about after it clicks?

#include <IsPressed.au3>
While 1
  Sleep(100)  
If _IsPressed('01') = 1 Then
    $pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
Sleep(500)
ExitLoop
EndIf
WEnd

Edit: Oops it would of exited if it wasn't clicked before... LOL.

Edited by ronsrules

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks guys for that, ispressed is what i needed. I kinda remembered something about that a while ago but didnt remember the command..droped autoit for a little and forgot about all the good UDF's

PS thanks for the tid bits of code will save me about 2 mins of coding hehe =P

Link to comment
Share on other sites

http://www.torrez.org/projects/xumouse.shtml

With the above app I can set a Delay before the mouse clicks agian but I need something like a delay 45 sec to 55 sec and its just clicks at a random time inbetween 45 and 55 sec?

I posted on another board and was sent to AutoIt but I have never scripted before :"> so am real lost.

Can this be done using AutoIt? Wheres a good place to start?

Thanks

Link to comment
Share on other sites

All I want it to do is click the Left mouse button, But I dont want it at set rate like 45 sec so every 45 it clicks= bad for me :whistle:

What i would like is say variables are 45 sec and 55 sec so every 45-55 sec it just clicks the left mouse button but i need the values of the time between the two set variables to change.

exp

45 sec first click

49 sec sec click

47 sec third click

54 sec forth click

so basicly just random picking of when the mouse is clicked without a static value. I have read the help and think i could do most of it myself but dont see where/how to get it to pick a random number between the time variables.

I hope I explained it well, but have a habit of making things sound more complacted then they really are.

Thanks for the help

Link to comment
Share on other sites

Cpl quick questions

1) Is this the right form to keep asking lots of questions form a total new to script writing person such as myself?

2) Expression in this script here can i put anything?? like to end the looping I would like to hit a key on my keyboard- How would i put the key in so the program sees that i pushed it so it will stop the script?

3) Am I on the right track for what I want this to do?

4) Should I make a GUI like XUMOUSE above so i can just enter my variables and have a start/stop button for ease of use? Where now I would have to edit the script everytime to change my variables($delay = Random( [55 [,60 [,0 ]]] ))

5) Being that this is my first ever script would 4 be WAY to hard to where I am pulling my hair out trying to figure it out?

; Script Start -

MouseClick ( "Left" [, 29, 85 [, 1 [, 10 ]]] )

$delay = Random( [55 [,60 [,0 ]]] )

While <expression>

statements

...

WEnd

Thanks for everyones time that is helping me, If there is a better place to be posting these types of questions please let me know where.

Link to comment
Share on other sites

It would have been better to start a new post for this round of questions. This string of posts (thread) belongs to Zithen. It makes a difference to the way some users read the forum and how some are notified of when another member posts to "their" thread.

1) Other than that, yes - this is the correct forum (place) to ask.

2) See help file under HotKeySet - steal the code at the bottom of that page.

3) Yes

4) Stay away from GUI on first script - use InputBox function

5) Not too hard at all... stick with it.

The brackets "[" in your lines of code are not correct... they specify [optional] parameters.

You might want to start a new post for your next round of questions......

[size="1"][font="Arial"].[u].[/u][/font][/size]

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...