Sign in to follow this  
Followers 0
foodforhire

Help with a simple script

8 posts in this topic

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0