Windows脚步开发工具Autoit及网页刷新实例介绍

本文介绍了如何利用Autoit这款Windows脚本工具编写脚本来实现论坛页面的定时刷新。通过WinWaitActive函数定位窗口,Send函数发送F5键实现刷新,并通过Scite编辑器进行代码编写。此外,还概述了Autoit的基本功能和特点,包括其易学的语法、模拟输入、窗口操作等。

今天想写一个论坛在线刷新工具,无意间看到了autoit这个windows下的脚步工具,自带帮助文档,学习起来很快,正常情况下一天即可写成很出色的脚步工具来,根据帮助文档的引导我知道可以写一些自动化安装,字符串处理,定时执行等工具,非常方便。

再有一个是自动化脚步的编辑工具Scite也非常好用,输入函数后会有参数自动提示,下面我讲一下如何进行论坛定时刷新。

第一步

找到论坛的标题,点开始->所有程序->autoit v3->autoit v3 Window Info

使用界面中的Finder Tool下面的按钮拖拽到你想要刷新的论坛网页上,这是可以看到autoit v3 Window Info中已经获得了你所选择的窗体的Tiltle等信息,拷贝Title信息。

第二步

编写脚本:点开始->所有程序->autoit v3->SciTe Script Editor,输入如下代码

;refresh web page every 30 seconds

;WinWaitActive Pauses execution of the script until the requested window is active.
WinWaitActive("AutoIt Script Editor Installation - AutoItScript - Mozilla Firefox“)

 

;into the while loop function forever,execute the refresh with the command F5,Waiting 30 seconds after the refreshing.

While(True)
   Send("{F5}")
   sleep(30*1000)
WEnd
第3步:

点击Tools ->build(F7) -> go(F5)执行即可。

 

auto官网:http://www.autoitscript.com/site/autoit/

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

AutoIt was initially designed for PC “roll out” situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect.

Features:

  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 2000 / XP / 2003 / Vista / 2008 / Windows 7 / 2008 R2
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista’s User Account Control (UAC)

AutoIt has been designed to be as small as possible and stand-alone with no external .dll files or registry entries required making it safe to use on Servers. Scripts can be compiled into stand-alone executables with Aut2Exe.

Also supplied is a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!

Best of all, AutoIt continues to be FREE – but if you want to support the time, money and effort spent on the project and web hosting then you may donate.

Take me to the downloads page!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值