-- mass message from text by ¨˜”°º•Hawk•º°”˜¨ -- simple trig bot uses any text file in the scripts directory -- -- added !send user is optional sDirectory = "esthetic/ascii" bot = "Text_trig" function Main() frmHub:RegBot(bot) end function DataArrival(user, data) data = strsub(data, 1, (strlen(data)-1)) --s,e,prefix,cmd,text = strfind(data, "%b<>%s+(%S)(%S+)%s*(.*)") s,e,command,text,usertosend = strfind(data, "%b<>%s+(%S+)%s*(%S*)%s*(%S*)") if user.bOperator ~= nil then --if prefix == "!" then if command ~= "" then if command == "trigs" then AsciiReadFiles(sDirectory) else AsciiMessageTo(user, command) end else return 1 end --end end end function AsciiMessageTo(user, text) local handle = openfile("esthetic/ascii/"..text..".txt", "r") if (handle ~= nil) then local line = read(handle) Temptimerfile = "\r\n" while line do Temptimerfile = Temptimerfile.."\r\n"..line line = read(handle) end SendToAll(bot, Temptimerfile) closefile(handle) end end function AsciiReadFiles(sDirectory) local sFileName = "listing.txt" local sLine = nil; execute("dir /b /a-d \""..sDirectory.."\" > \""..sFileName.."\""); local hFile =openfile (sFileName, "r"); -- local sTempascii = "\r\n\r\n\tASCII BOT TRIGGS ( Type in main chat )\r\n\r\n" sLine = read(hFile, "*l"); while ( sLine ) do -- sLine will be the file name in sDirectory sLine = read(hFile, "*l"); if sLine ~= nil then sLine = strsub(sLine, 1, (strlen(sLine)-4)) sTempascii = sTempascii..""..sLine.." , " end end SendToAll(bot, sTempascii) closefile(hFile) remove(sFileName); end