Simple command blocker per Profile
 

News:

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

Simple command blocker per Profile

Started by the-master, 19 December, 2014, 13:51:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

the-master

To block users for using req/rel part of DixbiT I created a small script but it can be used for any command.
ProfNotAllow={  -- profilelist
	[-1]=1, -- unregistered users
	[3]=1,  -- Regs
}

Block={ -- commands to block
"reladd","reqadd","reqfill","reldel","reqdel","rqsectiondel","rqstatus","rqsectionadd"
}


function ChatArrival(user,data)
	Core.GetUserAllData(user)
	local _,_,msg = data:find( "%b<> (.+)")
	local _,_,cmd = data:find( "^%b<> (%p%a+)")
	local _,_,arg = data:find( "^%b<> %p%a+ (%S+)|")
	if (ProfNotAllow[user.iProfile]==1) then
		if Check(cmd) then
		Core.SendToUser(user,"***Command  "..cmd.." Is Not allowed for your Profile")
			return true
		end
	end
end

function Check(cmd)
	for i = 1,#Block do
		if string.find( cmd, Block[i] , 1 , true ) then
			return 1
		end
	end
end


P.S. This script should run in PtokaX ABOVE all scripts or at least above the script it needs to block commands .
keep on sharing :)

PPK

Why is script needed for that when it is possible to set in dixbot ?  :shocking:
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

the-master

#2
Because we didn't have the DxMngr at that time, but it can be used for any command to block..
Not all hubowners are scripters to  :'(
keep on sharing :)

SMF spam blocked by CleanTalk