Ok so i attempted to take this script i had already written to check an ftp and apply it to all the ftps on a list. However it still seems to stop after the first one. All the variables in this script are fine i just need help with the actual script. the ftp checking part if someone could please help me to correct it i would greatly appreciate it.


on *:TEXT:!chkall:?:{
if ($nick isop %channame) {
/set %identchk $readini(%usersfile, $nick, Status)
if (%identchk > 1) || (%identchk == $null) {
.timer $+ $rand(200, 50000) 1 2 /msg $nick Y ou must identify with the bot before using this command.
/halt
} else {
if $2 == rewt { /notice %nick Im sorry but that ftp is local to me and cannot be checked. }
/remove downusers
/set %total $ini(%sitesfile, 0)
/set %errorchk 0
/inc %total 1
/set %count 1
while (%count != %total) {
/set %nick $nick
/set %check $ini(%sitesfile, %count)
/set %ftpusername $readini(%sitesfile, %check, User)
/set %ftppassword $readini(%sitesfile, %check, Notes)
/set %ftpipaddress $readini(%sitesfile, %check, IP)
/set %ftpport $readini(%sitesfile, %check, Port)
/set %ftppassword $remove(%ftppassword,Password: )
/sockopen ftpcheck %ftpipaddress %ftpport
}
}
}

on 1:sockopen:ftpcheck:{
if ($sockerr > 0) {
.timer $+ $rand(200, 50000) 1 2 /msg %nick Connection failed to %check
/set %temp.22 $readini(%sitesfile, %check, Catagory)
/set %temp.22 $readini(%sitesfile, %check, Catagory)
if (Down isin %temp.22) {
/writeini -n %usersfile %check Status 3

} else
if ($nick ishop %channame) || ($nick isvoice %channame) {
/writeini -n %sitesfile %check OldCategory %temp.22
/writeini -n %sitesfile %check Catagory Down
/writeini -n %usersfile %check Status 3

}
}
/sockwrite -n ftpcheck USER %ftpusername
/sockwrite -n ftpcheck PASS %ftppassword
}

on *:sockread:ftpcheck:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -

if (denied isin %temp) {
.timer $+ $rand(200, 50000) 1 2 /msg %nick returned: %temp
/sockclose ftpcheck
/set %temp.22 $readini(%sitesfile, %check, Catagory)
if (Down isin %temp.22) {
/writeini -n %usersfile %check Status 3

}
else {
/writeini -n %sitesfile %check OldCategory %temp.22
/writeini -n %sitesfile %check Catagory Down
/writeini -n %usersfile %check Status 3

}

}

if (logged in isin %temp) {
.timer $+ $rand(200, 50000) 1 2 /msg %nick returned: %temp
/sockclose ftpcheck
.timer $+ $rand(200, 50000) 1 2 /msg %nick %check $+ 's FTP Is Up!
if ($readini(%usersfile, %check, Status) == 3) {
/set %temp.23 $readini(%sitesfile, %check, OldCategory)
/writeini -n %sitesfile %check Catagory %temp.23
/writeini -n %usersfile %check Status 2

}

}

if (incorrect isin %temp) {
.timer $+ $rand(200, 50000) 1 2 /msg %nick returned: %temp
/sockclose ftpcheck
/set %temp.22 $readini(%sitesfile, %check, Catagory)
if (Down isin %temp.22) {
/writeini -n %usersfile %check Status 3
/halt
} else {
/writeini -n %sitesfile %check OldCategory %temp.22
/writeini -n %sitesfile %check Catagory Down
/writeini -n %usersfile %check Status 3
}

}
if (too many isin %temp) {
.timer $+ $rand(200, 50000) 1 2 /msg %nick returned: %temp
.timer $+ $rand(200, 50000) 1 2 /msg %nick %check $+ 's FTP Is Up!
if ($readini(%usersfile, %check, Status) == 3) {
/set %temp.23 $readini(%sitesfile, %check, OldCategory)
/writeini -n %sitesfile %check Catagory %temp.23
/writeini -n %usersfile %check Status 2

}
/sockclose ftpcheck

}
echo 4 %temp
goto nextread
}


also i know category is spelled wrong, im going to correct that. smile