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.
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
I have a better alternative: press CTRL+ENTER for approx. 10 seconds, then Enter.
--[[
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
Posting here is fine, since it's an update/extension to the other 2 ;D
Either way, he deserves a Scripter rank. :-)
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.
Hi hillybilly,
Could u plzz add a profile table so as to give permission or not.
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 (http://forum.ptokax.org/index.php?topic=7346.0)
Thnxs bastya_elvtars
Cheers HB