alias ftp.end { if ([$ftp.channel] != []) { on dcc_raw -"$ftp_channel % C" echo *** Closing ftp connection to $ftp.host dcc close raw $ftp.channel $ftp.host } {echo *** There is no open ftp connection.} ^assign -ftp.channel ^assign -ftp.logged_in } alias ftp.raw { @ ftp.host = [$0] @ ftp.logged_in = [FALSE] @ ftp.channel = [$connect($ftp.host 21 1)] if ([$1]==[] || [$1]==[anonymous]) { on dcc_raw ^"$ftp.channel % D 230 *" @ ftp.logged_in = [TRUE];on dcc_raw -"$ftp.channel % D 230 *" on ^dcc_raw "$ftp.channel % D 331 *" comment on ^dcc_raw "$ftp.channel % C" ftp.end dcc raw $ftp.channel $ftp.host USER anonymous dcc raw $ftp.channel $ftp.host PASS ircdough@localhost @ ftp.junk = [$connect_start($ftp.channel)] } } alias ftp.send.port { ftp.split $ip() 4 @ ftp.myaddress = [$ftp.split.1,$ftp.split.2,$ftp.split.3,$ftp.split.4] ftp.split $ftp.bind_p 2 @ ftp.myport = [$ftp.split.1,$ftp.split.2] dcc raw $ftp.channel $ftp.host PORT $ftp.myaddress,$ftp.myport } alias ftp.bind { @ ftp.bind_p = [$listen(0)] on ^dcc_raw "% % N $ftp.bind_p" @ ftp.bind_chan = [$$0] ftp.send.port @ function_return = [$ftp.bind_p] } alias ftp.split { @ ftp.xx = [$1] @ ftp.yy = [$0] while (ftp.xx >= 1) { @ ftp.split.$ftp.xx = ftp.yy & 255 @ ftp.yy = ftp.yy / 256 @ ftp.xx = ftp.xx-1 } } alias ftp.command { if ([$ftp.channel]==[]) {echo *** You are not currently connected;@ftp.done=1} { if ([$0]==[CD]) {dcc raw $ftp.channel $ftp.host CWD $1} if ([$0]==[CLOSE]) {ftp.end;@ftp.done = 1} if ([$0]==[QUIT]) {ftp.end;@ftp.done = 1} if ([$0]==[EXIT]) {ftp.end;@ftp.done = 1} if ([$0]==[BYE]) {ftp.end;@ftp.done = 1} if ([$0]==[PWD]) {dcc raw $ftp.channel $ftp.host PWD} if ([$0]==[CDUP]) {dcc raw $ftp.channel $ftp.host CDUP} if ([$0]==[DIR]) { ftp.bind if ([$1]) {dcc raw $ftp.channel $ftp.host LIST $1-} {dcc raw $ftp.channel $ftp.host LIST} } if ([$0]==[VIEW]) { ftp.bind if ([$1]) {dcc raw $ftp.channel $ftp.host RETR $1-} {echo *** Look at what?!} } if ([$0]==[GET]) { @ ftp.bind_p = logdcc($1 0) ftp.send.port if ([$1]) {dcc raw $ftp.channel $ftp.host RETR $1-} {echo *** Retrieve what?!} } if ([$0]==[QUOTE]) {dcc raw $ftp.channel $ftp.host $1-} } } alias ftp.open { if ([$0]==[]) {echo *** Ftp to where?!;@ftp.done=1} {if ([$ftp.channel]!=[]) {echo *** You already have an active ftp session.} {ftp.raw $0-} } } alias ftp { @ ftp.done = 0 ^ftp.open $0- # while (ftp.done==[0]) { # input "FTP> " ^ftp.command $$* # } }