15 windows batch-file console-application
首先,我想指出这是一个相当奇怪的问题,我甚至不知道stackoverflow是否适合这个...
无论如何,有没有办法编写批处理文件或其他一些脚本,在脚本运行时鼠标指针恰好在哪里自动鼠标点击?我的主要目标是:
我再也不知道即使这是可能的,只是以为我会试试运气.提前致谢!
小智 16
为了防止一些可怜的灵魂在这一天遇到困难,使用@rojo上面提到的AutoIt - 这是我写的脚本,它完成了我需要的东西:
; Initiate Script
Main()
Func Main()
; Infinite loop
While 0 < 1
If CheckTime() == true Then
If CheckInternetConnection() == true Then
; Internet Connection is true
; So no worries
Else
; Internet Connection is false
; Perform mouse click
MouseClick("left")
EndIf
EndIf
; Sleep for 15 minutes
Sleep(60000 * 15)
WEnd
EndFunc
; The function checks if the current time is between 00:00 and 05:00
Func CheckTime()
If @Hour >= 00 AND @Hour <= 05 Then
Return true
Else
Return false
EndIf
EndFunc
; The function checks if currently is a internet connection
Func CheckInternetConnection()
Local $Connected = false
$ping = Ping("www.google.com")
If $ping > 0 Then
$Connected = true
EndIf
Return $Connected
EndFunc
Run Code Online (Sandbox Code Playgroud)
然后你去,只需将代码保存在一个扩展名为.au3的文件中,双击即可享受.
nircmd能够做一些基本的鼠标操作。检查mouse.bat - 自编译的 C# 类(默认情况下从 vista 和更高版本安装了 C# 编译器)能够从命令行命令鼠标(也非常基本,但可以比 nircmd 做更多的事情)。与mouse.bat -help你能看到的帮助和一些示例动作。
这是示例用法:
例子:
::clicks at the current position
call mouse click
::double clicks at the current position
call mouse doubleClick
::right clicks at the current position
call mouse rightClick
::returns the position of the cursor
call mouse position
::scrolls up the mouse wheel with 1500 units
call mouse scrollUp 150
::scrolls down with 100 postitions
call mouse scrollDown 100
::relatively(from the current position) moves the mouse with 100 horizontal and 100 vertial postitions
call mouse moveBy 100x100
::absolute positioning
call mouse moveTo 100x100
::relative drag (lefclick and move)
call mouse dragBy 300x200
::absolute drag
call mouse dragTo 500x500
Run Code Online (Sandbox Code Playgroud)