Chatrooms v3 (tezlo) LUA 5 - Page 3
 

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

Chatrooms v3 (tezlo) LUA 5

Started by jiten, 02 March, 2005, 19:58:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kunal

i also cant close rooms and pls keep a nick check for these rooms coz while inviting someone if i make a error
eg if i mispell  !invite testing as !invite testnig it invites testnig and it appears as a member and cant remove it also coz the remove cmd doesnt work ;(

Dessamator

u obviously did something wrong, it should work !
Ignorance is Bliss.

jiten

QuoteOriginally posted by kash?
still I can't close rooms created by
registered users even being master :((
Second script updated.

Cheers

Dessamator

change this in the script

tCmds = {
	MakeChat = "mkchat",
	Away = "away",
	Leave = "leave",
	Members = "members",
	Invite = "invite",
	Remove = "remove",
	DelChat = "delchat",
         Joinroom = "joinroom"
}


and this
ChatArrival = function(user, data)
	local s, e, cmd, args = string.find(data, "^%b<> %!(%a+)%s*(.*)|$")
	if cmd == tCmds.MakeChat and user.bOperator then
		local s, e, name, profiles = string.find(args, "(%S+)%s*(.*)")
		if not s then
			user:SendData(">> Syntax: !mkchat  [groups]")
		elseif chatrooms.items[name] then	
			user:SendData(">> "..name.." is already a Chatroom.")
		elseif GetItemByName(name) then
			user:SendData(">> There is a user with that name")
		else
			if tKey == 1 then frmHub:RegBot(sTag..name) else frmHub:RegBot(sTag..name,0,"","") end
			local tmp = chatrooms:new(sTag..name, user.sName)
			string.gsub(profiles, "(%S+)", function(profile)
				profile = tonumber(profile) or GetProfileIdx(profile)
				if GetProfileName(profile) then tmp.groups[profile] = 1 end
			end); tmp:chat("Hello", sTag..name)
			chatrooms:save()
			return 1
		end
	elseif cmd== tCmds.Joinroom then
		user:SendPM(args,"hello")
		return 1
	end
end


as for putting it horizontally, i see no advantage of that !
it works fine as is !
Ignorance is Bliss.

kEwL

where to add the 2 nd one

kEwL

got it m8
but i think horizontal one will look better and will be more suitable for finding the required person

kEwL

#56
also when i restart scripts all the chatrooms pop up to all users in the chatrooms saying hello so think if i m in 10 rooms it pops up 10 windows and for no reason

Dessamator

#57
how often do u restart the scripts?

either way ,change this :

load = function(self)
		self.items = dofile("logs/chatrooms.tbl") or {}
		for name, room in self.items do
			if tKey == 1 then frmHub:RegBot(name) else frmHub:RegBot(name,0,"","") end
			room.chat = botchat
			room:chat("Hello", name)
		end
	end,

to this
load = function(self)
		self.items = dofile("logs/chatrooms.tbl") or {}
		for name, room in self.items do
			if tKey == 1 then frmHub:RegBot(name) else frmHub:RegBot(name,0,"","") end
			room.chat = botchat
		end
         end,
Ignorance is Bliss.


kunal

#59
;(   ;(  ;(  ;(  ;(
no one seems to help me

Dessamator

find this part of the script and change  this :

elseif cmd == tCmds.Members then
local n, na, msg = 0, 0
for nick, stat in tmp.members do
if not GetItemByName(nick) then msg = " (offline)"
elseif stat == 0 then msg = " (away)"
else msg, na = "", na+1
end; n = n+1
user:SendPM(to, "\t"..nick..msg)
end; user:SendPM(to, na.."/"..n.." active members.")


to this :


elseif cmd == tCmds.Members then
				local n, na, msg,offline,away,on = 0, 0,"","Offline --> ","Away --> ", "Online --> "
				for nick, stat in tmp.members do
					if not GetItemByName(nick) then offline = offline..nick.."  "
					elseif stat == 0 then away = away..nick.."  "
					else msg, na = "", na+1
					on = on..nick.."  "
					end; n = n+1
				end; 
				user:SendPM(to, "\r\n"..on.."\r\n"..offline.."\r\n"..away.."\r\n"..na.."/"..n.." active members.")
Ignorance is Bliss.


kash?

#62
many reg users create room as !mkchat ABCD
without mentioning profile like !mkchat ABCD reg
because of this other users can't join the room
As a result, there are many rooms with just
room owner and ops and other users are not able to join rooms

- You're not a member here.
- hh
- You're not a member here.
- hh


I wanted to have cmd as !mkchat ABCD where
other users can join without mentioning their profile
[no need to mention any profile]

In short let anybody create room, all users should be
able to join

PLZ reply...quite major problem

HairBear

Hi m8 !

Is there any way  to limit chat creation and invite only for masters ?

I want to create a chat only for master profile not for all Operators.

Thx !!!

Dessamator

Quote!mkchat Masterchat master
Ignorance is Bliss.

HairBear

QuoteOriginally posted by Dessamator
Quote!mkchat Masterchat master

Thx for reply.
I tryed this way but operators too can join without invite.
 ?(

Dessamator

if not tmp.members[user.sName] then
[COLOR=skyblue]if user.bOperator or tmp.groups[user.iProfile] == 1 then[/COLOR] 
tmp.members[user.sName] = 1
tmp:chat(user.sName.." joined", to)
tmp:chat(str, user.sName)
chatrooms:save()
else
user:SendPM(to, "You're not a member here.")
end
else


change the line in blue to this :

if  tmp.groups[user.iProfile] == 1 then


btw if or when u do that, each chatroom will be restricted to its profile, regs can only chat with regs and masters only with masters.
Ignorance is Bliss.

HairBear

Thanks Dessamator  !!!!!!!!!
It worked !!!!
It's really what I needed.

  :D  :D  :D

Dessamator

Ignorance is Bliss.

enigma

i used second script.
jus pasted it from here in my ptokax script editor.saved it thn restarted scripts.thn got error in ptokax
[03:46] Syntax cannot read logs/chatrooms.tbl: No such file or directory
thn i reconected my hub, with help of right click created room
!mkchat Exatt
room was not created
i got error in ptokax
[03:47] Syntax C:\HUB\0.3.3.21.9X.DBG\scripts\chatrooms.lua:40: attempt to index field `items' (a nil value)

script not working this end mate
i want to use this script
please some1 help.

using windows 98 se

anyways im dkt a reged user here but i lost my password here..and i donno how to recover it..tats y created another account here as enigma.pls some1 help

kunal

i want all ops to be able to remove users from any chatrooms.Now only the owner of the room can remove users in the rooms

Dessamator

change this :

elseif cmd == "remove" and isowner then
string.gsub(args, "(%S+)", function(nick)
if tmp.members[nick] and nick ~= tmp.owner then
tmp:chat(nick.." has been removed from the room", to)
tmp.members[nick] = nil
end
end); chatrooms:save()


to this :

elseif cmd == "remove" and user.bOperator  or isowner then
string.gsub(args, "(%S+)", function(nick)
if tmp.members[nick] and nick ~= tmp.owner then
tmp:chat(nick.." has been removed from the room", to)
tmp.members[nick] = nil
end
end); chatrooms:save()
Ignorance is Bliss.

kunal

can anyone modify the script so that the name of the owner appears in the description of the chatroom

front242

how add ability to some non-op profiles that they could removing and inviting users

need distribution of the rights by profile names or profile numbers

sorry my bad english

Dessamator

That question has already been answered, read the previous posts .
Ignorance is Bliss.

SMF spam blocked by CleanTalk