PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: fr33bh on 04 March, 2007, 08:13:49

Title: clear mainchat
Post by: fr33bh on 04 March, 2007, 08:13:49
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.
Title: Re: clear mainchat
Post by: CrazyGuy on 04 March, 2007, 14:33:07
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
Title: Re: clear mainchat
Post by: bastya_elvtars on 04 March, 2007, 21:50:22
I have a better alternative: press CTRL+ENTER for approx. 10 seconds, then Enter.
Title: Re: clear mainchat for new API
Post by: HillyBilly on 27 September, 2007, 01:26:54
--[[
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
Title: Re: clear mainchat
Post by: CrazyGuy on 27 September, 2007, 13:12:45
Posting here is fine, since it's an update/extension to the other 2  ;D
Title: Re: clear mainchat
Post by: bastya_elvtars on 27 September, 2007, 14:10:16
Either way, he deserves a Scripter rank. :-)
Title: Re: clear mainchat
Post by: bastya_elvtars on 27 September, 2007, 15:14:30
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.
Title: Re: clear mainchat
Post by: speedX on 28 September, 2007, 14:21:51
Hi hillybilly,
Could u plzz add a profile table so as to give permission or not.
Title: Re: clear mainchat
Post by: HillyBilly on 29 September, 2007, 01:17:40
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