- 浏览: 14265 次
最新评论
autoit3简要笔记
2011年02月11日
1.autoit3 脚本参数
$CmdLine[0] is number of parameters
$CmdLine[1] is param 1 (after the script name)
$CmdLine[2] is param 2 etc
...
$CmdLine[$CmdLine[0]] is one way to get the last parameter...
So if your script is run like this: AutoIt3.exe myscript.au3 param1 "this is another param" $CmdLine[0] equals... 2 $CmdLine[1] equals... param1 $CmdLine[2] equals... this is another param @ScriptName equals... myscript.au3 2.vista 的User Account Control (UAC). Vista 下,提示用户脚本运行的用户是否有administrators 的权限。 ; This script requires full Administrative rights
#requireadmin
MsgBox(0, "Info", "This script has admin rights! ") 3 windows handles A window handle is a special value that windows assigns to a window each time it is created.The advantage of using window handles is that if you have multiple copies of an application open - which have the same title/text - you can uniquely identify them when using handles. 4 autoit 快捷键
!代表alt 键
5 宏
Autoit 中的宏是用@ 开头的,变量是以$ 开头的。
6 循环
除了for in next 与vbscript 中的for each next 不同外。其余几个语法一直。
7 com 的调用
使用oleviewer 查看当前机器上的com 组件。Most important is the "VersionIndependentProgID". This is the name to be used in an ObjCreate, ObjGet or ObjEvent function 。AutoIt uses the IDispatch interface for automation 。Right-click on the name IDispatch and choose "View..." from the context menu. Then click the "View TypeInfo..." button
8.autoit3 GUI GUI上的control id The control ID is a positive number (that is, a number greater than 0) Each control ID is unique - even when there are multiple windows The control ID is actually the same value as the Control ID that the AutoIt Window Info Tool shows GUI 具有两种模式,1.消息驱动模式 2.事件驱动模式 1. 消息驱动模式
GUI 将不停的循环,使用GUIGetMsg()来获取GUI上的事件,例如点击Button,关闭GUI。 While 1
$msg = GUIGetMsg()
...
...
WEnd Remark:注意,不要在GUI中尝试添加Sleep函数,这会导致GUI无法响应用户,不用担心LOOP会过分消耗CPU,GUIGetMsg已经帮你考虑到这点了。 GUIGetMsg() 将返回三种结果: . No Event 返回为0
. Control Event 返回CONTROL ID
System Event 返回负值 $GUI_EVENT_CLOSE
$GUI_EVENT_MINIMIZE
$GUI_EVENT_RESTORE
$GUI_EVENT_MAXIMIZE
$GUI_EVENT_PRIMARYDOWN
$GUI_EVENT_PRIMARYUP
$GUI_EVENT_SECONDARYDOWN
$GUI_EVENT_SECONDARYUP
$GUI_EVENT_MOUSEMOVE
$GUI_EVENT_RESIZED
$GUI_EVENT_DROPPED Control id 是独一无二的,但System Event 在多窗口的情况下就需要再指明是哪个窗口的事件了。因此使用带参数的GUIGetMsg 方法。
$msg = GUIGetMsg(1) When called with the 1 parameter instead of returning an event value an array will be returned, the array contains the event ( in $array[0] ) and extra information such as the window handle ( in $array[1] ) The first major change is the GUISwitch function call - when a new window is created it becomes the "default" window for future GUI operations (including control creation). 使用GUISwitch($mainwindow)来切换活动窗口。
2. 事件驱动模式 The default mode is the MessageLoop mode so before using the OnEvent mode we must use Opt("GUIOnEventMode", 1) . 9 .autoit3 函数 9.1环境管理
clipGet 获取剪切板中内容
Clipput 设置剪切板中内容
EnvGet 获取环境变量 $var=EnvGet("PATH")
EnvSet 设置环境变量EnvSet("MYENV","this is a test")
MemGetStats ( ) 获取内存状态。返回七个元素的数组。
9.2 文件,目录,磁盘管理
Autoit3有类似vbs的文件目录磁盘函数,另外,autoit3能够对.ini文件直接读写。便于操作这种键值对应的文件。
10 autoit3 网络编程
10.1 网络下载文件 ; Advanced example - downloading in the background
Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files /beta/update.dat", @TempDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $nBytes) 10.2 socket 编程 Step1: TCPStartup ( ) Step2: TCPListen ( IPAddr, port [, MaxPendingConnection] ) Step3:服务器端TCPAccept ( mainsocket ),客户端TCPConnect ( IPAddr, port )
Step4:客户端TCPSend ( mainsocket, data ),
服务端TCPRecv ( mainsocket, maxlen [, flag] )
Step5: TCPCloseSocket ( socket )关闭TCPListen和TCPAccept建立的socket连接。
Step6: TCPShutdown ( ) ; To stop TCP services
发表评论
-
BAT命令大全
2012-01-20 10:07 627BAT命令大全 2010年11月11日 BAT命令大全 ... -
IIS修复工具,怎么完全卸载IIS
2012-01-20 10:07 810IIS修复工具,怎么完全卸 ... -
自动化测试-略懂
2012-01-20 10:07 471自动化测试-略懂 2010年09月14日 其实我目前是处 ... -
还原点
2012-01-20 10:07 426还原点 2010年10月23日 什么是还原点: 表 ... -
各种文件后缀名与打开方式大全a-d
2012-01-19 15:08 728各种文件后缀名与打开方式大全a-d 2012年01月11日 ... -
右键菜单显示隐错文件和扩展名时报错
2012-01-19 15:08 779右键菜单显示隐错文件和扩展名时报错 2012年01月11日 ... -
右键添加显示隐藏文件(转贴)
2012-01-19 15:08 525右键添加显示隐藏文件(转贴) 2012年01月15日 右 ... -
教你用记事本做整人的另类签名
2012-01-19 15:08 624教你用记事本做整人的另类签名 2011年12月24日 今 ... -
S7-300 PLC的串口无线通讯在火电厂污水处理中的应用
2012-01-19 15:08 578S7-300 PLC的串口无线通讯 ... -
C# 外挂入门 配套 实例+视频 教程
2012-01-17 04:55 3002C# 外挂入门 配套 实例+ ... -
关于PHP的缓存
2012-01-17 04:55 615关于PHP的缓存 2011年05 ... -
外挂制作 方法
2012-01-17 04:55 600外挂制作 方法 2011年01 ... -
杨建:网站加速--服务器编写篇(上)
2012-01-17 04:55 496杨建:网站加速--服务器 ... -
AS3 Design Pattern: Simple Factory 模式
2012-01-16 03:46 569AS3 Design Pattern: Simple Fact ... -
flex3控件_ModuleLoader
2012-01-16 03:46 556flex3控件_ModuleLoader 2011年07月0 ... -
as3 内置组件 1
2012-01-16 03:46 569as3 内置组件 1 2009年10月14日 1,改变所 ... -
天地会flash资源导航
2012-01-16 03:45 951天地会flash资源导航 2011年02月25日 一 f ... -
回顾日志_20110609
2012-01-16 03:45 526回顾日志_20110609 2011年06月09日 先来 ...
相关推荐
AutoIT V3,scite4AutoIT3,只有这个版本的AutoIT才可以添加版本信息、版权信息、还有程序图标等,只AutoIT3,即可加了以下代码,也是没有办法编译带有exe版本,版权,公司等信息的,这个版本还有一些额外的工具,获取...
autoit 学习skyfree的笔记,适合于初学者,有用的话就拿走吧
Autoit3 Decompiler是一款功能强大的AutoIt3反编译工具,可以反编译由AutoIt编译的exe程序,直接反编译出源代码!还带有右键关联功能,非常方便。 在Autoit3 Decompiler中,按“反编译选中”或“反编译当前”按钮,...
autoit3 帮助文档 中文 autoit3入门与提高
autoit3入门指南,autoit3入门指南
autoIt3 中文手册 (2015.09)
autoit控制chrome的扩展库,正式拜托麻烦的IE
autoit3常用的函数,方便查找,需要的可以下在
AutoIt开发编程平台SciTE4AutoIt3,包含GUI开发工具
Autoit3的Delphi头文件,可以在Delphi中调用,非COM方式。
autoIt3教程、au3教程、从自由天空论坛上下载下来的
AutoIt3中文帮助文件 2010-4-10更新
终于找到好东西了autoit3 AutoIt v3 是用以编写并生成具有 BASIC 语言风格的脚本程序的免费软件, 它被设计用来在Windows GUI(用户界面)中进行自动操作. 通过它可以组合使用模拟键击,鼠标移动和窗口/控件操作等来实现...
傻瓜式的Autoit3代码设计器.Autoit3门外汉助手0.1.7z.rar
从外网获得的 AutoIt3 的 chrome 浏览器驱动,按照压缩包中的说明进行安装即可开发。注意 chrome 浏览器从 79 版本之后就不再支持拖拽安装 crx 插件,所以需要使用较低版本的 chrome 浏览器(不低于版本 29)。目前...
AutoIt3Help.exe脚本说明书
AutoIT3函数用法说明,包含系统环境变量,文件,目录,磁盘管理等
AutoIt3_脚本函数用法中文说明 在看这本小小的电子书之前,也许您也和当初的我一样,不知道 Au3 是何种东西,也 许您只是有听说过,却一直没有时间来试一试。 结识 Au3 完全是一个偶然,在去年夏天的时候,偶然在...
Autoit3代码设计器傻瓜式.Autoit3门外汉助手0.5.7z.rar
AutoIt Script Editor.(Customised version of SciTE with lots of additional coding tools for AutoIt)