PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: DarkElf on 29 February, 2004, 16:54:10

Title: VIP commands
Post by: DarkElf on 29 February, 2004, 16:54:10
Hi, i need a simple script wich give some commands to VIP users..

the commands are: mass message, kick (5min ban), disconnect, and if possible the vipchat

thanks :D
Title:
Post by: nErBoS on 29 February, 2004, 19:45:26
Hi,

Hope it helps...

--Requested by DarkElf
--Made by nErBoS

Bot = "VIP-Script"

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)

end

function DataArrival(user, data)

if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!mm") then
if (user.iProfile == 2 or user.bOperator) then
local s,e,msg = strfind(data,"%b<>%s+%S+%s+(.*)")
if (msg == nil or msg == "") then
user:SendPM(Bot, "Syntax error, !mm , must write a message.")
else
SendPmToAll(Bot, msg)
end
else
user:SendPM(Bot, "You don't have permission to use this command.")
end
return 1
elseif(cmd=="!vipkick") then
if (user.iProfile == 2 or user.bOperator) then
local s,e,kicked,reason = strfind(data,"%b<>%s+%S+%s+(%S+)%s+(.*)")
if (kicked == nil) then
user:SendPM(Bot, "Syntax error, !vipkick , must have a nick to kicked.")
else
if(GetItemByName(kicked) == nil) then
user:SendPM(Bot, "There isn't any user with the nick "..kicked.." online.")
else
local usr = GetItemByName(kicked)
if (reason == nil) then
user:SendPM(Bot, "Syntax error, !vipkick , must have a reason.")
else
if(usr.bOperator) then
user:SendPM(Bot, "You can't kick a Operator.")
else
SendToAll(Bot, user.sName" has kicked "..usr.sName.." because: "..reason)
usr:SendPm(Bot, "You have been kicked because: "..reason)
usr:TimeBan(5)
end
end
end
end
else
user:SendPM(Bot, "You don't have permission to use this command.")
end
return 1
elseif(cmd=="!vipdct") then
if (user.iProfile == 2 or user.bOperator) then
local s,e,whoto,reason = strfind(data,"%b<>%s+%S+%s+(%S+)%s+(.*)")
if (kicked == nil) then
user:SendPM(Bot, "Syntax error, !vipdct , must have a nick to disconnect.")
else
if(GetItemByName(whoto) == nil) then
user:SendPM(Bot, "There isn't any user with the nick "..kicked.." online.")
else
local usr = GetItemByName(whoto)
if (reason == nil) then
user:SendPM(Bot, "Syntax error, !vipdct , must have a reason.")
else
if(usr.bOperator) then
user:SendPM(Bot, "You can't disconnect a Operator.")
else
SendToAll(Bot, user.sName" has disconnected "..usr.sName.." because: "..reason)
usr:SendPm(Bot, "You have been disconnected because: "..reason)
usr:Disconnect()
end
end
end
end
else
user:SendPM(Bot, "You don't have permission to use this command.")
end
return 1
end
end
end

About the VIP-Chat make a search in the forum and you will find one.

Best regards, nErBoS
Title:
Post by: BlazeXxX on 01 March, 2004, 02:24:47
Would this clash in with robocop script ? because i want to give some special function to VIPs, but would this kick function mess up the security of the hub?
Title:
Post by: nErBoS on 01 March, 2004, 02:40:30
Hi,

If the commands have the same name and prefix it will create conflicts, if not there is no problem i think.

About securtiy the kick doesn?t let vips kick any kind of op but the others does.

Best regards, nErBoS