Mk51 Posted July 30, 2023 Share Posted July 30, 2023 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 More sharing options...
Solution Andreik Posted July 30, 2023 Solution Share Posted July 30, 2023 (edited) 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 July 30, 2023 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Mk51 Posted July 30, 2023 Author Share Posted July 30, 2023 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 More sharing options...
Andreik Posted July 30, 2023 Share Posted July 30, 2023 It's not very wise to talk about game automation since the rules of the forum forbid any kind of game automation. Probably it's good to get familiar with forum rules and guidelines. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Mk51 Posted July 30, 2023 Author Share Posted July 30, 2023 You are probably right. Did not know. I'm sorry Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2023 Developers Share Posted July 31, 2023 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 More sharing options...
Recommended Posts