Anyone ?
In need of a standalone OpChat script to solve kick/ban messge in RCv9b for the time being.
Ps , search thru lua but with out sucess. Ds.
G8
try this ;)...
-- Chat-Room
-- Original VipChat v1.0
-- By Guibs 10/11/2003
-- Enjoy :)
-- Simple Modify by NightLitch
-- to Master Bot Only
-- Simple Mod by SaintSinner thanks to phatty and plop and NL for the hints.
-- Simple Modify by WickeD to ChatRoom for User/Reg/Vip/Moderator/Op/Admin/Master.
-- Little Fix by nErBoS
-- Simple Modify by WickeD to ChatRoom for All Kye Users by DJ-Valhala ;)
ChatRoom = "-OP-Chat-"
info_chat = "$MyINFO $ALL "..ChatRoom.." $ $Cable"..strchar( 1 ).."$$0$|"
Levels = {
[0]=0,--Master
[1]=0,--Operator
}
function Main()
frmHub:RegBot(ChatRoom)
end
function DataArrival(user,data)
if(strsub(data,1,4) == "$To:") then
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (whoTo == ChatRoom) then
if (Levels[user.iProfile] ~= nil) then
s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
MasterChatRoom(user,msg)
elseif (Levels[user.iProfile] == nil) then
user:SendPM(ChatRoom, "That chat is for, OP's And Higher Level!")
end
end
end
end
function MasterChatRoom(user,msg)
local allprofiles = GetProfiles()
local index, profile, index2, nick
for index, profile in allprofiles do
if (Levels[GetProfileIdx(profile)] ~= nil) then
local users = GetUsersByProfile(profile)
for index2, nick in users do
local usr = GetItemByName(nick)
if usr ~= nil then
if user.sName ~= usr.sName then
usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg)
end
end
end
end
end
end
if you have added new profiles to your Ptokax and you like the profile to use op-chat please add to the script your profile and profilename like this...
Levels = {
[0]=0,--Master
[1]=0,--Operator
[4]=0,--SuperOp
}
in my ptokax 4 = SuperOp hope i helpd ya ;)
Just back from work
Tks D-J will give it a go...
G8
:D
:D
That solved the problem with RCv9a+b GUI kick/ban messeges to Ptx GUI Op-Chat .
Recommend it to all.
Disable and delete Op-Chat in PTx GUI and add the script -Op-Chat- below to ur script folder instead.
Now My ?OpChat? is running clean and all Kick/Bans are sent to my Master bot as it should.
Tks again D-J
G8 Give ya a BIG :D
Credits to Guibs=NightLitch=SaintSinner phatty and plop and NL AND D-J Valhala for posting a copy for me.
-- Chat-Room
-- Original VipChat v1.0
-- By Guibs 10/11/2003
-- Enjoy :)
-- Simple Modify by NightLitch
-- to Master Bot Only
-- Simple Mod by SaintSinner thanks to phatty and plop and NL for the hints.
-- Simple Modify by WickeD to ChatRoom for User/Reg/Vip/Moderator/Op/Admin/Master.
-- Little Fix by nErBoS
-- Simple Modify by WickeD to ChatRoom for All Kye Users by DJ-Valhala ;)
ChatRoom = "-OP-Chat-"
info_chat = "$MyINFO $ALL "..ChatRoom.." $ $Cable"..strchar( 1 ).."$$0$|"
Levels = {
[0]=0,--Master
[1]=0,--Operator
}
function Main()
frmHub:RegBot(ChatRoom)
end
function DataArrival(user,data)
if(strsub(data,1,4) == "$To:") then
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (whoTo == ChatRoom) then
if (Levels[user.iProfile] ~= nil) then
s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
MasterChatRoom(user,msg)
elseif (Levels[user.iProfile] == nil) then
user:SendPM(ChatRoom, "That chat is for, OP's And Higher Level!")
end
end
end
end
function MasterChatRoom(user,msg)
local allprofiles = GetProfiles()
local index, profile, index2, nick
for index, profile in allprofiles do
if (Levels[GetProfileIdx(profile)] ~= nil) then
local users = GetUsersByProfile(profile)
for index2, nick in users do
local usr = GetItemByName(nick)
if usr ~= nil then
if user.sName ~= usr.sName then
usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg)
end
end
end
end
end
end
:D :P