fix in chat roomBoT?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
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

fix in chat roomBoT?

Started by D-J Valhala, 22 May, 2004, 19:04:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

D-J Valhala

i moddefide it to ONLY VIP's and Higher Level can chat in there but why REG users can see the chat?
can some one make it that the chat-room pop-up ONLY to VIP's And Higher level?

-- 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.




function Main()
ChatRoom = "-=<[ViP_-_ChaT]>=-"
frmHub:RegBot(ChatRoom)
end
Levels= { [0]=0,[1]=0,[2]=0,[4]=0,[5]=0,[6]=0}
------------------
-- Data Arrival --
------------------

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] 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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.")

end
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 Levels[user.iProfile] then
usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg)


end
end
end
end
end
end
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Done...

-- 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. 
-- Hide Bot only to accept Users by nErBoS


ChatRoom = "-=<[ViP_-_ChaT]>=-" 

info_chat = "$MyINFO $ALL "..ChatRoom.."    $ $Cable"..strchar( 1 ).."$$0|$"

Levels = { [0]=0,[1]=0,[2]=0,[4]=0,[5]=0,[6]=0} 

function Main()
	frmHub:EnableFullData(1)
end

function NewUserConnected(user, data)
	if (AcceptProfile(user) == 1) then
		user:SendData(info_chat)
	end
end

OpConnected = NewUserConnected

function DataArrival(user,data)
	if (strsub(data,1,12) == "$GetNickList") then
 		if (AcceptProfile(user) == 1) then
			user:SendData(info_chat)
		end
	end

	if(strsub(data,1,4) == "$To:") then 
		s,e,whoTo = strfind(data,"$To:%s+(%S+)") 
		if whoTo == ChatRoom then 
			if Levels[user.iProfile] 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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.") 
			end 
		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 Levels[user.iProfile] then 
						usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg) 

					end 
				end 
			end 
		end 
	end 
end

function AcceptProfile(user)
	local accept = 0
	local level,aux
	for level, aux in Levels do
		if (user.iProfile == level) then
			accept = 1
			break
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

nope not working... the BoT is not in the hub i can't see it...
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Improved and fixed...

-- 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. 
-- Hide Bot only show to iProfile from table, by nErBoS


ChatRoom = "Chat" 

info_chat = "$MyINFO $ALL "..ChatRoom.."  $ $Cable"..strchar( 1 ).."$$0$|"

Levels = {
	[0]=0,	--Master
	[1]=0,	--Operator
	[2]=0,	--Vip
	[4]=0,	--UnKnwon
	[5]=0,	--UnKnwon
	[6]=0	--UnKnwon
} 

function Main()
	frmHub:EnableFullData(1)
end

function NewUserConnected(user)
	if (Levels[user.iProfile] ~= nil) then
		user:SendData(info_chat)
	end
end

OpConnected = NewUserConnected

function DataArrival(user,data)
	if (strsub(data,1,12) == "$GetNickList") then
 		if (Levels[user.iProfile] ~= nil) then
			user:SendData(info_chat)
		end
	end

	if(strsub(data,1,4) == "$To:") then 
		s,e,whoTo = strfind(data,"$To:%s+(%S+)") 
		if whoTo == ChatRoom then 
			if Levels[user.iProfile] 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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.") 
			end 
		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 Levels[user.iProfile] then 
						usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg) 

					end 
				end 
			end 
		end 
	end 
end

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

#4
nice man very nice :)
but...
i wanna it to be OPBoT ond to show all the BoT if you can :)
and REG user are geting PM's From The BoT In Main...
Private message from Chat: fdxb
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

#5
Hi,

About PMing other users I thing its resolved...

-- 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. 
-- Hide Bot only show to iProfile from table, by nErBoS
-- Some Correction by nErBoS


ChatRoom = "Chat" 

info_chat = "$MyINFO $ALL "..ChatRoom.."  $ $Cable"..strchar( 1 ).."$$0$|"

Levels = {
	[0]=0,	--Master
	[1]=0,	--Operator
	[2]=0,	--Vip
	[4]=0,	--UnKnwon
	[5]=0,	--UnKnwon
	[6]=0	--UnKnwon
} 

function Main()
	frmHub:EnableFullData(1)
end

function NewUserConnected(user)
	if (Levels[user.iProfile] ~= nil) then
		user:SendData(info_chat)
	end
end

OpConnected = NewUserConnected

function DataArrival(user,data)
	if (strsub(data,1,12) == "$GetNickList") then
 		if (Levels[user.iProfile] ~= nil) then
			user:SendData(info_chat)
		end
	end

	if(strsub(data,1,4) == "$To:") then 
		s,e,whoTo = strfind(data,"$To:%s+(%S+)") 
		if whoTo == ChatRoom then 
			if Levels[user.iProfile] 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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.") 
			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 
						if Levels[user.iProfile] then 
							usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg) 
						end 
					end 
				end 
			end
		end 
	end 
end

About the Bot appear as an OP you must register him as a OP on your ptokax.

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

steel Only ViP can see the bot and BTW it was an OP-Chat-Bot
you maybe change it to be user :)
here is the scrit is Op-Chat-Bot

-- 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.




function Main()
ChatRoom = "ChatRoom"
frmHub:RegBot(ChatRoom)
end
Levels= { [0]=0,[1]=0,[2]=0,[4]=0,[5]=0,[6]=0}
------------------
-- Data Arrival --
------------------

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] 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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.")

end
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 Levels[user.iProfile] then
usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg)


end
end
end
end
end
end
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Your request was to hide the BOT to users who don't have permission to talk, right ?? The Bot is show to everyone else.

About the BOT appear to be an op is not possible because to send fake info its not possible to send info as an OP.

I have tested the BOT and is working ok.

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

nope i wanted it to stop pop-up to NonViP's
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

You want only the script to popup to VIPs ???

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

yes i want it to pop-up to ViP and higher level but all can see it and it OP-BOT
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Ok i have understood bad your request, try this one...

-- 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

ChatRoom = "Chat" 

Levels = {
	[0]=0,	--Master
	[1]=0,	--Operator
	[2]=0,	--Vip
} 

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, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.") 
			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

All Vips and Higher level can talk, The Bot is seen by everyone has a OP, and the chat is only seen be Vips and higher level.

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

Work PERFECT! :)))))))))))))))
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

SMF spam blocked by CleanTalk