Author Topic: Master chat  (Read 7974 times)

0 Members and 1 Guest are viewing this topic.

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Master chat
« on: 03 August, 2005, 18:54:06 »
Converted on request
Maybe somebody can have a use for it...

Code: [Select]
-- 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
« Last Edit: 06 August, 2005, 14:19:02 by madman »
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

PtokaX forum

Master chat
« on: 03 August, 2005, 18:54:06 »

Offline ?Tr??T_????

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +0/-1
(No subject)
« Reply #1 on: 03 August, 2005, 23:30:03 »
nice one ;)

Offline (-=TrIp-iN-SuN=-)

  • Double Ace
  • *
  • Posts: 101
  • Karma: +0/-0
?
« Reply #2 on: 06 August, 2005, 05:23:27 »
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?
PsYDreaM-Land2.kicks-ass.net
PsYDreaM-Land2.no-ip.org

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #3 on: 06 August, 2005, 14:21:16 »
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

Offline (-=TrIp-iN-SuN=-)

  • Double Ace
  • *
  • Posts: 101
  • Karma: +0/-0
.
« Reply #4 on: 06 August, 2005, 16:46:39 »
tnx bro ;)
PsYDreaM-Land2.kicks-ass.net
PsYDreaM-Land2.no-ip.org

Offline ?Tr??T_????

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +0/-1
yebo
« Reply #5 on: 06 August, 2005, 17:41:02 »
thats wath i was needing 2 :P

Offline speedX

  • Lord
  • ***
  • Posts: 437
  • Karma: +59/-19
Re: Master chat
« Reply #6 on: 26 August, 2006, 20:58:03 »
nice script madman...
Thanking You,

speedX

Offline JueLz

  • Double Ace
  • *
  • Posts: 103
  • Karma: +8/-14
  • HT 500
Re: Master chat
« Reply #7 on: 26 August, 2006, 21:25:32 »
Awsm script MadMAn!!!!!!!!!!!
I am owner of the MzDistortion? Empire
the addy to my hub is mzdistortion.no-ip.org
____________________________________________
--=                        [HT 500]                          =--

Offline Samantha

  • Newbie
  • *
  • Posts: 7
  • Karma: +4/-0
Re: Master chat
« Reply #8 on: 05 November, 2006, 03:15:17 »
Code: [Select]
--// 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 :)
« Last Edit: 05 November, 2006, 03:19:25 by Samantha »

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
Re: Master chat
« Reply #9 on: 05 November, 2006, 08:42:57 »
Code: [Select]
--// 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:

Code: [Select]
if to == VipChatName then
and

Code: [Select]
MasterChat(user,msg)
This is correct post:

Code: [Select]
--// 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

PtokaX forum

Re: Master chat
« Reply #9 on: 05 November, 2006, 08:42:57 »