--Echo 1.0 --by Mutor The Ugly 9/15/04 --Request by skandaluz -- --Sends random messages to main after a specified number of users have logged in. -- --User Settings------------------------------------------------------------------------------------- Bot = "[Sentry]" -- Rename to your main Px bot. Mins = 2 -- Interval [in minutes] between usercounts before 'Logins' reached. Pause = 4 -- Interval [in minutes] between usercounts after 'Logins' reached. Logins = 10 -- Equal to or more than this number of connected users, bot shall speak. CommOn = "+speak" -- Start script and check usercount. CommOff = "+hush" -- Stop the script. EchoOn = "1" -- Start script on or off ["1"=on "0"=off]. -- -- --What Should this bot say in main chat when enough users have logged in. -- Echoes = { "Tip of the Day: Find a Faker or Someone Violating the !rules Report Him/Her by Typin in Main Chat !report ", "Help I've fallen and I... ...hey nice carpet.", "24 hours in a day ... 24 beers in a case ... coincidence?", "Multitasking : Screwing up several things at once.", "The reason talk is cheap is that supply exceeds demand.", "Support bacteria - they're the only culture some people have.", "BE ALERT! ...The world needs more lerts.", "Shin: a device for finding furniture in the dark", "Nothing is fool-proof to a sufficiently talented fool.", "If ignorance is bliss, you must be orgasmic.", "Stealth means never having to say you're sorry.", "Send Mutor all your money" } --End User Settings---------------------------------------------------------------------------------- function Main() SetTimer(Mins*60000) CheckCount() end function NewUserConnected(user, data) CheckCount() end function UserDisconnected(user, data) CheckCount() end OpConnected = NewUserConnected OpDisconnected = UserDisconnected function DataArrival(user, data) s,e,cmd = strfind(data, "%b<>%s+(%S+)(%S+)") if (cmd==CommOn) and user.bOperator then EchoOn = "1" user:SendData(Bot,"\r\n\r\n\t--<< [ Echo Started ] >>-- Timer Settings: Primary = "..Mins.." minutes. Pause = "..Pause.." minutes.\r\n\tType '"..CommOff.."' to stop script.\r\n\r\n") CheckCount() return 1 elseif (cmd==CommOff) and user.bOperator then EchoOn = "0" user:SendData(Bot,"\r\n\r\n\t--<< [ Echo Stopped ] >>-- Script has been stopped. Type '"..CommOn.."' to start script.\r\n\r\n") CheckCount() return 1 end end function CheckCount() if EchoOn ~= "1" then return 1 end local UserCount = frmHub:GetUsersCount() if UserCount >= Logins then Enough = "yes" StartTimer() else Enough = "" SendToAll(Bot,"\r\n\r\n\tEcho paused, not enough users logged in.\r\n\tUser count will be checked again at next user login. 8-)\r\n\r\n") StopTimer() end end function OnTimer() echo = Echoes[random(1, getn(Echoes))] SendToAll(echo) StopTimer() if Enough == "yes" then SetTimer(Pause*60000) end CheckCount() end