Jump to content

Help with a simple script


Recommended Posts

I'm trying to create a simple script that basically makes it so that when you right click it pushes the number 3. I want to use caps lock for toggling it but I'm not sure how to do the rest.

Also, I'm trying to make another script where, by holding down left click, it rapidly clicks left click. The best I've been able to do though is left click to toggle it on and off. Any help?

Link to comment
Share on other sites

While
If _IsPressed ('02') Then Send ('3')
Wend

not tested but the theory is what you need not to copy the code

Link to comment
Share on other sites

What about creating a hotkey for those buttons you would like to control? A hotkey for left mouse button would be so when you hold it it would loop Mouseclick left. Hotkey for capslock would be so when you toggle it the script is paused. And for rightclick simply Send 3. Hope it helps.

Edited by darkmaster071
Link to comment
Share on other sites

While
If _IsPressed ('02') Then Send ('3')
Wend

not tested but the theory is what you need not to copy the code

So right now I have...

HotKeySet("CAPSLOCK", "RC3")
HotKeySet("+{ESC}", "EndRC3")

;FUNCTIONS
Func RC3()
    While
        If _IsPressed ('02') Then Send ('3')
    Wend
EndFunc  ;==>RC3

Func EndRC3()
    Exit
EndFunc  ;==>EndRC3

but that's not working, any ideas?

Link to comment
Share on other sites

  • Developers

So right now I have...

HotKeySet("CAPSLOCK", "RC3")
HotKeySet("+{ESC}", "EndRC3")

;FUNCTIONS
Func RC3()
    While
        If _IsPressed ('02') Then Send ('3')
    Wend
EndFunc ;==>RC3

Func EndRC3()
    Exit
EndFunc ;==>EndRC3

but that's not working, any ideas?

Assume it ends pretty quickly as there is no code to run other than the 2 first lines.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

HotKeySet("CAPSLOCK", "RC3")
HotKeySet("+{ESC}", "EndRC3")
while 1
sleep (10)
wend
;FUNCTIONS
Func RC3()
    While
        If _IsPressed ('02') Then Send ('3')
    Wend
EndFunc ;==>RC3

Func EndRC3()
    Exit
EndFunc ;==>EndRC3

Edited by TheOnlyOne
Link to comment
Share on other sites

#include <Misc.au3>

Global $var
HotKeySet("{CAPSLOCK}", "RC3")
HotKeySet("{ESC}", "EndRC3")

While 1
WEnd

;FUNCTIONS
Func RC3()

    $var = NOT $var
    While $var
        If _IsPressed ('02') Then Send ('3')
    WEnd

EndFunc;==>RC3

Func EndRC3()
    Exit 0
EndFunc;==>EndRC3

Works kinda akward.

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