本帖最后由 apoorman1986 于 2012-3-19 18:51 编辑
这几天在推敲zldfsz 大师写的2012自动登录代码。
有句代码看不懂。$usr = "88888888";QQ号
$pwd = "88888888";密码
#include <Process.au3>
$ExistEdit1=0
Run(StringRegExpReplace(RegRead('HKEY_CLASSES_ROOT\Tencent\DefaultIcon', ''), '[^\\]+$', '') & 'QQ.exe')
WinWait("QQ2012")
$Newusr = StringRegExp($usr, "(.)", 3)
$Newpwd = StringRegExp($pwd, "(.)", 3)
Do
$list=WinList('[class:TXGuiFoundation]')
For $u=1 To $list[0][0]
$LPID=WinGetProcess($list[$u][1])
If _ProcessGetName($LPID)="QQ.exe" Then
$POS=WinGetPos($list[$u][1])
$ExistEdit1=ControlSend($list[$u][1], "", "Edit1", "+{tab}")
If $ExistEdit1 Then
Local $QQ[5]=[$list[$u][1],$POS[0],$POS[1],$POS[2],$POS[3]]
ExitLoop
EndIf
EndIf
Next
Sleep(300)
Until $ExistEdit1
Do
Sleep(300)
Until ControlSend($QQ[0], "", "Edit1", "+{tab}")
For $n = 0 To StringLen($usr) - 1
ControlSend($QQ[0], "", "", $Newusr[$n],1)
Next
For $n = 0 To 15
ControlSend($QQ[0], "", "Edit1", "{BS}")
Next
For $n = 0 To StringLen($pwd) - 1
ControlSend($QQ[0], "", "Edit1", $Newpwd[$n],1)
Next
ControlSend($QQ[0], "", "Edit1", "{enter}")
最后的几个循环,有一个
For $n = 0 To 15
ControlSend($QQ[0], "", "Edit1", "{BS}")
Next
整个循环都没有用过$n,这个循环何解? |