Say commando for master
 

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

Say commando for master

Started by Kastor, 20 April, 2007, 14:24:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kastor

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

6Marilyn6Manson6

#1
--##	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

Kastor

I trying but it does not works   ???

i writen in main    !say nick message       but doesen't works 

6Marilyn6Manson6

#3
--##	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

Kastor

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!!

6Marilyn6Manson6

#5
--##	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

Kastor

thank you soo much marilyn   ;)

6Marilyn6Manson6


SMF spam blocked by CleanTalk