穿梭福音 V1.1

【更新日志】
–V1.1
新添了 紫霞->水木社区 的福音
理论上解决了偶尔会在好友列表卡住的问题(因受Fterm接口的制约,实际效果由网络速度决定)

–V1.0
每天都要手动从Zixia穿梭到Free,实在太烦,不能忍了
试试这个吧:【穿梭福音:紫霞->自由空间】,刚写的

用法很简单:
0. 先改脚本里的user和pass,保存(只做一次)
1. 然后开Fterm
2. 然后通过Fterm的菜单运行这个脚本
3. 然后用SSH方式登录bbs.zixia.net,手动/自动登录皆可(一定要SSH,一定用域名登)
然后…..Wait & See

运行一次,以后多次登录均有效(如在好友列表卡住,先按回车再按左箭头皆可)

【脚本源代码】
Zixia2Free-v11.vbs

'==================================================================================
'  Auto Proxy script for Fterm
' By AyuanX, July 2007
' Version 1.1
' Report Bugs to 
'==================================================================================
' Q: Why do we need it?
' A:
'    Because it is in pain that we find the meaning of life.
'    And the state of grace that we lose when we sway.
'==================================================================================
' Q: How do we use it?
' A: 
'    0. Set up your preference(user & pass) below
'    1. Run this script from Fterm menu
'    2. Login ZIXIA by domain name in SSH
'    PS: a) Telnet is not supported yet, maybe in future version
'        b) Domain name must contain "ZIXIA"(ingnore case), IP login is not supported yet
'        c) Currently the script is far from perfect, so you're on your own risk!
'=================================================================================
' Q: What's new in V1.1?
' A: 
'    Solved the freezing problem at Friends Online Interface
'=================================================================================
user="AyuanX" 				'== Your ID of Free NOT Zixia
pass="whosgonnabemybaby"		'== Sorry but we have to show our love in PLAIN language
Const delay=10				'== Oh yeah, World Wide Waiting (in millisecond)
Const tag="欢迎您使用ssh方式访问"	'== I'm sure you will neither suicide nor modify this
'==================================================================================
Function waitandact(wid, line, char, key)
	If IsNull(char) Then
		Dim buf(22)
		For j=0 To 22
			buf(j)=FTerm.Windows(wid).GetBuffer(j)
		Next
		FTerm.Windows(wid).SendConvertedData(key)
		k=0
		Do
			FTerm.Delay(delay)
			For j=0 To 22
				k=k+Abs(StrComp(buf(j), FTerm.Windows(wid).GetBuffer(j)))
			Next
		Loop until k
	Else
		buf=FTerm.Windows(wid).GetBuffer(line)
		If InStr(1, buf, char, 0) Then
			FTerm.Windows(wid).SendConvertedData(key)
			Do
				FTerm.Delay(delay)
				buff=FTerm.Windows(wid).GetBuffer(line)
			Loop until StrComp(buf, buff)
			waitandact=True
		Else
			waitandact=False
		End If
	End If
End Function
flag=True
Sub FTerm_OnDataCome(wid, data)
	If flag Then
		If InStr(1, LCase(FTerm.Windows(wid).HostAddress), "zixia", 1) Then
			If InStr(1, data, tag, 0) Then
				On Error Resume Next
				flag=False
				FTerm.Delay(delay)
				call waitandact(wid, 22, Null, "^M")
				For j=0 To 10 'To avoid dead lock
					If waitandact(wid, 0, "主选单", "z^Mb^Mf^M") Then
						Exit For
					Else
						If waitandact(wid, 0, "好朋友列表", "^[[D") Then
						Else
							call waitandact(wid, 0, Null, "^[[D")
						End If
					End If
				Next
				FTerm.Delay(delay)
				call waitandact(wid, 22, Null, user&"^M"&pass&"^M^M")
				For j=0 To 10 'To avoid dead lock
					If waitandact(wid, 0, "自由空间", "^[[Df^M") Then
						Exit For
					Else
						call waitandact(wid, 0, Null, "^[[D")
					End If
				Next
				flag=True
			End If
		End If
	End If
End Sub
'==================================================================================
' Run just one time and forever auto proxy!
'==================================================================================

Zixia2Newsmth-v11.vbs

'==================================================================================
'  Auto Proxy script for Fterm
' By AyuanX, July 2007
' Version 1.1
' Report Bugs to 
'==================================================================================
' Q: Why do we need it?
' A:
'    Because it is in pain that we find the meaning of life.
'    And the state of grace that we lose when we sway.
'==================================================================================
' Q: How do we use it?
' A: 
'    0. Set up your preference(user & pass) below
'    1. Run this script from Fterm menu
'    2. Login ZIXIA by domain name in SSH
'    PS: a) Telnet is not supported yet, maybe in future version
'        b) Domain name must contain "ZIXIA"(ingnore case), IP login is not supported yet
'        c) Currently the script is far from perfect, so you're on your own risk!
'=================================================================================
' Q: What's new in V1.1?
' A: 
'    Solved the freezing problem at Friends Online Interface
'=================================================================================
user="AyuanX" 				'== Your ID of Free NOT Zixia
pass="whosgonnabemybaby"		'== Sorry but we have to show our love in PLAIN language
Const delay=10				'== Oh yeah, World Wide Waiting (in millisecond)
Const tag="欢迎您使用ssh方式访问"	'== I'm sure you will neither suicide nor modify this
'==================================================================================
Function waitandact(wid, line, char, key)
	If IsNull(char) Then
		Dim buf(22)
		For j=0 To 22
			buf(j)=FTerm.Windows(wid).GetBuffer(j)
		Next
		FTerm.Windows(wid).SendConvertedData(key)
		k=0
		Do
			FTerm.Delay(delay)
			For j=0 To 22
				k=k+Abs(StrComp(buf(j), FTerm.Windows(wid).GetBuffer(j)))
			Next
		Loop until k
	Else
		buf=FTerm.Windows(wid).GetBuffer(line)
		If InStr(1, buf, char, 0) Then
			FTerm.Windows(wid).SendConvertedData(key)
			Do
				FTerm.Delay(delay)
				buff=FTerm.Windows(wid).GetBuffer(line)
			Loop until StrComp(buf, buff)
			waitandact=True
		Else
			waitandact=False
		End If
	End If
End Function
flag=True
Sub FTerm_OnDataCome(wid, data)
	If flag Then
		If InStr(1, LCase(FTerm.Windows(wid).HostAddress), "zixia", 1) Then
			If InStr(1, data, tag, 0) Then
				On Error Resume Next
				flag=False
				FTerm.Delay(delay)
				call waitandact(wid, 22, Null, "^M")
				For j=0 To 10 'To avoid dead lock
					If waitandact(wid, 0, "主选单", "z^Mb^Mc^M") Then
						Exit For
					Else
						If waitandact(wid, 0, "好朋友列表", "^[[D") Then
						Else
							call waitandact(wid, 0, Null, "^[[D")
						End If
					End If
				Next
				FTerm.Delay(delay)
				call waitandact(wid, 22, Null, user&"^M"&pass&"^M^M")
				For j=0 To 10 'To avoid dead lock
					If waitandact(wid, 0, "水木社区", "^[[Df^M") Then
						Exit For
					Else
						call waitandact(wid, 0, Null, "^[[D")
					End If
				Next
				flag=True
			End If
		End If
	End If
End Sub
'==================================================================================
' Run just one time and forever auto proxy!
'==================================================================================

【打包下载地址】
http://cid-1870fa594f47fa92.office.live.com/self.aspx/Script/transevangel^_v11.zip
【打包备用下载】
http://chounoki.webs.com/works/transevangel_v11.zip

Advertisements

About AyuanX

Big Brother is watching you! Yes, you!
This entry was posted in 個人用途 and tagged , . Bookmark the permalink.

4 Responses to 穿梭福音 V1.1

  1. 彪悍的狂战士 says:

     打开脚本就报错了
    script error
    context 0,error in line1,column 1
    MS VBScript compilation error
    然后登陆就停在欢迎画面了

  2. 彪悍的狂战士 says:

    对了,是穿free,我每天也手动穿……累死 

  3. AyuanX says:

    原因很简单,因为你把第一行第一列的 ‘ 给弄丢了 

  4. 彪悍的狂战士 says:

    恩,vista下有问题,明日试试xp 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s