A-A+

自动点击未注册total commander启动画面上按钮的脚本

2010年07月13日 经验技巧 暂无评论 阅读 87 次浏览 次

total commander是一款优秀的文件管理软件. 未注册版除了启动的时候有一个nag screen, 需要用户点击一个随机的按钮外, 没有任何功能上的限制.
下面是一个简单的autoit3的脚本, 放在totalcmd的目录里运行即可. autoit是一个免费的语法类似basic的脚本语言, 请自行google

Quote:

; starttc.au3: an autoit script to get rid of tc's nag screen
; put this in the same dir as tc bin
; by galilette@doggiehome
$tc_cmd=@ScriptDir&"totalcmd.exe"
; enable advanced title matching mode so we can use classname
AutoItSetOption ("WinTitleMatchMode", 4)
; exec tc first
Run($tc_cmd)
; wait for the nag screen
$nag="classname=TNASTYNAGSCREEN"
WinWaitActive ($nag)
; classnn of the control containing the info about which button to click
; is "TPanel2". the classnn of the actual button to click is TButton?,
; where `?' + text_of_TPanel2 = 4
$button_to_click = "TButton"&(4 - ControlGetText ($nag,"","TPanel2"))
; send the click
ControlClick ($nag,"",$button_to_click)

Edit@02/15/2006: an updated script is quoted below, the reason for modification is included

Quote:

; starttc.au3: an autoit script to get rid of tc's nag screen
; put this in the same dir as tc bin
; by galilette@doggiehome
; Last modified: 2/15/2006
$tc_cmd=@ScriptDir&"totalcmd.exe"
; enable advanced title matching mode so we can use classname
AutoItSetOption ("WinTitleMatchMode", 4)
; exec tc first
Run($tc_cmd)
; wait for the nag screen, and
; classnn of the control containing the info about which button to click
; is "TPanel2". the classnn of the actual button to click is TButton?,
; where `?' + text_of_TPanel2 = 4
$nag="classname=TNASTYNAGSCREEN"
; !!!!!!!!!
; modification:
; build a loop since from v6.54 on (?) the nag screen and the splash screen confuses autoit
$c=0
Do
WinWaitActive($nag)
$i=ControlGetText ($nag,"","TPanel2")
$c=$c+1
Until NOT ($i="")
; if autoit get confused, $i would be an empty string instead of a valid number
; but do not try using `IsNumber($i)'---seems it's always NOT a number even if it gets a value
$button_to_click="TButton"&(4-$i)
; send the click
ControlClick ($nag,"",$button_to_click)
; uncomment the following to see actually how the do loop works
;msgbox (0,"faint!","it really get looped for "&$c&" times")

标签:

给我留言