Jump to content

need help with mouse controls


Recommended Posts

i made a small script:

HotKeySet("{ESC}", "Terminate")
HotKeySet("{q}", "_start")

While 1
    Sleep("50")
WEnd

Func Terminate()
    Exit 0
EndFunc

Func _start()
    While 1
    MouseMove( 38, 554)
    Sleep("20000")
    WEnd
EndFunc

this is kind of a test. im learning.

one problem. this basic and easy script doesnt move or click (when i use mouseclick) while im on a application.

am i using the wrong command?

like it works on my desktop but when i switch to a program it stops working.

Link to comment
Share on other sites

Global $Paused

HotKeySet("{ESC}", "Terminate")
HotKeySet("{q}", "_start")




While 1
    Sleep("50")
WEnd

Func Terminate()
    Exit 0
EndFunc



Func _start()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
ToolTip('Script is "Paused"',0,0)
        MouseMove( 38, 554)
    Sleep("20000")
    WEnd
    ToolTip("")
    EndFunc

Omg i haven't read your topic very well ,, sorry,

me to have same problem, and opened a topic,

it requires always top on autoit or you need to use dll that the window uses it.

Edited by rac1
Link to comment
Share on other sites

This may not be the most optimized script but:

#Include <Misc.au3>
Global $Toggle

While 1
Select
Case _IsPressed("1b")
Exit 0

Case _IsPressed("51") or $Toggle
$Toggle = True
MouseMove( 38, 554)
Sleep(20000)

Case Else
;;;

EndSelect
WEnd

EDIT: You can also use ControlSend. See docs under Function Reference -> Window Management -> Controls

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

That's the entire script. Also, for clicking in programs you can try sending it virtually to the program (see my edit remark from last post)

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

how can i add a hotkey to it?

You don't have to, the script checks for if q is pressed, if it is then the loop within the loop, so to speak, starts.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

You don't have to, the script checks for if q is pressed, if it is then the loop within the loop, so to speak, starts.

for example i want to use f12 key, how can i find the code of f12 key? like yours 1b=q

Link to comment
Share on other sites

it still doesnt work.....

while the aplication is up mousemove or mouseclick doesnt work.....

Then try ControlSend()

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Which program are you trying to send mouse movements too, if I may ask?

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

A thing you need to know is that some programs will not allow you to automate things... mostly games but there are some applications that will not allow you to do this. The work around this is extremely complicated. Too much so for someone as new as you. Keep practicing and one day youll use c, c++ etc. and youll figure it out XD

Link to comment
Share on other sites

A thing you need to know is that some programs will not allow you to automate things... mostly games but there are some applications that will not allow you to do this. The work around this is extremely complicated. Too much so for someone as new as you. Keep practicing and one day youll use c, c++ etc. and youll figure it out XD

1. True, not all programs allow automation, That's why I'm asking

2. The varying work arounds ares easily done as I've done them myself many times with AutoIt

3. It's our responsibility to teach new people the ropes and the not-so-ropes

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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