Converted on request
Maybe somebody can have a use for it...
-- Master chat by Hawk
-- Lua5 Edition by Madman
-- Conversion requested by ???M
-- Added: ChatProfiles, Request by (-=TrIp-iN-SuN=-)
ChatProfiles = {
[0] = 1, -- Master
[1] = 0, -- Operator
[4] = 0, -- Moderator/Some other profile
[5] = 0, -- NetFounder/Another profile
}
MasterChatName = "master_chat"
function Main()
frmHub:RegBot(MasterChatName)
end
function ToArrival(user,data)
s,e,whoTo = string.find(data,"$To:%s+(%S+)")
if whoTo == MasterChatName then
if ChatProfiles[user.iProfile] == 1 then
s,e,whoTo,from,msg = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
MasterChatRoom(user,msg)
else
user:SendData("$To: "..user.sName.." From: "..MasterChatName.." $This Chat Is For Master ops only. Your message has not been sent")
end
end
end
function MasterChatRoom(user,msg)
local AllProfiles = GetProfiles()
local Index, Profile, Index2, Nick
for Index, Profile in AllProfiles do
local Users = GetUsersByProfile(Profile)
for Index2, Nick in Users do
local usr = GetItemByName(Nick)
if usr ~= nil then
if user.sName == usr.sName then
else
if ChatProfiles[usr.iProfile] == 1 then
usr:SendData("$To: "..usr.sName.." From: "..MasterChatName.." $<"..user.sName.."> " ..msg)
else
return 1
end
end
end
end
end
end
nice one ;)
bro i need NetFounder Can to talk in master chat to and i can't to do this i try to change every thing and it's not work or Only NetFounder can to talk or OnlY Masters i want in this chat masters and netfounder too u can to do same thing?
Done... Script updated...
Set the ChatProfiles as you wish..
tnx bro ;)
thats wath i was needing 2 :P
nice script madman...
Awsm script MadMAn!!!!!!!!!!!
--// Simple MasterChat by NightLitch 2005-03-05
--// Fixed bug with some profile not recieving chat - Samantha 15/10/2006
--// Added Leviathan support - Samantha 19/10/2006
MasterChatName = "?Admin-Chat?"
function Main()
frmHub:RegBot(MasterChatName)
end
function ToArrival(user,data)
local s,e,to,from,msg = string.find(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)%|")
if to == VipChatName then
if user.iProfile == 6 or user.iProfile == 5 or user.iProfile == 0 then
MasterChat(user,msg)
else
SendPmToNick(user.sName,MasterChatName, "*** You don't have the privileges to talk in this chat.")
return 1
end
end
end
function VipChat(user,msg)
for _,profile in pairs(GetProfiles()) do
for _,users in pairs(GetUsersByProfile(profile)) do
if GetItemByName(users) then
if GetItemByName(users).iProfile == 6 or GetItemByName(users).iProfile == 5 or GetItemByName(users).iProfile == 0 then
if GetItemByName(users).sName ~= user.sName then
GetItemByName(users):SendData("$To: "..GetItemByName(users).sName.." From: "..MasterChatName.." $<"..user.sName.."> "..msg)
end
end
end
end
end
end
try this and it works :)
Quote from: Samantha on 05 November, 2006, 03:15:17
--// Simple MasterChat by NightLitch 2005-03-05
--// Fixed bug with some profile not recieving chat - Samantha 15/10/2006
--// Added Leviathan support - Samantha 19/10/2006
MasterChatName = "?Admin-Chat?"
function Main()
frmHub:RegBot(MasterChatName)
end
function ToArrival(user,data)
local s,e,to,from,msg = string.find(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)%|")
if to == VipChatName then
if user.iProfile == 6 or user.iProfile == 5 or user.iProfile == 0 then
MasterChat(user,msg)
else
SendPmToNick(user.sName,MasterChatName, "*** You don't have the privileges to talk in this chat.")
return 1
end
end
end
function VipChat(user,msg)
for _,profile in pairs(GetProfiles()) do
for _,users in pairs(GetUsersByProfile(profile)) do
if GetItemByName(users) then
if GetItemByName(users).iProfile == 6 or GetItemByName(users).iProfile == 5 or GetItemByName(users).iProfile == 0 then
if GetItemByName(users).sName ~= user.sName then
GetItemByName(users):SendData("$To: "..GetItemByName(users).sName.." From: "..MasterChatName.." $<"..user.sName.."> "..msg)
end
end
end
end
end
end
try this and it works :)
Your post contain 2 errors:
if to == VipChatName then
and
MasterChat(user,msg)
This is correct post:
--// Simple MasterChat by NightLitch 2005-03-05
--// Fixed bug with some profile not recieving chat - Samantha 15/10/2006
--// Added Leviathan support - Samantha 19/10/2006
--// Fixed bug with some name of chat and function - 6Marilyn6Manson6 04/11/2006
MasterChatName = "?Admin-Chat?"
function Main()
frmHub:RegBot(MasterChatName)
end
function ToArrival(user,data)
local s,e,to,from,msg = string.find(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)%|")
if to == MasterChatName then
if user.iProfile == 6 or user.iProfile == 5 or user.iProfile == 0 then
MasterChat(user,msg)
else
SendPmToNick(user.sName,MasterChatName, "*** You don't have the privileges to talk in this chat.")
return 1
end
end
end
function MasterChat(user,msg)
for _,profile in pairs(GetProfiles()) do
for _,users in pairs(GetUsersByProfile(profile)) do
if GetItemByName(users) then
if GetItemByName(users).iProfile == 6 or GetItemByName(users).iProfile == 5 or GetItemByName(users).iProfile == 0 then
if GetItemByName(users).sName ~= user.sName then
GetItemByName(users):SendData("$To: "..GetItemByName(users).sName.." From: "..MasterChatName.." $<"..user.sName.."> "..msg)
end
end
end
end
end
end
This is ok :D