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.
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
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.")
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
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
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
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?
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
Thanks it worked like a charm ;)
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 :]