穿梭福音 from AyuanX@newsmth

  • 【更新日志】
--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
'==================================================================================
' <Transevangel -- ZIXIA 2 FREE> Auto Proxy script for Fterm
' By AyuanX, July 2007
' Version 1.1
' Report Bugs to <ayuanx$163!com>
'==================================================================================
' 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

'==================================================================================
' <Transevangel -- ZIXIA 2 NEWSMTH> Auto Proxy script for Fterm
' By AyuanX, July 2007
' Version 1.1
' Report Bugs to <ayuanx$163!com>
'==================================================================================
' 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!
'==================================================================================

url : http://ayuanx.spaces.live.com/blog/cns!1870FA594F47FA92!869.entry

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值