Jump to content

Can you make a while/do-until loop faster?


 Share

Recommended Posts

So I wanted to have just a simple autoclicker using autoit instead of getting some random one online with hundreds of options, and right now it averages around 45.2 CPS. Which is good, but I was wondering if it could be faster.

 

This is the code; it's in a while loop so I don't know if its possible to modify the speed.

Global $toggle = False

HotKeySet("{1}", "click")
HotKeySet("{2}", "close")

While not $toggle
   Do
   Until $toggle = True
WEnd

Func click()
   $toggle = Not $toggle
   While $toggle
   MouseClick("left")
   WEnd
EndFunc

Func close()
   Exit
EndFunc

Thanks

Link to comment
Share on other sites

I'm sure it can be enhanced.
But I'm not sure why you would want to MouseClick so fast without doing anything else between clicks 🤔 

Can you please elaborate on what you try to achieve?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

9 hours ago, water said:

I'm sure it can be enhanced.
But I'm not sure why you would want to MouseClick so fast without doing anything else between clicks 🤔 

Can you please elaborate on what you try to achieve?

I said in the post I was just wanting to have a simple autoclicker and wanted to possibly make it faster. This is the entire script, just wanted to know if there were some possible edits or additions of modifiers to make the loop go faster. 

Link to comment
Share on other sites

  • Developers
14 minutes ago, Cookid said:

simple autoclicker

What on earth does require this other than some sort of game bs?

 

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

If you're using this to automate a program other than a game, you'll probably want to know how many times you're clicking... I had to before when I was using a program over a Citrix connection. In this case, just pass the number of clicks you want to MouseClick as the 5th parameter. When I was doing this, I had to scroll exactly down a list that I knew already (somewhere between 5 to 500 lines). If you're doing this for a game, this won't help anyways :)

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

52 minutes ago, seadoggie01 said:

If you're using this to automate a program other than a game, you'll probably want to know how many times you're clicking... I had to before when I was using a program over a Citrix connection. In this case, just pass the number of clicks you want to MouseClick as the 5th parameter. When I was doing this, I had to scroll exactly down a list that I knew already (somewhere between 5 to 500 lines). If you're doing this for a game, this won't help anyways :)

Yea no it's supposed to be infinite. It's not meant for any particular program or game or whatever, just an autoclicker to have around. I suppose through indirect answers that you can't make it faster so this thread is done I guess.

Link to comment
Share on other sites

  • Developers

Yea right... you need an autoclicker lying around in case you need one.

I will do a single click now and lets not continue this conversation.

*click*

Jos

 

Edited by 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

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...