Sign in to follow this  
Followers 0
Paulie

Rapid mouseclicks

7 posts in this topic

I need help ok this is my current script

Hotkeyset("{g}", "Start")
Hotkeyset("{h}", "Stop")
$n=0
While $n=0
Sleep(550)
WEnd

Func Start()
$n=1
$i=1
While $i=1
Mouseclick("Left")
Mouseclick("Right")
WEnd
EndFunc

Func Stop()
$i=2
$n=0
EndFunc

What i am looking for is basically a script that makes so it waits in the backround then whenever i push "g" it rapidly and continually clicks left then right over and over and over again until i push "h" then it stops and paused again

Any help is apppreaciated

TY in advance

Share this post


Link to post
Share on other sites



HotKeySet("g","start")
HotKeySet("h","stop")
While 1
sleep(1000)
WEnd
func start()
do
mouseclick("left")
mouseclick("right")
until @hotkeypressed = "h"
endfunc
func stop()
end func

that 'ought to do ya :o


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Sorry but for some reason "until @hotkeypressed = "h"" Returns as an "unknown macro"

PLEASE HELp

BTW tY for trying

Share this post


Link to post
Share on other sites

I don't see what's wrong with your initial script. You might want to change the "{g}" and "{h}" hotkeys to just "g" and "h", but other than that it looks like it should work. If it doesn't work, what part is acting up? Is there an error, or is just not acting exactly how you think it should?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

in the initial script, when i'd push the buttons nothing would happen

and i knew that it wasn't hte game because it didn't work off the game either

and to the wheather or not to have {} around hotkeys i always thought that was how it had to work

any other script ideas?

EDIT: Ok i just tried it w/o the {} and the "g" button worked but "h" didn't

MORE HELP PLEASE

Edited by Paulie

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Make $i a global variable. Then use my suggestion to your initial script, and it will work.

Edit - the reason is because of scope. When you create $i, you do it inside a function ($n works however, because you declare it at the top, outside of any function). Since $i is declared in the function, it is automatically created as a local variable. Then, when you press h (for stop), it goes to another function, out of the scope of the start function, and redeclares $i as 2. When that function ends, it returns to the start function and takes up the old scope (meaning $i is still 1). Making $i a global variable at the top of the script means that the changes made to $i in the function will affect the other functions.

Edited by greenmachine

Share this post


Link to post
Share on other sites

in the initial script, when i'd push the buttons nothing would happen

and i knew that it wasn't hte game because it didn't work off the game either

and to the wheather or not to have {} around hotkeys i always thought that was how it had to work

any other script ideas?

EDIT: Ok i just tried it w/o the {} and the "g" button worked but "h" didn't

MORE HELP PLEASE

The brackets in hotkeys are used to signify special keys, such as {SHIFT} or {ENTER}. If you didn't have the brackets for these keys, the hotkey would be waiting for you to press "s+h+i+f+t" (all the keys at once, I think). With single keys (letters, numbers, anything that can be typed), you don't use the brackets.

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