Jump to content

Running a single command via cmd - (Locked)


Go to solution Solved by Andreik,

Recommended Posts

Hello. Tell me please, how to correctly compose a cmd bat file / command in order to make a single command using autoit. For example, a mouse click.
 

cd /D D:\Documents\AutoIt3
AutoIt3.exe /AutoIt3ExecuteLine "MouseClick("left", 1)"

I got error:

Unknown functon name.

Link to comment
Share on other sites

  • Solution

The problem is that you didn't escaped the double quotes. You can use double quotes twice

AutoIt3.exe /AutoIt3ExecuteLine "MouseClick(""left"", 100, 100)"

or use single quotes for strings

AutoIt3.exe /AutoIt3ExecuteLine "MouseClick('left', 100, 100)"

The code above should left click at coordinate 100, 100. I am not sure, but probably you misunderstood also the parameters of MouseClick(). Second parameter it's X coordinate not the number of clicks. It doesn't make sense for me to use 1 as X coordinate and nothing as Y coordinate.

 

Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

2 hours ago, Andreik said:

The code above should left click at coordinate 100, 100. I am not sure, but probably you misunderstood also the parameters of MouseClick(). Second parameter it's X coordinate not the number of clicks. It doesn't make sense for me to use 1 as X coordinate and nothing as Y coordinate.

 

Thanks for the answer.

I originally used cmd as "code body". In the cmd file, the pixel color is checked using getPixelColor function and nircmd moves the cursor to the found pixel. However, the game does not want to accept any keyboard input or mouse clicks via nircmd. That's why I downloaded AutoIT. The cmd variable already contains mouse positions.

Its look like

nircmd wait 300
nircmd setcursor %Color_Check_Pos_Main%
::CLICK HERE

where %Color_Check_Pos_Main% = string = "x" and "y" coord = "100 100" without ","

I need only click via AutoIT as simply as I can. So I use such command without any X and Y pos. "MouseClick("left", 1)"

Yes, I can extract the X and Y coordinate from the string %Color_Check_Pos_Main%, but I thought I misunderstood the command to call autoit from cmd

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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