Clean main chat
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Clean main chat

Started by malhi, 12 January, 2015, 14:58:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

malhi

HI
im using one Cleanmain chat script but it only clean at my end not the all users end, i want when i use command it should clear main chat for all users also not only at my end, how i can do that ? and which script i need to clean main chat ?

please help

the-master

Ptokax script? post it, see what we can do.
keep on sharing :)

malhi

--[[
   For new API
   
   HillyBilly   26 sept 07
   
   Took some bits and parts from
    CrazyGuy and American Idiot Lua 5.1.x and credits to them.
   
   28 sept 07   
   added Cleaners table who may or may not clean.   -   speedX
   
--]]

cmdClean = "cleanmain"
soapwater = 100 -- For more or less soap and water

tCleaners = {
      [-1] = 0,   -- Unreg Users
      
  • = 1,   -- Masters
          [1] = 1,   -- Operators
          [2] = 0,   -- VIPs
          [3] = 0,   -- Regs
    }
          
    ChatArrival = function(User,Data)
       if tCleaners[User.iProfile] == 1 then
          local _,_,cmd = string.find(Data, "%b<>%s%p(%S+)|")
          if cmd and (cmd == cmdClean) then
             local str = "\n\n"..string.rep("\t",3).." "..
                User.sNick.." is clearing Main Chat...  ???"..
                string.rep("\n",soapwater)..string.rep("\t",3).."Main Chat Has "..
                "Been Cleared By: "..User.sNick.."   ???\n\n"
                Core.SendToAll(str)
                return true
             else
                return "Clear Main Chat","",""
             end
          end
       end
       

the-master

script is running fine, try less soapwater, perhaps your flooding clients  :(
keep on sharing :)

the-master

Only issue I found was a missing Bot.. some clients send those messages to kickbar, try this:
--[[
   For new API 
   
   HillyBilly   26 sept 07
   Added Botname By The-Master 13 jan 2015
   Took some bits and parts from
    CrazyGuy and American Idiot Lua 5.1.x and credits to them. 
   
   28 sept 07   
   added Cleaners table who may or may not clean.   -   speedX
   
--]]
Bot = "Whiper"
cmdClean = "cleanmain"
soapwater = 100 -- For more or less soap and water

tCleaners = {
      [-1] = 0,   -- Unreg Users
      [0] = 1,   -- Masters
	  [1] = 1,   -- Operators
      [2] = 0,   -- VIPs
      [3] = 0,   -- Regs
}
      
ChatArrival = function(User,Data)
   if tCleaners[User.iProfile] == 1 then
      local _,_,cmd = string.find(Data, "%b<>%s%p(%S+)|")
      if cmd and (cmd == cmdClean) then
         local str = "<"..Bot..">\n\n"..string.rep("\t",3).." "..
            User.sNick.." is clearing Main Chat...  ???"..
            string.rep("\n",soapwater)..string.rep("\t",3).."Main Chat Has "..
            "Been Cleared By: "..User.sNick.."   ???\n\n"
            Core.SendToAll(str)
            return true
         else
            return "Clear Main Chat","",""
         end
      end
   end
keep on sharing :)

malhi


Cêñoßy†ê

Couldnt resist to touch it little :P  here is my version  :yes:

Code: lua
--[[
   For new API 
   
   HillyBilly   26 sept 07
   Added Botname By The-Master 13 jan 2015
   Took some bits and parts from
    CrazyGuy and American Idiot Lua 5.1.x and credits to them. 
   
   28 sept 07   
   added Cleaners table who may or may not clean.   -   speedX
   
  07.05.2015
  Removed Cleaners table and made it work only for users with key.
  Cleaned code little - Cêñoßy†ê
   
--]]
Bot = "Whiper"
cmdClean = "cleanmain"
soapwater = 1000 -- For more or less soap and water
      
function ChatArrival(user,data)
	if Core.GetUserData(user,11) then
		local _,_,cmd = data:find("%b<>%s%p(%S+)|")
		if cmd and cmd == cmdClean then
			local str = "<"..Bot..">\n\n"..string.rep("\t",3).." "..
			user.sNick.." is clearing Main Chat..."..
			string.rep("\n",soapwater)..string.rep("\t",3).."Main Chat Has "..
			"Been Cleaned By: "..user.sNick.."\n\n"
			return Core.SendToAll(str),true
		end
	end
end
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk