Jump to content

Recommended Posts

Posted

Hi i have this code

 

#include <misc.au3>

While 1
If _IsPressed(1) Then
Send("1")
Sleep(1)
Send("{LCTRL}")
EndIf
WEnd
While 1
Sleep(10)
WEnd

but i want it to works that way when im holding mouse its keep clicking not only spamming 1 and lctrl

i tried to insert MouseClick($MOUSE_CLICK_LEFT before 1 and lctrl but it does not work how i want to because there goes single click and im stucked without any operations untill i press mouse again

im guessing its all about one good while but im kinda confused how should it be

can someone help?

  • Moderators
Posted

In this case the help file is your friend. From the help file for _IsPressed:

Quote

Even brief key presses can result in multiple returns within a loop.

As there is almost always a better way to do things than with Sleeps and Sends and MouseClicks, how about explaining in detail what you are trying to accomplish? We can then give better suggestions.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Im using this code for game where you collect boxes and kill aliens:
- holding left mouse moves your ship in map

- clicking left mouse let u collect box or target alien so you can kill him

- "1" selects ammo type 

- lctrl starts attack on alien

for now my code works the way i can only use mouse to collect boxes and kill aliens but still i must target them to kill

i want to make it when i hold left mouse button code will spam left click so i dont have to traget aliens but i will only hold my mouse and aim on them without single clicking 

  • Moderators
Posted

Unfortunately, that is not a subject you are going to receive help with here. Please read our forum rules before you post again, specifically the section on game automation. Folks using AutoIt to automate games hurts the reputation of the language as a whole, and is not something we support here. Hope to see you again with a legitimate question.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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