Code: Select all
while true do
--if string.len(buffer)>0 then
buffer = dcc:recv()
rbytes=rbytes+string.len(buffer)
file=io.open(conf.downdir..garg[3], "a")
if not file then
table.insert(chattext[tabnum], "* Error: DCC RECV failed.")
dcc:close()
break
end
file:write(buffer)
file:close()
if finished==true then
System.sleep(100)
dcc:close()
table.insert(chattext[tabnum], "* DCC RECV completed.")
break
end
if rbytes==tonumber(garg[5]) then
--send finished
finished=true
--dcc:close()
--break
end
--end
end