Block User PM to Reg User
 

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

Block User PM to Reg User

Started by Jorgesc, 20 October, 2004, 19:12:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jorgesc

Hola a todos, necesito un script que bloquee los PM de usuarios a Usuarios registrados.
Pero que permita el envio de PM a OP's y VIP's.
-----------------------------------------------------------------------
Hello, I need script that blocks the p.m. of users to registered Users.
But that allows to send of p.m. to OP's and VIP's.

Gracias / Thanks


bastya_elvtars

are you using the standard profiles?
Everything could have been anything else and it would have just as much meaning.

Jorgesc

Thanks mens.

Now:

How I can allow PM to unregistered user From OP and VIP.   ?(

Thanks again.   :D

Jorgesc

QuoteOriginally posted by Mutor
any profile that = 1 may send pm's

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

set that part per your need.

I know that. But my cuestion is:  How I can allow to Unreg Users send PM to OP and VIP.

 ?(

Thanks

Jorgesc

Hi Hi Hi.

Me too use RC-8.0, but I install this script and does not allow me to send p.m. to the Masters.

This is the config of the script:

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

This is the message send of User to Master:

Hi
<(Master)--xxxxx> BOT ***Private Message blocked. You are not alowed to PM (Master)--xxxxx

Pls, help me.   8)

UwV

#5
--PM Filter 1.0
--by Mutor
--
--Requested by Jorgesc
--
-- Allow PM by unregistered users to select profiles only
--
--User Settings-------------------------------------------------------------------------------------
Bot = frmHub:GetHubBotName()
-- Which profiles may an unregistered user send a PM to? '1=yes/0=no'
-- Adjust to your profiles

CanPM = {
		[0]=1,	--0|Master				
		[1]=1,	--1|Operator			
		[2]=0,	--2|VIP				
		[3]=0,	--3|Reg				
		[4]=0,	--4|Newbie	<-- Moderator in RC9		
		[5]=1,	--5|Moderator	<-- NetFounder in RC9	
		[6]=0,	--6|Admin		<-- only in CB	
		[7]=0	--7|NetWorkFounder	<-- only in CB
		} 

--End User Settings----------------------------------------------------------------------------------

function DataArrival(user, data)
	if (strsub(data,1,4) == "$To:") and (user.iProfile == -1) then
		local s,e,who = strfind(data,"$To:%s+(%S+)%s+From:")
		local nick = GetItemByName(who)
		if not nick = nil and CanPM[nick.iProfile] ~= 1 then
			user:SendPM(who,"\r\n\r\n\t\t* ** <-=Holly-Inquisitor=-> ** *\r\n\r\n\tYour Private Message to : <"..who..">  has been blocked.\r\n\tBecause: you are not a regged user. ")
			return 1
		end
	end
end

this is what i have now ..
and this is what i get ..

Syntax error: attempt to index local `nick' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 30 [file `...(NEW)~\scripts\X.01.nopmfornonreggedbymutor.lua']

any clue.. even though i run a beta-test-ptokax or just a "cold shoulder" .. ;0)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#6
not sure about that..
but indeed the script works fine ,,..

user could be kicked be a antiflood before ...    
or user that gets pm might not be regged or in list..

no matter WORKS great .. :0)

*EDIT

if not nick = nil and  CanPM[nick.iProfile] ~= 1 then

solves the error messages
(incase anybody had the same problem)

*EDIT again
well i just see that error messege again .. so i am trying some other way to fix it . but now only one ..after many hours .. instead of many in one hour ...
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#7
local s,e,who = strfind(data,"$To:%s+(%S+)%s+From:")
    if GetItemByName(who) ~="" then
        local nick = GetItemByName(who)


seems to solve the error messages also ..
(no errors in last 12 hours yet)
but you are right ..
 i will do the
"else
user:SendPM(who," Has logged off the hub")"
thingy too ..

is nicer indeed..

..although ..
if a user is no longer logged into the hub,
doesn't the sender get a "user is no longer online" message anyway ? (from their client or the hub)..
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

SMF spam blocked by CleanTalk