Can't kick/ban/redirect/gag admin...
 

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

Can't kick/ban/redirect/gag admin...

Started by NemeziS, 26 September, 2004, 00:24:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

Hi!
Another request! I wanted a bot that will protect admin from kick/ban/redirect/gag (even by op). And to protect Ops from kick/ban/redirect/gag by users which profile is
below.
I already saw "can't kick admin" script here, but my PtokaX 0330 finds an error there. So who can make this individual script for me? :)
--LUA forever! =)

nErBoS

#1
Hi,

Can you give me the syntax of that commands ??? (syntax = !kick )

Best regards, nErBoS
--## nErBoS Spot ##--

NemeziS

Of course!
Here you are:

!drop
!redir
!gag
!ungag
!ban  
--LUA forever! =)

enema

why just you dont use Robocop 7 or later and configure it youreself?

nErBoS

Hi,

Here is the script...

--## PROFILE PROTECTOR BOT
--## Requested by NemeziS
--## Made by nErBoS

sBot = "PP-Bot"

--## Only remove this array if your ptokax supports LUA 5 ##--
string = {
	sub = strsub,
	len = strlen,
	find = strfind,
	lower = strlower,
}
--## END of REMOVE ##--

arrCMD = {
	["!drop"] = 1, 
	["!redir"] = 1, 
	["!gag"] = 1, 
	["!ungag"] = 1, 
	["!ban"] = 1, 
	["!nickban"] = 1, 
	["!banip"] = 1, 
}

function Main()
	frmHub:RegBot(sBot)
end

function DataArrival(user,data)
	if (string.sub(data,1,1) == "<" or string.sub(data,1,5+string.len(sBot)) == "$To: "..sBot) then
		data = strign.sub(data,1,string.len(data)-1)
		s,e,cmd = string.find(data, "%b<>%s+(%S+)")
		if (arrCMD[string.lower(cmd)] ~= nil) then
			local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)")
			if (nick ~= nil and CheckProfile(user,nick) ~= nil) then
				user:SendPM(sBot, "You can't use the command "..cmd.." against the user "..nick)
				return 1
			end
		end
	end
end

function CheckProfile(user,nick)
	if (GetItemByName(nick) ~= nil) then
		nick = GetItemByName(nick)
		if ((user.iProfile == 0 or user.bOperator) and nick.iProfile == 0) then
			return 1
		elseif (user.bOperator and not user.iProfile == 0 and (nick.bOperator or nick.iProfile == 2) then
			return 1
		end
	end
	return nil
end

Status of the script:

Master - can't use the commands against Masters
Operator - can't use the commands against OPs and VIPs

NOTE: This script should be in the first palce of your script list

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk