Jump to content

Recommended Posts

Posted

I'm trying to make a script to click four times very fast inside a program (BF2) I have

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.0

; Author: A.N.Other <myemail@nowhere.com>

;

; Script Function:

; Template AutoIt script.

;

; ----------------------------------------------------------------------------

; Script Start - Add your code below here

Hotkeyset( "v", "Shoot")

Func Shoot()

ControlClick( "BF2 (v1.1.225.1.0, pid: 2756)", "",left,4 )

EndFunc

While 1

Sleep(100)

Wend

This wont work for some reason. Any ideas?

  • Developers
Posted

I fixed the "left" and the window title is correct when i hit F7 in SciTE i get no error message but it still will not work in the game

AU3check will only check the validity of the AutoIt script but can ofcourse never check if the title String is correct. You can check the tite with the supplied au3info program.

There is also something else wrong here:

ControlClick( "BF2 (v1.1.225.1.0, pid: 2756)", "","left",4 )

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

Titlle = "BF2 (v1.1.225.1.0, pid: 2756)"

Text= ""

ControlId="left"

Button=4

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.
  :)

Posted

alright i fixed the things you said to and double checked the window's name ( I had one character wrong ) so now i have

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.0

; Author: A.N.Other <myemail@nowhere.com>

;

; Script Function:

; Template AutoIt script.

;

; ----------------------------------------------------------------------------

; Script Start - Add your code below here

Hotkeyset( "v", "Shoot")

Func Shoot()

ControlClick("BF2 (v1.1.2551.0, pid: 1756)","","left","left","4")

EndFunc

While 1

Sleep(100)

Wend

it still wont work

  • Developers
Posted

alright i fixed the things you said to and double checked the window's name ( I had one character wrong ) so now i have

-snip-

it still wont work

The name of the ControlID still looks wrong... doubt if there is a Control called "left"..

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.
  :)

  • Moderators
Posted

Why don't you just copy and paste the entire AutoInfo information that you get when your mouse is over the control you want to click. Use Ctrl+Alt+F to pause and un-pause AutoInfo to copy the information.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

well thats the problem...(he made another thread today about the same exact thing) he wants to mouseclick left at its current positon... but mouseclick dont work... i tried i have BF2(battleField 2) and the window name is correct

Posted

HotKeySet( "v", "Shoot")
While 1
    Sleep(100)
WEnd
Func Shoot()
    Dim $Title = "BF2 (v1.1.2551.0, pid: 1756)", $Button = "left", $Amount = "4"
    ControlClick($Title, "", "", $Button, $Amount)
EndFunc  ;==>Shoot

I hope this makes it a bit more understandable.

AutoIt Smith

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
×
×
  • Create New...