/*) CTCP FDCC v1.0 by Josef Faulkner (panther@gate.net) IRC: Josef \\\ /// Written for Grapevine 1.436 and newer. (CTCP trapping) \\\ /// This program is unlike XDCC in that it will allow a user to access \\\ a directory, and all of its subdirectories recursively to autoget /// by DCC files from you. \\\ /// I have tried to make the system as secure as possible, so that nobody \\\ can go above the assigned area on your drive. If you see any holes in /// this, please inform me asap. \\\ /// Insallation: \\\ 1) install in your grapevine arexx drawer /// 2) assign FDCC: wherever your files are \\\ /// Usage: \\\ /ctcp LIST lists files in format /// /ctcp SEND sends in current dir \\\ /ctcp MOVE sends in current dir by DCC MOVE /// /ctcp CD changes directory to for that user \\\ /// Notes: \\\ o Up to 40-character descriptions can be added by simply making a filenote /// o No recursion limits \\\ o Separate current directories kept in arexx clipboards for each nick /// o Do not use any UNIX DIRS type programs with this, as this does not \\\ check for .. in the path. Pester me and ill implement this for /// the next version. \\\ o Be sure to set your nick below (*/ mynick='me' bold=d2c(2) options results if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do 'echo You need rexxsupport.library version 30 or greater in libs:' exit 10 end parse arg cmds if word(cmds,1)~='¶' then do parse source . . thisscript . thissscript=strip(thisscript) address command 'run >NIL: rx' thisscript '¶' address() cmds exit end else do parse var cmds .' 'addr' 'nick' 'userid' 'cmd' 'args' '. address(addr) ctcpswitch=getclip('gv.switch') if ctcpswitch=1 then do 'notice 'nick' CTCP scripts are currently deactivated.' 'echo CTCP FDCC request recieved from 'nick'.' end else do cmd=upper(cmd) text=getclip('gv.fdcc') if text~='' then do if (word(text,1)=nick)&(((time(S))-word(text,2))<=5) then do call setclip('gv.fdcc',nick' 'time(S)) exit end end call setclip('gv.fdcc',nick' 'time(S)) curdir=getclip('fdcc.'nick) if (strip(curdir)='')|(index(curdir,'//')>0)|(left(curdir,5)~='FDCC:') then curdir='FDCC:' select when cmd='LIST' then do if showlist('A','FDCC') then do files=showdir(curdir) c=0 'notice' nick 'Files in 'curdir do until files="" c=c+1 parse var files file' 'files info=statef(curdir||file) parse var info type' 'length' 'blocks' 'protection' 'days' 'minutes' 'ticks' 'comment file=left(file,20,' ') length=left(length,7,' ') comment=left(comment,40,' ') if type='FILE' then 'notice' nick file length comment else 'notice' nick file 'DIR' if c//5=0 then call delay(200) end 'notice' nick 'End of list.' end else 'notice' nick 'Sorry, no FDCC directory was found on this client.' end when cmd='LS' then do if showlist('A','FDCC') then do files=showdir(curdir) otext='' do c=1 to words(files) if word(statef(curdir||word(files,c)),1)='DIR' then otext=otext||bold||word(files,c)||bold' ' else otext=otext||word(files,c)||' ' end done=0 do until done if length(otext)>400 then do outtext=left(otext,(wordindex(otext,words(left(otext,400))))-1) otext=right(otext,(length(otext)-length(outtext))) end else do outtext=otext done=1 end if index(outtext,' ')>0 then outtext=delstr(outtext,index(outtext,' '),1) if length(outtext)>0 then 'notice' nick outtext else 'notice' nick 'No files exist in this dir.' end end else 'notice' nick 'Sorry, no FDCC directory was found on this client.' end when (cmd='SEND')|(cmd='MOVE') then do if showlist('A','FDCC') then do if (index(args,':')=0)&(index(args,'/')=0) then do if exists(curdir||args) then do 'dcc' cmd nick curdir||args end else 'notice' nick args 'not found.' end else 'notice' nick ': and / are not allowable filename characters.' end else 'notice' nick 'Sorry, no FDCC directory was found on this client.' end when cmd='CD' then do if showlist('A','FDCC') then do if strip(args)~='' then do if index(args,':')=0 then do if exists(curdir||args) then do if word(statef(curdir||args),1)='DIR' then do select when right(args,1)='/' then do if right(curdir,1)='/' then do if index(curdir,'/')=length(curdir) then do curdir='FDCC:' end else do curdir=reverse(curdir) parse var curdir '/'.'/'curdir curdir=reverse(curdir)||'/' end call setclip('fdcc.'nick,curdir) 'notice' nick 'Directory changed to 'curdir end else 'notice' nick 'You are in the root dir.' end when index(args,':')>0 then do call setclip('fdcc.'nick,'FDCC:') 'notice' nick 'Directory changed to FDCC:' end otherwise do cddir=curdir||args'/' call setclip('fdcc.'nick,cddir) 'notice' nick 'Directory changed to 'curdir||args'/' end end end else 'notice' nick 'You cant CD to a file.' end else 'notice' nick args 'does not exist.' end else 'notice' nick 'Cannot change to another drive ('args').' end else 'notice' nick 'Current directory is' curdir end else 'notice' nick 'Sorry, no FDCC directory was found on this client.' end when cmd='HELP' then do 'notice' nick 'FDCC v1.0 by Josef Faulkner - recursive autodcc script for Grapevine' 'notice' nick '/ctcp' mynick 'FDCC LIST lists files in format ' 'notice' nick '/ctcp' mynick 'FDCC SEND sends in current dir' 'notice' nick '/ctcp' mynick 'FDCC MOVE sends in current dir by DCC MOVE' 'notice' nick '/ctcp' mynick 'FDCC CD changes directory to for that user' 'notice' nick '/ctcp' mynick 'FDCC LS shows files in smaller space (no extra info)' end otherwise 'notice' nick 'Unknown command:' cmd end end end