yinqiwen / hyk-proxy

Automatically exported from code.google.com/p/hyk-proxy
0 stars 1 forks source link

功能请求:在SPAC CSL脚本中加入初始化第三方程序的功能 #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
研究了一下你的CSL语言,发现只有onRoutine/firstSelectProxy/reselect
ProxyWhenFailed三出入口。感觉还不够完善,建议加个init入口,�
��在SPAC初始化完以后能够自动启动第三方代理。
目前我现在
仅仅是用onRoutine入口凑合着用,这玩意每过一段时间就执行��
�次,我实在没办法只好加入条件判断,如下:

$sshstat=0;

def onRoutine()
{
   #Do your routine business here
   #eg: $output=system("./mysh.sh");
   #    log($output);
   #Tell the script engine to invoke this method 10s later
   if $sshstat == 0
   {$output=system("D:\\Progra~1\\hyk-proxy\\plugins\\spac\\etc\\startssh.cmd");
#第三方代理启动脚本
    log($output);
    $sshstat=1;
   }
   return 10;
}

这样搞虽然勉强能用,但是每十秒做一次条件判断实在是蛋��
�。希望作者能改进一下,多谢。

Original issue reported on code.google.com by elvis.w1...@gmail.com on 25 Jun 2011 at 4:41

GoogleCodeExporter commented 9 years ago
对了,CSL支持那些转义字符,我现在试了\\可以用。我想问一
下嵌套双引号如何处理?是用 \" ?

Original comment by elvis.w1...@gmail.com on 25 Jun 2011 at 4:42

GoogleCodeExporter commented 9 years ago
很好的建议

不过onRoutine()是可以控制执行间隔时间,就是return后面数字,
以秒为单位;

转义字符方面目前支持\b\f\n\r\t这些特殊转义字符,另外\" 
\\这些也是支持的

Original comment by yinqiwen@gmail.com on 25 Jun 2011 at 2:03

GoogleCodeExporter commented 9 years ago
我看了一下这个CSL只支持比较运算符,我觉得运算符还是有��
�要增强一下,最好能支持逻辑运算符,OR AND NOT之类的

Original comment by elvis.w1...@gmail.com on 25 Jun 2011 at 2:36

GoogleCodeExporter commented 9 years ago
所有的基本操作符语法上都是支持的,只是有部分语义上不��
�持
逻辑与&& 和逻辑或 ||是语义上也支持的, 
逻辑非!理论上也在语义上支持,不过没有测试过,逻辑非的�
��号是 !,
语义上目前明确不支持的是“+,-, *, 
/"等数学运算符(只有字符串的"+"语义上支持)
逻辑判断运算符可以像下面一样写
 eg: 
 $test = false; 
 if(!$test && $abc == 1 || $xyz != 3) 
 {
    ... 
 }

Original comment by yinqiwen@gmail.com on 25 Jun 2011 at 3:03

GoogleCodeExporter commented 9 years ago
V0.4.1

Original comment by yinqiwen@gmail.com on 17 Jul 2011 at 5:14