PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: slick on 23 September, 2005, 18:28:59

Title: change command ?
Post by: slick on 23 September, 2005, 18:28:59
can somebody change the following for me so that the first SendToAll will send to masters such as SendToMaster
and the second SendToAll will send to regged users such as SendToReg i tried the change myself but didn't work


function cl.funcs.clean()
   SendToall(cl.sets.bot , "The regcleaner has been called any registered user that hasn't be in the hub for "..cl.sets.weeks.." weeks will be deleted. ")
   SendToAll(cl.sets.bot , "Contact one of the MASTERS if you will be away for a longer period of time")
   local juliannow = cl.funcs.jdate(tonumber(os.date("%d")), tonumber(os.date("%m")), tonumber(os.date("%Y")))
   local oldest = cl.sets.weeks*7
   local chkd, clnd = 0,0
   for prof, v in cl.levels do
      for a, b in GetUsersByProfile(GetProfileName(prof)) do
         chkd = chkd + 1
         if cl.user then
               if not cl.no then
                  local s, e, month, day, year = string.find(cl.user, "(%d+)%/(%d+)%/(%d+)");
                  year = "20"..year
                  local julian = cl.funcs.jdate( tonumber(day), tonumber(month), tonumber(year) )
                  if ((juliannow - julian) > oldest) then
                     cl.user = nil;
                     DelRegUser(b);
                     clnd = clnd + 1;
                  end
               end
         else
            cl.user = os.date("%x")
         end
      end
   end


Appreciate the help



slick
Title:
Post by: Dessamator on 23 September, 2005, 19:16:12
It cant be done that way, u need a loop to find those profiles, and  SendToNick, or user:senddata(user,"msg").
Unless you create functions that do that, u can find some of those in the forum if you Just search !