PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: Kastor on 20 April, 2007, 14:24:34

Title: Say commando for master
Post by: Kastor on 20 April, 2007, 14:24:34
is it possible make this script only for master category???  :P
if  one Op uses it, the bot he says to it  "you cannot use this command"

thanks
Title: Re: Say commando for master
Post by: 6Marilyn6Manson6 on 20 April, 2007, 14:35:12
--## Start to Say command by Herodes
--## Say command by Herodes Modded by 6Marilyn6Manson6 19/04/2007 [requested by Kastor]
sBot = frmHub:GetHubBotName()

function Main()
pCmd = "[%"..table.concat( frmHub:GetPrefixes(), "%").."]"
end

function ChatArrival(user, sData)
if user.iProfile == 0 then
local s,e, sPrefix, sCmd, sNick, sMsg = string.find( string.sub( sData, 1, -2 ), "%b<>%s*"..pCmd.."(%S+)%s*(%S*)%s*(.*)")
if sCmd == "say" then
if sNick == "" then
user:SendData(sBot, "Please provide a nick to use the say command."); return 1;
elseif sMsg == "" then
user:SendData(sBot, "Please enter a message for "..sNick.." to say."); return 1;
elseif user.iProfile ~= 0 then
user:SendData(sBot, "You cannot use this command."); return 1;
end
SendToAll(sNick, sMsg); return 1;
end
end
end
--// 6Marilyn6Manson6
Title: Re: Say commando for master
Post by: Kastor on 20 April, 2007, 15:03:06
I trying but it does not works   ???

i writen in main    !say nick message       but doesen't works 
Title: Re: Say commando for master
Post by: 6Marilyn6Manson6 on 20 April, 2007, 15:31:46
--## Start to Say command by Herodes
--## Say command by Herodes Modded by 6Marilyn6Manson6 19/04/2007 [requested by Kastor]
--## Fixed Error In third line of ChatArrival function by 6Marilyn6Manson6 19/04/2007 [Thanks Kastor]

sBot = frmHub:GetHubBotName()

function ChatArrival(user, sData)
if user.iProfile == 0 then
local s,e, sCmd, sNick, sMsg = string.find(string.sub(sData, 1, -2 ),"%b<>%s*(%S+)%s+(%S+)%s*(.*)")
if sCmd == "!say" then
if sNick == "" then
user:SendData(sBot, "Please provide a nick to use the say command."); return 1;
elseif sMsg == "" then
user:SendData(sBot, "Please enter a message for "..sNick.." to say."); return 1;
elseif user.iProfile ~= 0 then
user:SendData(sBot, "You cannot use this command."); return 1;
end
SendToAll(sNick, sMsg); return 1;
end
end
end
--// 6Marilyn6Manson6


Now work, sorry for first and thanks for testing ^^. Post update :D
Title: Re: Say commando for master
Post by: Kastor on 20 April, 2007, 19:38:44
now it is work  ;)

when an operator write "  !say nick message " in mainchat , it is doesen't see the phrase :" You cannot use this command" . But it is not important

thank you soo much!!
Title: Re: Say commando for master
Post by: 6Marilyn6Manson6 on 20 April, 2007, 19:57:13
--## Start to Say command by Herodes
--## Say command by Herodes Modded by 6Marilyn6Manson6 19/04/2007 [requested by Kastor]
--## Fixed Error In third line of ChatArrival function by 6Marilyn6Manson6 19/04/2007 [Thanks Kastor]

sBot = frmHub:GetHubBotName()

function ChatArrival(user, sData)
local s,e, sCmd, sNick, sMsg = string.find(string.sub(sData, 1, -2 ),"%b<>%s*(%S+)%s+(%S+)%s*(.*)")
if user.iProfile ~= 0 then
user:SendData(sBot, "You cannot use this command."); return 1;
elseif user.iProfile == 0 then
if sCmd == "!say" then
if sNick == "" then
user:SendData(sBot, "Please provide a nick to use the say command."); return 1;
elseif sMsg == "" then
user:SendData(sBot, "Please enter a message for "..sNick.." to say."); return 1;
end
SendToAll(sNick, sMsg); return 1;
end
end
end
--// 6Marilyn6Manson6


For you lol
Title: Re: Say commando for master
Post by: Kastor on 20 April, 2007, 20:54:41
thank you soo much marilyn   ;)
Title: Re: Say commando for master
Post by: 6Marilyn6Manson6 on 20 April, 2007, 21:11:25
Welcome