0
我有這個Autoit腳本工作良好,但我如何使它重複工作,而不必重複鍵入每個值的腳本?重複這項工作,而不必重複輸入每個值的腳本
值1 = usernameA與passwordA
值2 = usernameB與passwordB
值3 = usernameC與passwordB
#include <IE.au3>
$oIE = _IECreate ("www.site.com/login")
$username = _IEGetObjByName ($oIE, "q_username")
$id = _IEGetObjByName ($oIE, "q_username")
$password = _IEGetObjByName ($oIE, "q_password")
$id = _IEGetObjByName ($oIE, "q_password")
$button1 = _IEGetObjByName ($oIE, "login")
_IEPropertySet($username, 'innerText', 'usernameA')
_IEPropertySet($id, 'innerText', 'usernameA')
_IEPropertySet($Password, 'innerText', 'passwordA')
_IEPropertySet($id, 'innerText', 'passwordA')
_IEAction ($button1,"click")
工作工作工作,我不希望它是這樣!
#include <IE.au3>
$oIE = _IECreate ("www.site.com/login")
$username = _IEGetObjByName ($oIE, "q_username")
$id = _IEGetObjByName ($oIE, "q_username")
$password = _IEGetObjByName ($oIE, "q_password")
$id = _IEGetObjByName ($oIE, "q_password")
$button1 = _IEGetObjByName ($oIE, "login")
_IEPropertySet($username, 'innerText', 'usernamea')
_IEPropertySet($id, 'innerText', 'usernameA')
_IEPropertySet($Password, 'innerText', 'passworA')
_IEPropertySet($id, 'innerText', 'passwordA')
_IEAction ($button1,"click")
$oIE = _IECreate ("www.site.com/login")
$username = _IEGetObjByName ($oIE, "q_username")
$id = _IEGetObjByName ($oIE, "q_username")
$password = _IEGetObjByName ($oIE, "q_password")
$id = _IEGetObjByName ($oIE, "q_password")
$button1 = _IEGetObjByName ($oIE, "login")
_IEPropertySet($username, 'innerText', 'usernameB')
_IEPropertySet($id, 'innerText', 'usernameB')
_IEPropertySet($Password, 'innerText', 'passwordB')
_IEPropertySet($id, 'innerText', 'passwordB')
_IEAction ($button1,"click")
$oIE = _IECreate ("www.site.com/login")
$username = _IEGetObjByName ($oIE, "q_username")
$id = _IEGetObjByName ($oIE, "j_username")
$password = _IEGetObjByName ($oIE, "q_password")
$id = _IEGetObjByName ($oIE, "q_password")
$button1 = _IEGetObjByName ($oIE, "login")
_IEPropertySet($username, 'innerText', 'usernameC')
_IEPropertySet($id, 'innerText', 'usernameC')
_IEPropertySet($Password, 'innerText', 'passwordC')
_IEPropertySet($id, 'innerText', 'passwordC')
_IEAction ($button1,"click")
另外,如何在腳本完成時回到腳本的第一行?
你並不需要的#include''幾次。 –
Samoth