\on *:LOAD:{
set %::Ftp.Type .notice
echo -a Ftp Tester LOADED!!
}
menu menubar,channel,status,nicklist {
-
Ftp Tester
.Result Settings
../notice:set %::Ftp.Type .notice
../msg:set %::Ftp.Type .msg
-
}
on *:Text:!test*:#:{
if ($nick == xrn0id) { do.ftp.test $strip($2) | halt }
if ($nick == l33t) { do.ftp.test $strip($2) | halt }
halt
}
alias do.ftp.test {
if (%ftp.stat == No) { %::Ftp.Type $nick Sorry, Please Wait another $timer(cd.ftp.test).secs $+ seconds Before testing again! | halt }
set %what.ftp $1
set %ftp.2.test $gt.ftp($1)
set %ftp.who $nick
sockopen Ftp $+ $rand(99999,999999999) $gettok(%ftp.2.test,1,32) $gettok(%ftp.2.test,4,32)
set %ftp.stat No
.timercd.ftp.test 1 15 ftp.end.session
%::Ftp.Type %ftp.who Attempting Connection...Timeout is set to 15 Seconds
}
alias gt.ftp {
var %ss,%l,%p,%ano,%dir,%pu,%s,%n = 1,%ds
%ss = $remove($1-,ftp://)
if ($numtok(%ss,64) > 1) {
%l = $gettok($gettok(%ss,1- [ $+ [ $calc($numtok(%ss,64) - 1) ] ] ,64),1,58)
%p = $gettok($gettok(%ss,1- [ $+ [ $calc($numtok(%ss,64) - 1) ] ] ,64),2,58)
}
if (%l == $null) {
%l = anonymous
%ano = 1
}
else { %ano = 0 }
if (%p == $null) { %p = $null }
%ss = $gettok(%ss,$numtok(%ss,64),64)
if ($gettok(%ss,2-,47) != $null) {
%dir = $ifmatch
if (/* !iswm %dir) { %dir = / $+ %dir }
}
%ss = $gettok(%ss,1,47)
if ($gettok(%ss,2,58)) { %pu = $ifmatch }
elseif ($gettok(%dir,2,58)) { %pu = $ifmatch }
else { %pu = 21 }
%dir = $gettok(%dir,1,58)
%ss = $gettok(%ss,1,58)
%s = $gettok($gettok(%ss,1,47),1,32)
if (%pu !isnum) { %pu = 21 }
if (%dir == $null) { var %dir }
while ($sock(ftp [ $+ [ %n ] ] )) { inc %n }
%ds = FTP $+ %n
;Ip: %s User: %l Pass: %p Port: %pu
return %s %l %p %pu
}
on *:sockopen:ftp*:{
if ($sockerr) {
%::Ftp.Type $nick Error: $sockname FTP session: $sockerr
return
}
%::Ftp.Type %ftp.who Connection established, Waiting for Welcome note!
}
on *:sockread:ftp*:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
;echo -s 12 %temp
;-user/pass-
if ($gettok(%temp,1,32) == 220) { sockwrite -tn $sockname USER $gettok(%ftp.2.test,2,32) | %::Ftp.Type %ftp.who Welcome note Recived, Now Sending Login... }
if ($gettok(%temp,1,32) == 331) { sockwrite -tn $sockname PASS $gettok(%ftp.2.test,3,32) | %::Ftp.Type %ftp.who Login Sent, Now Sending Pass... }
;---
;-Errors-
if ($gettok(%temp,1,32) == 530) { sockclose $sockname | %::Ftp.Type %ftp.who Error: Login or Password Incorrect! | ftp.fin | halt }
if ($gettok(%temp,1,32) == 421) { sockclose $sockname | %::Ftp.Type %ftp.who Error: The Ftp is Full! | ftp.fin | halt }
;---
;-connected-
if ($gettok(%temp,1,32) == 230) { sockclose $sockname | %::Ftp.Type %ftp.who %what.ftp Currently Working! | ftp.fin | halt }
;-
goto nextread
}
alias ftp.end.session {
ftp.fin
halt
}
alias ftp.fin {
notice %ftp.who Check Ftp Done.... Awaiting Status....
if ($gettok(%temp,1,32) == 230) {
notice %ftp.who FTP Working, you will be voiced shortly
mode #l33t +v %ftp.who
goto next
}
if ($gettok(%temp,1,32) == 421) {
notice %ftp.who FTP Working, you will be voiced shortly
mode #l33t +v %ftp.who
goto next
}
if ($gettok(%temp,1,32) == 530) {
notice %ftp.who Login/Password incorrect. Fix this.
mode #l33t -v %ftp.who
goto next
}
if ($gettok(%temp,1,32) == $null) {
notice %ftp.who FTP not on, or wrong port set. Please correct this.
mode #l33t -v %ftp.who
goto next
}
:next
.timercd.ftp.test Off
unset %ftp.2.test
unset %ftp.who
unset %what.ftp
set %ftp.stat Yes
sockclose ftp*