-- mass message from text by ¨˜”°º•Hawk•º°”˜¨ -- simple trig bot uses any text file in the scripts directory -- -- added !send user is optional bot = "Text_trig" function Main() frmHub:RegBot(bot) end function DataArrival(user, data) data = strsub(data, 1, (strlen(data)-1)) s,e,command,text,usertosend = strfind(data, "%b<>%s+(%S+)%s*(%S*)%s*(%S*)") if user.bOperator ~= nil then if command == "!send" then if text ~= "" then MessageTo(text) else user:SendData(bot, " you must type the name of the text file you want to send as a mass message i.e ' !send rules '") end end end end function MessageTo(text) local handle = openfile(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 if usertosend ~= "" then SendPmToNick(usertosend, bot, Temptimerfile) else SendPmToAll(bot, Temptimerfile) end end closefile(handle) end --s,e,prefix,cmd,text = strfind(data, "%b<>%s+(%S)(%S+)%s*(.*)")