|
本帖最后由 iwantcloth 于 2009-5-30 22:44 编辑
本人非计算机专业、无任何编程基础、接触AUTOIT不超过5天,属于菜中之菜,见谅
今天在制作一个网页表单自动化脚本(其实是一个选课外挂)的时候发生了些问题,寻帮助、百度无果,特来请教
脚本如下
dim $oForm,$oIE,$oQuery,$op,$p,$w
Dim $xkdm[6]
$xkdm[0]=1872
$xkdm[1]=1969
$xkdm[2]=1032
$xkdm[3]=1982
$xkdm[4]=1700
$xkdm[5]=1380
---------------------------------------------------------
#include <IE.au3>
$oIE = _IECreate ("http://xk.peizheng.net.cn/(adq33u45ct4top45yrtrbamr)/WebForm1.aspx")
$oForm = _IEFormGetObjByName ($oIE, "WebForm1")
$oQuery = _IEFormElementGetObjByName ($oForm, "TextBox1")
_IEFormElementSetValue ($oQuery, "某师妹学号")
$oQuery = _IEFormElementGetObjByName ($oForm, "TextBox2")
_IEFormElementSetValue ($oQuery, "某密码")
$oQuery = _IEFormElementGetObjByName ($oForm, "Button2")
_IEAction($oQuery ,"click")
sleep(200)
for $op=0 to 5
$oForm = _IEFormGetObjByName ($oIE, "WebForm7_1")
$oQuery = _IEFormElementGetObjByName ($oForm, "TextBox1")
_IEFormElementSetValue ($oQuery, $xkdm[$op])
$oQuery = _IEFormElementGetObjByName ($oForm, "Button1")
_IEAction($oQuery ,"click")
sleep(500)
Next
Sleep(300)
$oForm = _IEFormGetObjByName ($oIE, "WebForm7_1")
$oQuery = _IEFormElementGetObjByName ($oForm, "Buttonsub3a")
_IEAction($oQuery ,"click")
--------------------------------------------------------
是这样的,我希望在--------------线之间设置循环,已尝试过while,for next,do until,运行后都提示没有匹配的结束语,很不解,另外一个问题是,请问有没有方法判断_IEAction($oQuery ,"click")代码运行后数据是否成功发送,由于是菜鸟,刚才的陈述可能不够专业,请各位高手见谅。 |
|