/* * Scol Voyager * * Author : The Scol Team : http://www.scolring.org/ * * This file is a part of the Scol Voyager * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt * * For others informations, please contact us from http://www.scolring.org/ * */ /* * $ LB : Loïc Berthelot, CryoNetworks, june 2001 * modifications : _definesocks is now followed by * _definesocksVersion and _definesocksAuthentication * to manage socks 5 parameters. * */ defcom skip=skip;; defcom register=register S;; var state=0;; typeof chn0=Chn;; typeof name=S;; fun multiress(res)= if res==nil then 0 else let res ->[[l n] nxt] in (if strcmp l "#" then _setress l hd n else nil; multiress nxt);; fun main(ip,s)= set chn0=_channel; set name=s; set _masterchannel=_openchannel ip nil _envchannel _channel; _setsocklife _masterchannel; multiress strextr _loadressini; _setress "MachineName" s; _setLocalIPnumber atoi _getress "localIPindex"; if !strcmpi _getress "AutodetectProxy" "no" then _definesocks _getress "ProxySocks" _getress "ProxyMask" else nil; /* $ LB */ _definesocksVersion _getress "SocksVer"; _definesocksAuthentication _getress "Socks5Authentication"; 0;; fun clock(a,b)= _deltimer a; _scriptc chn0 _starterScript;; fun _connected()= _on _channel skip []; _on _channel register [name]; _setenv chn0 nil; _rfltimer _starttimer _channel 100 @clock 0;; fun __show()= set state= if state==0 then ( _showconsole; 1) else (_hideconsole;0) ;; fun __setress(res,val)=_setress res val;;