Sign in to follow this  
Followers 0
heltfeil

Newbie trying to make a basic autoclicker

5 posts in this topic

Hey all!

Im utterly new to this, and after following the tutorials that came with AutoIt, Ive learned a little, but there is of course alot more I dont know how to do. I searched around the forums and found a couple of threads, wich brought me a little further. Then searched a little more on how to make different "sleep" in same function, but I dont know how to implent it like I want to.

Script so far is:

HotKeySet("{ESC}", "quit")
HotKeySet("{Insert}", "Click")

While 1
WinActivate("Anarchy Online")
WinWaitActive("Anarchy Online")
WEnd

Func Click()
While 1
send("1")
Sleep("7000"
Send("1")
Sleep("250")
Send("1")
Sleep("250")
Send("1")
Sleep("250")
Send("1")
Sleep("250")
Send("1")
sleep("250")
Wend
EndFunc

Func quit()
    Exit
EndFunc

The idea is very simple, clicking a certain key ever 7.5 seconds. The problem is that I play a bug and lag ridden game, that would need some margin to actually execute the command in due time. Thats why Ive added the "spam" before and after the time it in theory should hit the key. But to avoid a constant spam, with the following error spam (ingame), there is one bigger delay. How can this be done, without getting the offset delay the current code will give? I would also like to learn have to temp stop the script with a button, without the exit solution I have atm...

I know I probably dont make much sense, and that I should be able to do this very basic stuff no matter how new Im to it, but at least Im a good cook...

All help will be appreciated!

Share this post


Link to post
Share on other sites



I don't have a clue to what you're trying, except a pause function, this one can be put on a hotkey only:

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")

While 1
    Sleep(100)
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Share this post


Link to post
Share on other sites

Thanks for your reply, the pause funtion was just what I was looking for.

But I see I failed to explain what Im trying to achieve with those delays.

I want the script to hit a certain button every 7.5 seconds. To be sure it hit the button at the right time, I also want it to repeatedly hit it in +/- 1 second of that recharge time. I hope that was a little clearer.

Share this post


Link to post
Share on other sites

Why don't you just make it every 8 seconds? That would give it an extra .5 seconds for lag, which should be enough...

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