PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: Vipertje on 31 May, 2007, 21:44:03

Title: Request message script controled by profiles
Post by: Vipertje on 31 May, 2007, 21:44:03
I need a hub message script controlled by hub profiles, i have now 1 that only do mass massage send to the hub and I want some messages send by profiles sort like only to USER profile and REG profile.

Do someone knowa script for that or can someone build something like that for me, that will be great.

grtz,
Vipertje
Title: Re: Request message script controled by profiles
Post by: Vipertje on 01 June, 2007, 00:47:42
If I understand this script then he only send messages to PM's but I want the messages show in MainChat.

Is this possible?
Title: Re: Request message script controled by profiles
Post by: Vipertje on 01 June, 2007, 15:31:27
I have this one now for all users:

-- Rotating Message 1.1 by jiten - for PtokaX 0.3.3.0 build 16.09
-- based on Rotating Message 1.0 by Mutor The Ugly
-- Rotates n text files posted to main chat at interval
--
--User Settings---------------------------------------------------------------------
mSet = {
   sBot = ("Mega-foon"),      -- Bot Name
   RunStatus = 1,         -- Auto Start -> 1=ON 0=OFF
   iDelay = 111,         -- Delay between each text file in minutes
   -- Don't change this
   iCnt = 1,
   --------------------
}

sFile = { -- put here the files you want to send
        "admessage/1.txt",
}

--End User Settings-----------------------------------------------------------------

Main = function() 
   SetTimer(mSet.iDelay*60*1000) 
   StartTimer() 
end 

ChatArrival = function(sUser, sData)
   sData=string.sub(sData,1,-2) 
   local s,e,cmd = string.find(sData, "%b<>%s+[%!%?%+%#](%S+)" )
   if sUser.bOperator then
      local tCmds = {
      ["addon"] =   function(user,data)
               mSet.RunStatus = 1
               user:SendData(mSet.sBot,"Messages started...")
               OnTimer()
            end,
      ["addoff"] =   function(user,data)
               mSet.RunStatus = 0
               user:SendData(mSet.sBot,"Messages stopped...")
            end,
      }
      if tCmds[cmd] then
         return tCmds[cmd](sUser,sData),1
      end
   end
end

OnTimer = function()
   if mSet.RunStatus == 1 then
      for i = 1, table.getn(sFile) do
         if i == mSet.iCnt then
            local f,tmp = io.open(sFile,"r"),""
            if f then
               tmp = f:read("*a")--
               tmp = string.gsub(tmp,"|",string.char(166))
               tmp = string.gsub(tmp,"\n","\r\n")
               f:close()
               SendToAll(mSet.sBot,"\r\n"..tmp)
            end
            if table.getn(sFile) == i then
               mSet.iCnt = 1
            else
               mSet.iCnt = i + 1
            end
            break
         end
      end
   end
end


In this version the text prefers to a txt file. Your version what i did understand of it does only the text what you did input (so only 1 message) is that correct?

If yes is it not possible to prefer it to a txt file also?
Title: Re: Request message script controled by profiles
Post by: Vipertje on 07 June, 2007, 02:56:42
Ok what I want is the script of mine last reply added.

Added in that the script has a users profile setting like:

   [1] = 1,
   [2] = 1,
   [3] = 0,
   [4] = 1,
   [5] = 1,
   [-1] = 0,