简体   繁体   English

AutoIt 鼠标单击似乎不起作用

[英]AutoIt Mouse Click doesn't seem to be working

I made a batch file and I need it to click on the screen.我做了一个批处理文件,我需要它来点击屏幕。 I know you cannot do this with just a batch file and so I downloaded Autoit.我知道你不能只用一个批处理文件来做到这一点,所以我下载了 Autoit。 However, everytime I run my code, it says that MouseClick is not a valid command.但是,每次我运行我的代码时,它都会说 MouseClick 不是一个有效的命令。 I downloaded AutoIt and redownloaded it but it keeps showing the same message.我下载了 AutoIt 并重新下载了它,但它一直显示相同的消息。

@if (@CodeSection == @Batch) @then


@echo off
start "" http://www.getluckee.com/games/5
set SendKeys=CScript //nologo //E:JScript "%~F0"

Timeout 18

nircmd setcursor 700 400


set _number=0

:action
if %_number%==100 goto :end
%SendKeys% "{LEFT}"

%SendKeys% "{DOWN}"

%SendKeys% "{RIGHT}"

%SendKeys% "{UP}"
echo %_number%
set /a _number +=1
goto :action

:end
Timeout 5
nircmd setcursor 830 140
Timeout 2
MouseClick("left")
Timeout 10


%SendKeys% "exit{ENTER}"

goto :EOF


@end


// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

It seems like you have an AutoIt function in a batch script.您似乎在批处理脚本中有一个 AutoIt 函数。 If you are still set on using batch, You could create a file like below:如果您仍然使用批处理,您可以创建一个如下所示的文件:


leftClick.au3 leftClick.au3

Sleep(250)
MouseClick("left")

and then进而


myBatch.bat批处理文件

@if (@CodeSection == @Batch) @then


@echo off
start "" http://www.getluckee.com/games/5
set SendKeys=CScript //nologo //E:JScript "%~F0"

Timeout 18

nircmd setcursor 700 400


set _number=0

:action
if %_number%==100 goto :end
%SendKeys% "{LEFT}"

%SendKeys% "{DOWN}"

%SendKeys% "{RIGHT}"

%SendKeys% "{UP}"
echo %_number%
set /a _number +=1
goto :action

:end
Timeout 5
nircmd setcursor 830 140
Timeout 2
START leftClick.au3
Timeout 10


%SendKeys% "exit{ENTER}"

goto :EOF


@end


// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM