AutoIt Mouse Click似乎无法正常工作

时间:2016-03-31 06:21:58

标签: windows batch-file click mouse autoit

我制作了一个批处理文件,我需要它来点击屏幕。我知道你不能只用一个批处理文件来做这个,所以我下载了Autoit。但是,每次运行我的代码时,都会说MouseClick不是有效的命令。我下载了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));

1 个答案:

答案 0 :(得分:0)

您似乎在批处理脚本中有一个AutoIt函数。如果您仍然使用批处理,则可以创建如下文件:

leftClick.au3

Sleep(250)
MouseClick("left")

然后

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));