Master chat
 

News:

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

Master chat

Started by Madman, 03 August, 2005, 18:54:06

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Madman

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
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

?Tr??T_????


(-=TrIp-iN-SuN=-)

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?

Madman

Done... Script updated...
Set the ChatProfiles as you wish..
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p


?Tr??T_????

thats wath i was needing 2 :P

speedX

nice script madman...
Thanking You,

speedX

JueLz

Awsm script MadMAn!!!!!!!!!!!
I am owner of the MzDistortion? Empire
the addy to my hub is mzdistortion.no-ip.org
____________________________________________
--=                        [HT 500]                          =--

Samantha

#8
--// 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 :)

6Marilyn6Manson6

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

SMF spam blocked by CleanTalk