Hey guys, can someone please make a little script that welcomes registered users only(ex: profiles:registered,vip,op,master) in the kickbar and the message is seen by all users when a registered user enters hub.
thanks
/AI
Here is a script lua 5.1
--[[
Statbar Messages 1.0
Nillan 2007-03-06
Thnx CrazyGuy fo helping me as always :)
This will send login and kick/ban messages to the statbar for everyone to see
--]]
sBotName = ""
function Main()
sBotName = frmHub:GetHubBotName()
end
NewUserConnected = function(User)
if User.iProfile == -1 then
local sWelcome = "Welcome "..User.sName.." , nice to have you here is kicking because:"
SendToAll(sBotName ,sWelcome)
else
local sOPWelcome = "Welcome "..GetProfileName(User.iProfile).." "..User.sName.." nice to have you back is kicking because:"
SendToAll(sBotName ,sOPWelcome)
end
return 1
end
OpConnected = NewUserConnected
function ChatArrival(User, Data)
if User.iProfile >= 0 then
local _,_,sCmd,sWhat = string.find(Data, "%b<>%s%p(%S+)%s(.*)|")
if (sCmd == "drop") then
local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
if sWhy == nil then
sWho = sWhat
sWhy = "No reason given"
end
local sKickMessage = "User "..sWho.." was removed by: "..User.sName.." because: "..sWhy.." is kicking because:"
SendToAll(sBotName ,sKickMessage)
elseif sCmd and string.find(sCmd, "ban") then
local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
if sWhy == nil then
sWho = sWhat
sWhy = "No reason given"
end
local sKickMessage = "User "..sWho.." was kicked and banned by: "..User.sName.." because: "..sWhy.." is kicking because:"
SendToAll(sBotName ,sKickMessage)
end
end
end
function ToArrival(User, Data)
if User.iProfile >= 0 then
local _,_,sTo,sPM = string.find(Data, "To%:%s(%S+)%sFrom%:%s%S+%s%$%b<>%s(.*)|")
if sTo == sBotName then
-- command is sent to Bot
local _,_,sCmd,sWhat = string.find(sPM, "%p(%S+)%s(.*)")
if (sCmd == "drop") then
local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
if sWhy == nil then
sWho = sWhat
sWhy = "No reason given"
end
local sKickMessage = "User "..sWho.." was kicked by: "..User.sName.." because: "..sWhy.." is kicking because:"
SendToAll(sBotName ,sKickMessage)
elseif string.find(sCmd, "ban") then
local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
if sWhy == nil then
sWho = sWhat
sWhy = "No reason given"
end
local sKickMessage = "User "..sWho.." was kicked and banned by: "..User.sName.." because: "..sWhy.." is kicking because:"
SendToAll(sBotName ,sKickMessage)
end
end
end
end
Mr.T please use the "code" tags to post any code.
where is the code tag cant find it
:)
[ code ] opens [ / code ] closes
remove spaces between [ & code
Thank you guys ,the script works great