;JesseR's finger daemon for mIRC (version 0.2) ;When you first load this script, it will create a directory called "finger" in your mirc directory. ;It will also create an ini file that you may edit, manually or using the /fingerdesc alias. ;A shortcut to get a file from your own finger daemon: /fingerme filename alias fingerme finger $1 $+ @127.0.0.1 ;To set a description for a file. alias fingerdesc { if ( $1 == $null ) { echo 4 -s Usage: /fingerdesc name description (example: /fingerdesc whois About me). echo 4 -s To remove something, just type /fingerdesc name. halt } if ( $2 == $null ) { remini %fingerdir $+ fingerd.ini files $1 | halt } writeini %fingerdir $+ fingerd.ini files $1 $2- } ;Turns the finger daemon on (or off). alias fingerd { if ( $1 == off ) { if ( $show ) { echo 4 -s Finger daemon is now off. } sockclose fingerd halt } if ( $sock(fingerd) == fingerd ) { if ( $show ) { echo 4 -s Finger daemon is already running. } halt } if ( %fingerdir == $null ) { set %a $?!="You don't have a directory set for the finger daemon. $+ $crlf $+ Is it OK if I make one?" if ( %a == $true ) { fingerd_setup | halt } echo 4 -s Please manually set a directory for the finger daemon. echo 4 -s Example: /set %fingerdir c:\mirc\finger\ echo 4 -s Once you do that, type /fingerd to activate the finger daemon. halt } if ( $portfree(79) ) { socklisten fingerd 79 if ( $show ) { echo 4 -s Finger daemon activated. } } else { if ( $show ) { echo 4 -s The finger daemon or another application is already using port 79. } } } alias fingerd_setup { socklisten fingerd 79 set %fingerdir $mirc $+ finger mkdir %fingerdir set %fingerdir %fingerdir $+ \ write %fingerdir $+ test.txt Thanks for using JesseR's finger daemon (v0.2) writeini %fingerdir $+ fingerd.ini files test Test file echo 4 -s Finger daemon set up and activated. Type /fingerme. } ;Turn on the finger daemon when mirc loads. on 1:START: .fingerd on 1:SOCKLISTEN:fingerd: { inc %fingercount set %s fingerr $+ %fingercount sockclose %s sockaccept %s ;After 3 seconds, if I haven't gotten a command, give them a list. Use the socket name for the name of the timer. .timer $+ [ %s ] 1 3 getfinger %s list } ;Standard sockread thingie. Calls the 'getfinger' alias. on 1:SOCKREAD:fingerr*:{ if ( $sockerr > 0 ) return :nextread sockread %temp if ( $sockbr == 0 ) goto out if ( %temp != $null ) { getfinger $sockname $strip(%temp) | halt } goto nextread :out } ;Triggers whenever someone requests a file. alias getfinger { ;cancel the defaulting timer - i got a command (or the timer went off) .timer $+ [ $1 ] off set %a $2 unset %b %i echo 4 -s *** Finger daemon: $sock($1).ip requested " $+ %a $+ " if ( %a == $null ) goto list ;Get the name of the file requested, and make sure that certain chars (such as . and \) are not present. :getfilename-next inc %i set %c $mid(%a,%i,1) if ( %c == $null ) { goto gotfilename } if ( %c isin @:.\/ ) { goto gotfilename } set %b %b $+ %c goto getfilename-next :gotfilename if ( %b == $null ) { goto list } if ( %b == files ) { goto list } if ( %b == list ) { goto list } if ( %b == url ) { goto url } if ( %b == urls ) { goto url } if ( %b == fingerd ) { goto fingerdinfo } set %f %b $+ .txt set %p %fingerdir $+ %f if ( $exists(%p) ) goto sendfile sockwrite -nt $1 I couldn't find the file %f $+ . sockwrite -nt $1 goto list goto out :sendfile bread %p 0 4000 &file sockwrite -n $1 &file goto out :list sockwrite -nt $1 I have the following files: sockwrite -nt $1 unset %i %L :next-getlist inc %i set %f $findfile(%fingerdir,*.txt,%i) if ( %f == $null ) { if ( %i == 1 ) { sockwrite -nt $1 No files. } | goto list-done } ;strip it down to only the name set %q $gettok(%f,$gettok(%f,0,92),92) ;see if there's a description set %d $readini %fingerdir $+ fingerd.ini files $gettok(%q,1,46) if ( %d != $null ) { set %d 6( $+ %d $+ ) } sockwrite -nt $1  $+ %q $+  %d - /finger $gettok(%q,1,46) $+ @ $+ $ip goto next-getlist :list-done sockwrite -nt $1 sockwrite -nt $1 In addition, this finger daemon supports the following: sockwrite -nt $1 sockwrite -nt $1 File list (this list) - /finger files@ $+ $ip sockwrite -nt $1 URL list - /finger url@ $+ $ip sockwrite -nt $1 Info on fingerd.mrc - /finger fingerd@ $+ $ip goto out :url unset %i set %o $url(1).group :url-next inc %i set %g $url(%i).group if ( %g == ? ) { goto url-next } if ( %g == $null ) { goto out } ; if ( %g != %o ) { sockwrite -nt $1 } unset %d if ( $url(%i).desc != $url(%i) ) { set %d $url(%i).desc $+ : } sockwrite -nt $1 %d 12 $+ $url(%i) $+  set %o %g goto url-next :fingerdinfo sockwrite -nt $1 Finger daemon for mIRC v0.2a sockwrite -nt $1 Written by by JesseR (jesseruderman@hotmail.com) sockwrite -nt $1 Download from http://www.angelfire.com/ca/jesser/scripts.html goto out :out sockclose $1 }