Block Command script
 

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

Block Command script

Started by Creative, 13 December, 2006, 09:56:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Creative

Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........
--[[ 
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006 
As requested by Silverback?? 
Thanks to Mutor For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI, 
otherwise quiz will accept command before it can be blocked 
]]-- 
--================Config Settings ================================ 
Bot = "Quiz-Guardian"			-- Bot Nick 
HubOwner = "Toobster??"		-- Hub Owner Nick 
HubName = frmHub:GetHubName() 
--================Blocked Commands============================= 
Blocked = { 
"triviascorereset", 
"trivstart", 
"trivstop", 
} 
--================How Offender Is Punished======================== 
-- ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban) 
Action = 1 
--================DO NOT EDIT BELOW========================== 
function ChatArrival(user, data) 
	if user.sName ~= HubOwner then 
		data = string.lower(data) 
		for id, word in ipairs(Blocked) do 
			if string.find(data, word, 1, 1) then 
				SendPmToNick(HubOwner, Bot, user.sName .." Is Messing With Trivia in "..HubName.. 
				", Here Is The Proof - " ..data) 
				user:SendPM(HubOwner,  "THIS IS AN AUTO RESPONSE MESSAGE \r\n\r\n You have been ".. 
				"reported for messing with Quiz,DO NOT do it again \r\n\r\n Here is the proof: " ..data) 
				local action = Actions[Action](user,data) 
				SendPmToOps(Bot, user.sName.." ( "..user.sIP.." )  is "..action.." by "..HubOwner.. 
				" because - Fucking With My Quiz" ..data) 
				return 1 
			end 
		end 
	end 
end

bastya_elvtars

Please use proper English in the forums, I had a hard time decrypting your post. :)
Everything could have been anything else and it would have just as much meaning.

Alexinno

Quote from: SwapY on 13 December, 2006, 09:56:19
Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........

my english is bad too , but i can't understand almost nothing from he's request :D

Dessamator

Im not sure , but I think he doesnt want the ops to be reported when a blocked command is typed,and he wants the command to be seen by all users.
Ignorance is Bliss.

achiever

hi,

lol i did not think ppl here could become so much dum in understanding things  :D

well swapy i have tried to make the changes u asked for:-
note:- this my first try at a script so bare with me if this wont work  ;)
--[[ 
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006 
As requested by Silverback?? 
Thanks to Mutor For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI, 
otherwise quiz will accept command before it can be blocked 
]]-- 
--================Config Settings ================================ 
Bot = "Quiz-Guardian"			-- Bot Nick 
HubOwner = "Toobster??"		-- Hub Owner Nick 
HubName = frmHub:GetHubName() 
--================Blocked Commands============================= 
Blocked = { 
"triviascorereset", 
"trivstart", 
"trivstop", 
}
--================Main Function============================= 
function ChatArrival(user, data) 
	if user.sName ~= HubOwner then 
		data = string.lower(data) 
		for id, word in ipairs(Blocked) do 
			if string.find(data, word, 1, 1) then 
				return 1
			end 
		end 
	end
end


this wont make the command seen by all but should work otherwise  :)

bye,

achiever
thks,
achiever.

Creative

dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........

achiever

Quote from: SwapY on 21 December, 2006, 11:30:36
dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........

plzz make sure of this
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked


and post ur progress  :)

mean while here is the other version of script which will block command according to profiles
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI, 
otherwise quiz will accept command before it can be blocked 
]]--
-================Config Settings ================================ 
Bot = "Quiz-Guardian"			-- Bot Nick 
HubOwner = "Toobster??"		-- Hub Owner Nick 
HubName = frmHub:GetHubName() 
--================Blocked Commands============================= 
Blocked = { 
"triviascorereset", --add ur commands here
"numstop",
"astop", 
}
--================Main Function============================= 
function ChatArrival(user, data)
	if user.iProfile ==  3 then --profile is set to reg
		if user.sName ~= HubOwner then 
			data = string.lower(data) 
			for id, word in ipairs(Blocked) do 
				if string.find(data, word, 1, 1) then
					user:SendData("***Write ur message here ")
					return 1
				end 
			end 
		end
	end
end


and block commands according to file share size of user
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI, 
otherwise quiz will accept command before it can be blocked 
thks to SNOOZE for all the help  ;)
]]--
-================Config Settings ================================ 
Bot = "Quiz-Guardian"			-- Bot Nick 
HubOwner = "Toobster??"		-- Hub Owner Nick 
HubName = frmHub:GetHubName() 
--================Blocked Commands============================= 
Blocked = { 
"triviascorereset", --add ur commands here
"numstop",
"astop", 
}
--================Main Function============================= 
function ChatArrival(user, data)
	if (user.iShareSize/1024/1024/1024) < 1 then --this size is in gb
		if user.sName ~= HubOwner then 
			data = string.lower(data) 
			for id, word in ipairs(Blocked) do 
				if string.find(data, word, 1, 1) then
					user:SendData("*** Write ur message here  ")
					return 1
				end 
			end 
		end
	end
end

all the sugestions to change and improve are most welcome  :)

achiever
thks,
achiever.

SMF spam blocked by CleanTalk