-- 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]|")
curUser:SendData("$UserCommand 1 2 " ..MenuName.. "\\Reg VIP$<%[mynick]> !regvip %[nick] %[line:Password]|")
-- User list menu
curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !regreg %[line:Nick] %[line:Password]|")
curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg VIP$<%[mynick]> !regvip %[line:Nick] %[line:Password]|")
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
I can't get this to work. First prob is no RC shows secondly i need the reg command to be !addreguser.
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]|")
-- User list menu
curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[line:nick] %[line:Password] %[line:Profile]|")
end
end
end
still no rightclick's?
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]|")
-- User list menu
curUser:SendData("$UserCommand 1 1 " ..MenuName.. "\\Reg REG$<%[mynick]> !addreguser %[line:nick] %[line:Password] %[line:Profile]|")
end
end
end
Here's the new one...
I don't know whats wrong. I thought maybe it wasnt loading in the right place so i moved it around still nothing.
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
Mikey are you using BCDC++?
Cause BCDC++ don't like rightclicks or mucks them up.
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?
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... ;)
I want it set to where only certain op names can kick that user and no one but those added to the script
-- 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...