--Chat Watcher 1.0 -- --by Mutor --Requested by enema -- --Sends advertisemnt on preset number of main chat lines -- --User Settings------------------------------------------------------------------------------------- maxhistory = 4 -- maximum lines of listen for, next line will trigger response botname = "[Sentry]" -- Set your advertisement here... msg="" msg = "\r\n\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n" msg = msg.."\t\tPlace your Hub Advertisement here:\r\n" msg = msg.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n" msg = msg.."\t\tEach line may be set here...\r\n" msg = msg.."\t\tAdd as many as you like...\r\n" msg = msg.."\t\tIt will all be sent at once\r\n" msg = msg.."\t\t...\r\n" msg = msg.."\t\t...\r\n" msg = msg.."\t\t\t...end of hub advert\r\n" msg = msg.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n" -- --End User Settings---------------------------------------------------------------------------------- chathistory ={} function DataArrival(user, data) if strsub(data, 1, 1) ~= "<" then return end local s, e, pre = strfind(data, "^%b<> (.)") if pre == "!" or pre == "+" or pre == "?" then return end -- disallow command input to cached chat tinsert(chathistory, date("[%H:%M] ")..strsub(data, 1, -2)) if getn(chathistory) > maxhistory then chathistory = {} SendToAll((maxhistory +1).." lines of chat detected.\r\n") -- Delete this line once you've set ad SendToAll(msg) end end