Download blocker nonreg can download nonreg
 

Download blocker nonreg can download nonreg

Started by zinden, 13 November, 2004, 16:53:21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zinden

Hello, i checked thru forum and i havent found any script that really match my query.

I Would like to have a downblocker script that blocks nonreg from download from reg and above.
nonreg can download from only other nonreg users.

They get a pm/main message when they try to connect to a reg user. if they try again then message arrives again.

Hopefully someone can make a script like that.
Xion++ - Where it all begins
http://www.zinden.net

nErBoS

Hi,

Try out this one...

--## Made by [NL]Pur
--## Modded by nErBoS

sBot = "DLBlocker"

arrRC = {}

function Main() 
    frmHub:EnableFullData(1) 
end 

function DataArrival(curUser, data)
	if (strsub(data, 1, 15) == "$RevConnectToMe") then 
		local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|") 
		if (curUser.iProfile == -1 and GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then
			curUser:SendData(sBot, "You can only download from unreg users.")
	   		return 1
        	elseif (towho ~= nil) then 
			arrRC[towho] = 1
		end
	elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then 
		local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|") 
		if (arrRC[curUser.sName] ~= nil) then
			arrRC[curUser.sName] = nil
		elseif (GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then 
			curUser:SendData(sBot, "You can only download from unreg users.")
	   		return 1
        	end 
	
	end 
end

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

BeeR

QuoteOriginally posted by nErBoS
Hi,

Try out this one...

--## Made by [NL]Pur
--## Modded by nErBoS

sBot = "DLBlocker"

arrRC = {}

function Main() 
    frmHub:EnableFullData(1) 
end 

function DataArrival(curUser, data)
	if (strsub(data, 1, 15) == "$RevConnectToMe") then 
		local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|") 
		if (curUser.iProfile == -1 and GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then
			curUser:SendData(sBot, "You can only download from unreg users.")
	   		return 1
        	elseif (towho ~= nil) then 
			arrRC[towho] = 1
		end
	elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then 
		local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|") 
		if (arrRC[curUser.sName] ~= nil) then
			arrRC[curUser.sName] = nil
		elseif (GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then 
			curUser:SendData(sBot, "You can only download from unreg users.")
	   		return 1
        	end 
	
	end 
end

Best regards, nErBoS
Hello nErBoS
Is it possible to modified this script so non-regged user not can dload and search..
if a user try to dload or search he/she should get this mess --> curUser:SendData(sBot, "You must be a regged user to download or search i this hub - talk to an OP to get regged.")
A cold BeeR is stunning !!

nErBoS

Hi,

Try out this one was made for another request but will do the same thing...

--## CHAT ONLY BOT
--## Requested by Bhuvan
--## Little modification for BeeR
--## Made By nErBoS

sBot = "CO-Bot"

arrString = {
	"$Search",
	"$SR",
	"$ConnectToMe",
	"$RevConnectToMe",
}

arrRC = {}

function Main()
	frmHub:RegBot(sBot)
	frmHub:EnableFullData(1)
end

function DataArrival(user, data)
	if (strsub(data,1,11) == "$ConnectToMe") then
		local s,e,who = strfind(data, "$ConnectToMe%s+(%S+)")
		if (who ~= nil and arrRC[who] ~= nil) then
			return 0
		end
	end
	if (user.iProfile == -1 and (strsub(data,1,1) == "$" and strsub(data,1,4) ~= "$To:")) then
		for i=1, getn(arrString) do
			if (strsub(data,1,strlen(arrString[i])) == arrString[i]) then
				user:SendData(sBot, "You must be a regged user to download or search i this hub - talk to an OP to get regged.")
				return 1
			end
		end
	elseif (strsub(data,1,15) == "$RevConnectToMe") then
		arrRC[user.sName] = 1
	end
end

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

zinden

if the message should appear in pm instead of mainchat how do i write then?

Also add his nick like:   " nicky, you are not allowed to download from reg users only nonreg."

this request is for the first script nErBoS posted
Xion++ - Where it all begins
http://www.zinden.net

bastya_elvtars

#5
I hope this is what you mean.

--## Made by [NL]Pur
--## Modded by nErBoS


sBot = "DLBlocker"

pmnotif=1 -- set to 1 if you wanna notify a user in PM


arrRC = {}


function Main() 
    frmHub:EnableFullData(1) 
    frmHub:UnRegBot(sBot)
    if pmnotif==1 then
        frmHub:RegBot(sBot)
    end
end 


function DataArrival(curUser, data)
	if (strsub(data, 1, 15) == "$RevConnectToMe") then 
		local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|") 
		if (curUser.iProfile == -1 and GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then
			curUser:SendData(sBot, curUser.sName.." - you can only download from unregistered users.")
	   		return 1
        	elseif (towho ~= nil) then 
			arrRC[towho] = 1
		end
	elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then 
		local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|") 
		if (arrRC[curUser.sName] ~= nil) then
			arrRC[curUser.sName] = nil
		elseif (GetItemByName(towho) ~= nil and GetItemByName(towho).iProfile ~= -1) then 
			curUser:SendData(sBot, curUser.sName.." - you can only download from unregistered users.")
	   		return 1
        	end 
		end 
end
Everything could have been anything else and it would have just as much meaning.

Madman

#6
Shoulnt it be
curUser:SendPM(sBot, curUser.sName.. " You can only download from unreg users.")

since he asked it to show in a pm instead of the main
and it might be requierd to reg the bot to or am i totaly wrong?
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

bastya_elvtars

QuoteOriginally posted by madman
Shoulnt it be
curUser:SendPM(sBot, curUser.sName.. " You can only download from unreg users.")

since he asked it to show in a pm instead of the main

edited above post
Everything could have been anything else and it would have just as much meaning.

zinden

Thanks it worked like a charm  ;)
Xion++ - Where it all begins
http://www.zinden.net

BeeR

QuoteOriginally posted by nErBoS
Hi,

Try out this one was made for another request but will do the same thing...

--## CHAT ONLY BOT
--## Requested by Bhuvan
--## Little modification for BeeR
--## Made By nErBoS

sBot = "CO-Bot"

arrString = {
	"$Search",
	"$SR",
	"$ConnectToMe",
	"$RevConnectToMe",
}

arrRC = {}

function Main()
	frmHub:RegBot(sBot)
	frmHub:EnableFullData(1)
end

function DataArrival(user, data)
	if (strsub(data,1,11) == "$ConnectToMe") then
		local s,e,who = strfind(data, "$ConnectToMe%s+(%S+)")
		if (who ~= nil and arrRC[who] ~= nil) then
			return 0
		end
	end
	if (user.iProfile == -1 and (strsub(data,1,1) == "$" and strsub(data,1,4) ~= "$To:")) then
		for i=1, getn(arrString) do
			if (strsub(data,1,strlen(arrString[i])) == arrString[i]) then
				user:SendData(sBot, "You must be a regged user to download or search i this hub - talk to an OP to get regged.")
				return 1
			end
		end
	elseif (strsub(data,1,15) == "$RevConnectToMe") then
		arrRC[user.sName] = 1
	end
end

Best regards, nErBoS
Thank you nErBoS :]
A cold BeeR is stunning !!

SMF spam blocked by CleanTalk