Extended VIP
 

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

Extended VIP

Started by Madman, 08 March, 2006, 06:55:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Madman

-- Extended VIP
-- Made by Madman, 08.03.06
-- Request by Mikey

-- Allows VIPs with right prefix to reg regs/vips in the hub
-- Block's Kicks from Ops...user can still be kicked by Higher profiles

ExVipPrefix = "ExVIP" -- Prefix of the Extended VIP profile, without [ and ] !
MenuName = "Extended VIP Menu" -- The name on the RightClick Menu

function ChatArrival(curUser, data)
	-- Block kicking msg from appering in main
	if string.find(data, "is%skicking") then -- Find this text
		if string.find(data, "%["..ExVipPrefix.."%]%S+") and curUser.iProfile == 1 then -- Check 4 prefix and Op
			return 1 -- Block Text
		end
	end
	-- The cmd part...
	local data = string.sub(data, 1, -2)
	local s,e,cmd = string.find(data, "%b<>%s+[%!%+%#%?](%S+)") -- Find cmds
	if cmd then -- Make sure we got a cmd
		local tCmds = {
		["regreg"] = function(curUser, data)
			if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") and curUser.iProfile == 2 then -- Find the prefix and make sure user is VIP
				local s,e,nick,pass = string.find(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)") -- Catch nick and pass
				if nick and pass then -- If we got both
					if frmHub:isNickRegged(nick) then -- Check if nick is regged allready
						curUser:SendData(frmHub:GetHubBotName(), nick.. " is allready regged") return 1
					end
					AddRegUser(nick, pass, 3) -- Reg user
					Send(nick, "REG", curUser) return 1 -- Send this
				end
				curUser:SendData(frmHub:GetHubBotName(), "Syntax: !" ..cmd.. " <Nick> <Password>") return 1 -- If we didn't find nick and/or pass
			end
		end,
		["regvip"] = function(curUser, data)
			if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") and curUser.iProfile == 2 then -- Find the prefix and make sure user is VIP
				local s,e,nick,pass = string.find(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")
				if nick and pass then
					if frmHub:isNickRegged(nick) then
						curUser:SendData(frmHub:GetHubBotName(), nick.. " is allready regged") return 1
					end
					AddRegUser(nick, pass, 2)
					Send(nick, "VIP", curUser) return 1
				end
				curUser:SendData(frmHub:GetHubBotName(), "Syntax: !" ..cmd.. " <Nick> <Password>") return 1
			end
		end,
		["kick"] = function(curUser, data) -- Block cmd kick
			local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)")
			nick = GetItemByName(nick)
			if string.find(nick.sName, "%["..ExVipPrefix.."%]%S+") and nick.iProfile == 2 then
				if curUser.iProfile == 1 then
					curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP, only master's and higer can kick this user") return 1
				end
			end
		end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](curUser, data)
		end
	end
end

-- Block client kick
function KickArrival(curUser, data)
	local _,_,nick = string.find(data, "%S+%s+(%S+)|")
	if string.find(nick, "%["..ExVipPrefix.."%]%S+") then
		nick = GetItemByName(nick)
		if curUser.iProfile == 1 and nick.iProfile == 2 then
			curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP, only master's and higer can kick this user") return 1
		end
	end
end

-- Block kick PM
function ToArrival(curUser, data)
	-- Find data...
	local _,_,To,From,Kicking = string.find(data, "$To:%s+(%S+)%s+From:%s(%S+)%s+$%S+%s+(You%s+are%s+being%s+kicked%s+because)")
	if string.find(To, "%["..ExVipPrefix.."%]%S+") and string.find(data, Kicking) then -- Get Prefix and Kicking msg
		kUser = GetItemByName(To)
		if kUser.iProfile == 2 and curUser.iProfile == 1 then -- if kUser is vip and curUser is Op
			return 1 -- Block msg
		end
	end
end

-- Send RightClicks
function NewUserConnected(curUser)
	if curUser.iProfile == 2 then
		if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") then
			-- Hub tab menu
			curUser:SendData("$UserCommand 1 2 " ..MenuName.. "\\Reg REG$<%[mynick]> !regreg %[nick] %[line:Password]&#124;")
			curUser:SendData("$UserCommand 1 2 " ..MenuName.. "\\Reg VIP$<%[mynick]> !regvip %[nick] %[line:Password]&#124;")
			-- User list menu
			curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !regreg %[line:Nick] %[line:Password]&#124;")
			curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg VIP$<%[mynick]> !regvip %[line:Nick] %[line:Password]&#124;")
		end
	end
end

function Send(Nick, Profile, curUser)
	TmpTable = {} -- Create table
	for _,oUser in frmHub:GetOnlineRegUsers() do -- Check all Regged online users
		if string.find(oUser.sName, "%["..ExVipPrefix.."%]%S+") then -- Find the prefix
			table.insert(TmpTable, oUser.sName) -- Add to table
		end
	end
	for i=1, table.getn(TmpTable) do -- Run through table
		SendToNick(TmpTable[i], "<"..frmHub:GetHubBotName().."> *** " ..curUser.sName.. " regged " ..Nick.. " as " ..Profile ) -- Send Msg
	end
	SendToOps(frmHub:GetHubBotName(), "*** " ..curUser.sName.. " regged " ..Nick.. " as " ..Profile) -- Send Msg to all ops
	TmpTable = nil -- Delete table
end


Done on request...
Added blocking of kick, if kicker is only Op
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Mikey

I can't get this to work. First prob is no RC shows secondly i need the reg command to be !addreguser.
Mikey

**Friends Unlimited Network**
    Network Founder

Madman

#2
Quote from: Mikey on 08 March, 2006, 23:54:51
I can't get this to work. First prob is no RC shows secondly i need the reg command to be !addreguser.

Changed the cmd, as 4 the RC, it only shows 4 VIP's with the prefix [ExVIP] as defult...

-- Extended VIP
-- Made by Madman, 08.03.06
-- Request by Mikey

-- Allows VIPs with right prefix to reg regs/vips in the hub
-- Block's Kicks from Ops...user can still be kicked by Higher profiles

-- Version 1.1
-- Removed: The reg cmd's
-- Added: A new reg cmd

ExVipPrefix = "ExVIP" -- Prefix of the Extended VIP profile, without [ and ] !
MenuName = "Extended VIP Menu" -- The name on the RightClick Menu

function ChatArrival(curUser, data)
	-- Block kicking msg from appering in main
	if string.find(data, "is%skicking") then -- Find this text
		if string.find(data, "%["..ExVipPrefix.."%]%S+") and curUser.iProfile == 1 then -- Check 4 prefix and Op
			return 1 -- Block Text
		end
	end
	-- The cmd part...
	local data = string.sub(data, 1, -2)
	local s,e,cmd = string.find(data, "%b<>%s+[%!%+%#%?](%S+)") -- Find cmds
	if cmd then -- Make sure we got a cmd
		local tCmds = {
		["addreguser"] = function(curUser, data)
			if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") and curUser.iProfile == 2 then -- Find the prefix and make sure user is VIP
				local s,e,nick,pass,pName = string.find(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)%s+(%S+)") -- Catch nick, pass and profilename
				if nick and pass and pName then -- If we got all 3
					local profile = GetProfileIdx(pName) -- Get profile number
					if GetProfileName(profile) == nil then -- The profilename was wrong
						curUser:SendData(frmHub:GetHubBotName(), "Invaild profilename!") return 1 -- Tell us
					end
					if frmHub:isNickRegged(nick) then -- Check if nick is regged allready
						curUser:SendData(frmHub:GetHubBotName(), nick.. " is allready regged") return 1
					end
					AddRegUser(nick, pass, profile)
					Send(nick, pName, curUser) return 1 -- Send this
				end
				curUser:SendData(frmHub:GetHubBotName(), "Syntax: !" ..cmd.. " <Nick> <Password> <profilename>") return 1 -- If we didn't find nick and/or pass
			end
		end,
		["kick"] = function(curUser, data) -- Block cmd kick
			local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)")
			nick = GetItemByName(nick)
			if string.find(nick.sName, "%["..ExVipPrefix.."%]%S+") and nick.iProfile == 2 then
				if curUser.iProfile == 1 then
					curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP, only master's and higer can kick this user") return 1
				end
			end
		end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](curUser, data)
		end
	end
end

function Send(Nick, Profile, curUser)
	TmpTable = {} -- Create table
	for _,oUser in frmHub:GetOnlineRegUsers() do -- Check all Regged online users
		if string.find(oUser.sName, "%["..ExVipPrefix.."%]%S+") then -- Find the prefix
			table.insert(TmpTable, oUser.sName) -- Add to table
		end
	end
	for i=1, table.getn(TmpTable) do -- Run through table
		SendToNick(TmpTable[i], "<"..frmHub:GetHubBotName().."> *** " ..curUser.sName.. " regged " ..Nick.. " as " ..Profile ) -- Send Msg
	end
	SendToOps(frmHub:GetHubBotName(), "*** " ..curUser.sName.. " regged " ..Nick.. " as " ..Profile) -- Send Msg to all ops
	TmpTable = nil -- Delete table
end

-- Block client kick
function KickArrival(curUser, data)
	local _,_,nick = string.find(data, "%S+%s+(%S+)|")
	if string.find(nick, "%["..ExVipPrefix.."%]%S+") then
		nick = GetItemByName(nick)
		if curUser.iProfile == 1 and nick.iProfile == 2 then
			curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP, only master's and higer can kick this user") return 1
		end
	end
end

-- Block kick PM
function ToArrival(curUser, data)
	-- Find data...
	local _,_,To,From,Kicking = string.find(data, "$To:%s+(%S+)%s+From:%s(%S+)%s+$%S+%s+(You%s+are%s+being%s+kicked%s+because)")
	if string.find(To, "%["..ExVipPrefix.."%]%S+") and string.find(data, Kicking) then -- Get Prefix and Kicking msg
		kUser = GetItemByName(To)
		if kUser.iProfile == 2 and curUser.iProfile == 1 then -- if kUser is vip and curUser is Op
			return 1 -- Block msg
		end
	end
end

-- Send RightClicks
function NewUserConnected(curUser)
	if curUser.iProfile == 2 then
		if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") then
			-- Hub tab menu
			curUser:SendData("$UserCommand 1 2 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[nick] %[line:Password] %[line:Profile]&#124;")
			-- User list menu
			curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[line:nick] %[line:Password] %[line:Profile]&#124;")
		end
	end
end
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Mikey

still no rightclick's?
Mikey

**Friends Unlimited Network**
    Network Founder

Madman

#4
Quote from: Mikey on 09 March, 2006, 01:20:33
still no rightclick's?

odd... I get them, are you connecting as VIP and with the right prefix?

Btw..noticed that the Right clicks are wrong...

-- Send RightClicks
function NewUserConnected(curUser)
	if curUser.iProfile == 2 then
		if string.find(curUser.sName, "%["..ExVipPrefix.."%]%S+") then
			-- Hub tab menu
			curUser:SendData("$UserCommand 1 2 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[nick] %[line:Password] %[line:Profile]&#124;")
			-- User list menu
			curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[line:nick] %[line:Password] %[line:Profile]&#124;")
		end
	end
end


Here's the new one...

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Mikey

I don't know whats wrong. I thought maybe it wasnt loading in the right place so i moved it around still nothing.
Mikey

**Friends Unlimited Network**
    Network Founder

Madman

Quote from: Mikey on 09 March, 2006, 04:34:54
I don't know whats wrong. I thought maybe it wasnt loading in the right place so i moved it around still nothing.

Neither do I, i do get the rightclicks. The things that can that so the RC don't show.
other scritps.
Accept user commands from hub, is unchecked.
You are not trieing to connect with a VP with the prefix, you set up as ExVipPrefix
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Psycho_Chihuahua

Mikey are you using BCDC++?

Cause BCDC++ don't like rightclicks or mucks them up.
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Mikey

Ok madman finally got this script to work. Now i want to know if you can make me a mod of it
  1. Remove the option to reg users.
  2. Can you make the script to where only certain users stated can kick the user?
Mikey

**Friends Unlimited Network**
    Network Founder

Madman

Quote from: Mikey on 17 March, 2006, 21:59:00
Ok madman finally got this script to work. Now i want to know if you can make me a mod of it
? 1. Remove the option to reg users.
? 2. Can you make the script to where only certain users stated can kick the user?

Yes, about 2...
Certain user of Op profile.. or users regardless profile... more info plese... ;)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Mikey

I want it set to where only certain op names can kick that user and no one but those added to the script
Mikey

**Friends Unlimited Network**
    Network Founder

Madman

-- Extended VIP
-- Made by Madman, 08.03.06
-- Request by Mikey

-- Allows VIPs with right prefix to reg regs/vips in the hub
-- Block's Kicks from Ops...user can still be kicked by Higher profiles

-- Version 1.1
-- Removed: The reg cmd's
-- Added: A new reg cmd

-- Version 1?
-- Re-Removed: the reg cmd
-- Removed: the rightclick
-- Added: CanKick table
-- Changed: The blocking code

CanKick = {
	"madman"
}

ExVipPrefix = "ExVIP" -- Prefix of the Extended VIP profile, without [ and ] !

function ChatArrival(curUser, data)
	-- Block kicking msg from appering in main
	if string.find(data, "is%skicking") then -- Find this text
		if string.find(data, "%["..ExVipPrefix.."%]%S+")  then -- Check 4 prefix
			CantKickUser = 1
			for I=1, table.getn(CanKick) do
				if CanKick[I] == string.lower(curUser.sName) then
					CantKickUser = nil
					break
				end
			end
			if CantKickUser then
				curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP") return 1
			end
			return 1 -- Block Text
		end
	end
	-- The cmd part...
	local data = string.sub(data, 1, -2)
	local s,e,cmd = string.find(data, "%b<>%s+[%!%+%#%?](%S+)") -- Find cmds
	if cmd then -- Make sure we got a cmd
		local tCmds = {
		["kick"] = function(curUser, data) -- Block cmd kick
			local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)")
			CantKickUser = 1
			nick = GetItemByName(nick)
			if string.find(nick.sName, "%["..ExVipPrefix.."%]%S+") and nick.iProfile == 2 then
				for I=1, table.getn(CanKick) do
					if CanKick[I] == string.lower(curUser.sName) then
						CantKickUser = nil
						break
					end
				end
				if CantKickUser then
					curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP") return 1
				end
			end
		end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](curUser, data)
		end
	end
end

-- Block client kick
function KickArrival(curUser, data)
	local _,_,nick = string.find(data, "%S+%s+(%S+)|")
	if string.find(nick, "%["..ExVipPrefix.."%]%S+") then
		CantKickUser = 1
		nick = GetItemByName(nick)
		if nick.iProfile == 2 then
			for I=1, table.getn(CanKick) do
				if CanKick[I] == string.lower(curUser.sName) then
					CantKickUser = nil
					break
				end
			end
			if CantKickUser then
				curUser:SendData(frmHub:GetHubBotName(), "Kick was blocked, user is a protected VIP") return 1
			end
		end
	end
end

-- Block kick PM
function ToArrival(curUser, data)
	-- Find data...
	local _,_,To,From,Kicking = string.find(data, "$To:%s+(%S+)%s+From:%s(%S+)%s+$%S+%s+(You%s+are%s+being%s+kicked%s+because)")
	if string.find(To, "%["..ExVipPrefix.."%]%S+") and string.find(data, Kicking) then -- Get Prefix and Kicking msg
		kUser = GetItemByName(To)
		if kUser.iProfile == 2 then
			CantKickUser = 1
			for I=1, table.getn(CanKick) do
				if CanKick[I] == string.lower(curUser.sName) then
					CantKickUser = nil
					break
				end
			end
			if CantKickUser then
				return 1 -- Block msg
			end
		end
	end
end


Untested...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk