Help whit - Vip-Chat!
 

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

Help whit - Vip-Chat!

Started by WickeD, 21 January, 2004, 14:16:54

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WickeD

Can any one help me write this script so only Vip can write in the chat and not Master, OP, Reg, User!  Master, OP, Reg, User will get this massage if eny of them try to write in the chat:  "This chat is for Hub-Vip only. Your message has not been sent."


Help my plz!

//WickeD

WickeD

------------------------------------------------------------------------
-- Editor: R?P?FF?
-- Network:?In?a??? ??tw??x? An ?nd?rGr?und? ??tw??k Subnet
--
-- Request by Peter
--
-- Edits by R?P?FF? & klownietklowniet
--
-- A VIP and Higher chat
-- 02-09-2003: klownietklowniet changed the script abit so all (VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
-- 19-10-2003: R?P?FF? added the (Reg) & (SuperOp) profile in it so now regs & sops are included in script.
-- 19-10-2003: klownietklowniet added a message so when non reg users pm it, it will respond and act on the message
-- "This chat is for registered users only. Your message has not been sent." (Request by R?P?FF?)


BotName = "[NorthSide]?Vip-Chat?"


function Main()
frmHub:RegBot(BotName)
end


function DataArrival(curUser,data)

local MessageRecognized = 0

if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end

if MessageRecognized==1 and whoto==BotName then
if (curUser.iProfile>=0 and curUser.iProfile<=4) then
local vips=GetUsersByProfile("VIP")

for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
else
curUser:SendPM(BotName, "This chat is for Hub-Vip only. Your message has not been sent.")
end
end
end


function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end


function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end

----------------------------------------------------------

//WickeD

SaintSinner

#2
try this
I hope your Vip profile # is default
i modified the Mastersonlychat script im learning on
i just removed the masters and ops from the table and added the vips, and added the message you wanted.
my Vips can chat without anyone else seeing it,


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


function Main()
	VipChat = "VipChat"
	frmHub:RegBot(VipChat)
end


Levels= { [4]=0, }
------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == VipChat 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:SendData(VipChat, "That chat is for Hub-Vip only. 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: "..VipChat.." $<"..user.sName.."> " ..msg)


					end
				end
			end
		end
	end
end
 

plop, phatty, NL, did i go in the right direction, can you see anything wrong.
   


????L?F??

you made two threads? and again, i personally wouldnt use a script by ripoff ^^
Whos ya daddy  :]

WickeD

Thx!...SaintSinner.  =)        And sorry ????L?F???? !  =(

//WickeD

WickeD

Gr8 script m8!  =)


Plz can you help me whit this to?

The massage: That chat is for Hub-Vip only. Your message has not been sent.... show?s in mainchat....can you write the script so the massage show?s in Vipchat window?

And make a same script but only for OP, Master?

I dont wont OP, Master to speak in to same chat as Vip are!

//WickeD

????L?F??

well maby the scipts attitude is better then ripoffs

kinda glad he left ^^ he was such a hassel
Whos ya daddy  :]

SaintSinner

QuoteOriginally posted by WickeD
Gr8 script m8!  =)


Plz can you help me whit this to?

The massage: That chat is for Hub-Vip only. Your message has not been sent.... show?s in mainchat....can you write the script so the massage show?s in Vipchat window?

And make a same script but only for OP, Master?

I dont wont OP, Master to speak in to same chat as Vip are!

//WickeD

no problem i am happy to help,
thanks should go to plop, phatty, nightlitch for the help.
give me a few min to fix it, it should be easy for the other ones you want, should be just a copy and paste thing, can you post your profiles.dat.
   


WickeD

It this what you want SaintSinner?

0|Master|11111111111111111111000000000000
1|Operator|11111111111111111111000000000000
2|VIP|10000000000000000000000000000000
3|Reg|10000000000000000000000000000000

If not! Can you tell me were i can get my profiles.dat?

//WickeD

SaintSinner

yup thats it,
ok so your vip index level is 2

here is the fixed vip with the pm in the vipchat


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




function Main()
	VipChat = "VipChat"
	frmHub:RegBot(VipChat)
end
Levels= { [2]=0, }
------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == VipChat 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(VipChat, "That chat is for Hub-Vip only. 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: "..VipChat.." $<"..user.sName.."> " ..msg)


					end
				end
			end
		end
	end
end
   


WickeD

Script for only OP, Master? Can you help me whit that to?  =)  


//WickeD

SaintSinner

#11
do you want op and master chat or two seperate opchat and masterchat?
   


plop

QuoteOriginally posted by SaintSinner
plop, phatty, NL, did i go in the right direction, can you see anything wrong.
this:
elseif Levels[user.iProfile] == nil then
can be replaced for:
else

thats all, got some idea's for you but i'll post that in the other thread.
it's of no use here.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

WickeD

I want two seperate script! If it is ok whit you?


//WickeD

SaintSinner

#14
here is the master one



-- Master-Chat
-- 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.
-- chat for Masters with profile



function Main()
	OPCHAT = "OP_MChat"
	frmHub:RegBot(OPCHAT)
end
Levels= { [0]=0, }


------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == OPCHAT 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(OP_MChat, "That chat is for Hub-Masters only. 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: "..OPCHAT.." $<"..user.sName.."> " ..msg)

					end
				end
			end
		end
	end
end
   


WickeD

Gr8!!!  =)   And the OP-Chat.....  =)


//WickeD

SaintSinner

QuoteOriginally posted by WickeD
Gr8!!!  =)   And the OP-Chat.....  =)


//WickeD


im testing it
   


WickeD

Gr8 m8!!!   =)

NightLitch

Well if both scripts above work for you Wicked is suggest
you learn a few small things...

SaintSinner is just changing:


For Masters ONLY
Levels= { [0]=0, }

For Masters & OPs ONLY
Levels= { [0]=0,[1]=0,}

For VIP's ONLY
Levels= { [2]=0,}

For REGS's ONLY
Levels= { [3]=0,}

hope you understand.

real simple actually, you can just copy the first code 3 times

and changing to above lines... If you understand me.
Have a bad habbit not getting myself understand sometimes... :-P
//NL

WickeD

Thx m8!  =)


//WickeD

SaintSinner

ok i fixed some things with the OP one not sending
the messages, here you go the master one first:


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




function Main()
	MChat = "MChat"
	frmHub:RegBot(MChat)
end
Levels= { [0]=0, }


------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == MChat 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(MChat, "That chat is for Hub-Masters only. 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: "..MChat.." $<"..user.sName.."> " ..msg)

					end
				end
			end
		end
	end
end
   


SaintSinner

#21
the opchat one, its fixed now
had a little problem with the pm not being sent
make sure you have the ptokax internal opchat off.


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



function Main()
	OpChat = "OpChat"
	frmHub:RegBot(OpChat)
end
Levels= { [1]=0, }
------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == OpChat 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(OpChat, "That chat is for Hub-Ops only. 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: "..OpChat.." $<"..user.sName.."> " ..msg)


					end
				end
			end
		end
	end
end
   


SaintSinner

and the vip one




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




function Main()
	VipChat = "VipChat"
	frmHub:RegBot(VipChat)
end
Levels= { [2]=0, }
------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == VipChat 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(VipChat, "That chat is for Hub-Vip only. 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: "..VipChat.." $<"..user.sName.."> " ..msg)


					end
				end
			end
		end
	end
end
   


WickeD

Thx m8!!! x 1000!!!!  =)

//WickeD

NightLitch

Just a little pointer... Shouldn't "Operators" Ops & Master be able to chat in OP-Chat???

Simple solusion for the OP-Chat is this to:

by deleting:

Levels= { [2]=0, }

and changing:

if Levels[user.iProfile] then

to

if user.bOperator then

this will be as the Op-Chat is in Hubsoft...

But maybe I have not understand the meaning... Maybe
you wanted "OPs" to have thier own without Masters and
vice versa.

Don't mean any harm here now. :-) smile for the learning.

Have a good one ya all.
//NL

SMF spam blocked by CleanTalk