-- texter bot by plop -- thx 2 chilla for the faster routine for opening the files -- shows text files from a folder named text. -- doesn't mather what prefix it used. -- if the file excist it shows. Bot = "something" FDFolder = "text" function Main() frmHub:RegBot(Bot) end function DataArrival(user, data) data=strsub(data,1,strlen(data)-1) if( strsub(data, 1, 1) == "<" ) then s,e,cmd = strfind(data,"%b<>%s+%S(%w+)") if cmd and readfrom(FDFolder.."/"..cmd..".txt") then showtext(user, cmd) return 1 end elseif(strsub(data, 1, 4) == "$To:") then s,e,cmd = strfind(data,"$To:%s+%S+%s+From:%s+%S+%s+$%b<>%s+%S(%w+)") if cmd and readfrom(FDFolder.."/"..cmd..".txt") then showtext(user, cmd) return 1 end end end function showtext(user, file) local handle = openfile(FDFolder.."/"..file..".txt", "r") local contents = gsub(read(handle, "*a"),strchar(10), "\r\n") closefile (handle) user:SendPM(Bot, "\r\n"..contents.."\r\n|") end