var index=0;; var incr=1024;; var typzip=1;; typeof lstp=[[S S S] r1];; var lastp="";; var state=0;; var indp=0;; var incrp=1024;; var flagreq=0;; var dead=0;; defcom need = need S I I;; defcom down = down S;; defcom enddown = enddown;; defcom endoflist = endlist;; defcom packlst=packlst S;; defcom require=require S;; defcom badversion=badversion;; defcom addscript = addscript S;; defcom endscript = endscript;; fun fillpack(l)= if l==nil then 0 else let l->[a n] in let a->[name _ _] in let _getpack _checkpack name -> s in (mutate a<-[_ if typzip==1 then mzip s else zip s _getlongname s "" "#"]; fillpack n);; fun _connected()= let packsusers->[[_ a _] _] in if (strlen a)==0 then fillpack packsusers else nil; set lstp=packsusers;; fun buildpack(l)= if l==nil then nil else let l->[[s cont sign] n] in (s::(itoa strlen cont)::"1"::nil)::buildpack n;; fun __getpack()= if flagreq then nil else _on _channel packlst [strbuild buildpack packsusers];; fun buildreq(l)= if l==nil then nil else let l->[[s cont sign] n] in (s::(itoa strlen cont)::sign::nil)::buildreq n;; fun __version(i)= set flagreq=1; if i [a nxt] in let a -> [s cont sign] in (set lstp=nxt; set lastp=cont; _on _channel need [s strlen cont typzip]);; fun __next()= let substr scriptuser index incr -> s in if (strlen s)==0 then (_on _channel endscript []; _setenv _channel _removepkg _envchannel _channel; _script scriptserver) else (set index=index+incr; _on _channel addscript [s]);; fun __skip()= _setenv _channel _removepkg _envchannel _channel; _script scriptserver;; fun __downl()= if state==0 then (set state=1; set indp=0) else 0; let substr lastp indp incrp -> s in if s==nil then nil else if (strlen s)==0 then (_on _channel enddown []; set lastp=nil; set state=0) else (set indp=indp+incrp; _on _channel down [s]);;