clear mainchat
 

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

clear mainchat

Started by fr33bh, 04 March, 2007, 08:13:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fr33bh

hi. i want an mod that will clean my mainchat OR to show a message like this to everyone on mainchat:
Start cleaning mainchat















Mainchat succesfully cleaned.


Thanks in advance.

CrazyGuy

okay, since you're not the first 1 requesting this, here goes....

cmdClean = "cleanmain"

ChatArrival = function(User,Data)
	local _,_,cmd = string.find(Data, "%b<>%s%p(%S+)|")
	if cmd and (cmd == cmdClean) then
		SendToAll(frmHub:GetHubBotName(), "Mainchat cleaning started by "..User.sName)
		SendToAll(frmHub:GetHubBotName(), "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\tMainchat cleaning finished\n")
		return 1
	end
end

bastya_elvtars

I have a better alternative: press CTRL+ENTER for approx. 10 seconds, then Enter.
Everything could have been anything else and it would have just as much meaning.

HillyBilly

#3
--[[
	For new API 
	
	HillyBilly	26 sept 07
	
	Took some bits and parts from
	 CrazyGuy and Mutor 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
		[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 = "\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



Cheers HB

CrazyGuy

Posting here is fine, since it's an update/extension to the other 2  ;D

bastya_elvtars

Either way, he deserves a Scripter rank. :-)
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

Quote from: Mutor on 27 September, 2007, 14:54:41
Does he? Shouldn't that be due to some form of original work?
This is, self admittedly just a copied function.

The policy is that someone who knows a little bit of Lua and wants to submit scripts can get a scripter ranking.
Everything could have been anything else and it would have just as much meaning.

speedX

Hi hillybilly,
Could u plzz add a profile table so as to give permission or not.
Thanking You,

speedX

HillyBilly

Quote from: speedX on 28 September, 2007, 14:21:51
Hi hillybilly,
Could u plzz add a profile table so as to give permission or not.

Previous post updated.
Made a new topic http://forum.ptokax.org/index.php?topic=7346.0
Thnxs bastya_elvtars

Cheers HB

SMF spam blocked by CleanTalk