Jump to content
Sign in to follow this  
imRawr

Help

Recommended Posts

imRawr

Ok this is probably a nooby question but how would you make a script to spam LeftClick that toggles on and off with space. (im extremely new to autoit lol)

Share this post


Link to post
Share on other sites
Sobiech

I dont understand what do you want exactly if you use "spam LeftClick" ^^

But you can use infinite loop (While) for Mouse Click

While 1
MouseClick("Left", X, Y)
Sleep(100)
MouseClick("Left", X, Y)
WEnd

This script will clicking in two places each 100 miliseconds.

X & Y you can get from AutoIT Window Info (tool).

Welcome to AutoIT forum :D Have Fun & Good Luck


This world is crazy

Share this post


Link to post
Share on other sites
Minikori

I have a script like that of which I could modify you for two reasons:

1) You should learn your AutoIT stuff, look in the help file.

2) You used the word "spam," meaning you may be using this for malicious purposes.

Good day :D


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites
omikron48

Check the help file.

Look at HotKeySet, MouseClick, While...WEnd loop, If...Then...Else conditional, Func...FuncEnd declaration. Also, maybe Sleep.

Your algorithm would go like:

1 Set the hot key.

2 Declare and set the toggle variable.

3 Run the While loop.

4 Check if the toggle variable is set to active.

5 Do a mouse click if it is set to active.

6 Sleep for some milliseconds.

7 Continue with the loop.

You also need to declare a function that switches the toggle variable value, which you will set to your hot key.

@Minikori: "Spam", in this case, means to repeatedly do. What difference would it matter if the wording was "make it left click repeatedly"?

It isn't necessarily malicious. In this case, since it will only do mouse clicks, even when it is used maliciously, it will only be annoying at most. Even then, there are some uses for stuff like that, like the Whack-A-Zombie mini game in Plants vs. Zombies.

Edited by omikron48

Share this post


Link to post
Share on other sites
imRawr

Actually I used the word spam cause I couldn't think of a better word

Share this post


Link to post
Share on other sites
imRawr

@omikron48 Thanks figured it out and got it running perfectly.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.