greets!
im looking for the script that allowes only regged users to download,
anyone has it?
blessssss
GanjaMan
Here is the link, anyway i think this function must be built in into ptokax or i will finished, with 100 scripts or some bigs ones!!!!.
http://www.1stleg.com/1stleg/Download/Scripts/PtokaX/HubSecure_v1.0.rar
sorry its to big to past but it can be found here (http://houseofkings.no-ip.org/images/HubSecure.lua)
allso you can find some of the old posts about the script here (http://www.highwaysschoolofmotoring.co.uk/lua/viewtopic.php?t=47)
-=T-G-T=- network
Network Webpage: www.t-g-t.nl (//www.t-g-t.nl)
Network forum http://tgt.shows.it (http://tgt.shows.it)
Hub address: houseofkings.no-ip.org
hubwebpage http://houseofkings.uknnet.com/home.html (http://houseofkings.uknnet.com/home.html)
my hub forum http://kingsforum.uknnet.com/ (http://kingsforum.uknnet.com/)
my LUA forum http://lua.uknnet.com (http://lua.uknnet.com)
yeah.....thats the one!
but.....
my users are already regged with channelbot, do they have to reg all over to use this script? or is there any other way?
greets :)
never mind previous post, i took the ANTILEECHER script from your other link and its working great!
thnx :)
Where is skrosllter?
Does any one can explain me what the hubsecure returns the same message 'sMessageToAliens' 3 times?.
What for?.
No answers?
QuoteWhere is skrosllter?
Does any one can explain me what the hubsecure returns the same message 'sMessageToAliens' 3 times?.
What for?.
what do you mean ?
QuoteOriginally posted by [NL]Pur what do you mean ?
Look in the second post the link for download hubsecure, i mean why is the reason for this script display the same message (for not registered) 3 times, 2 in main chat and one in pm. 3 times!:
*** Connecting to 172.16.0.5...
*** Connected
This hub is running PtokaX DC Hub 0.3.3.0 build 15 [debug] (UpTime: 0 hours, 0 minutes)
*** WARNING***
YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB ..... more text.
Welcome to PtokaX
Welcome to
*** WARNING***
YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB ..... more text.
2 times in main chat, and another pm windows with the same message, the question is why?.
-- The fallowing file should be included:
-- HubSecure.lua - The main script file
-- PermBan.dat - A black list of all MPAA, RIAA, and BSA related ip's
--
-- Default Commands:
-- !RegMe - PM Only
-- !RegHelp
-- !Reg
-- !LetLeech - Op Only
--
-- Variable Prefixes are:
-- b = Boolean (0 = False, 1 = True)
-- a = Array { }
-- i = Integer
-- s = String
----------------------
-- GLOBAL VARIABLES -- make changes here only
----------------------
-- Global Setup
sBotName = frmHub:GetHubBotName()
sHubName = frmHub:GetHubName()
sHubAddress = "nangiala03.no-ip.com"
sHubOwner = "[Owner]Alexei"
-- Anti ML Donkey Setup
bBlockMLDonkey = 0 -- (0 = False, 1 = True)
bLogMLDonkeyAttempt = 1 -- (0 = False, 1 = True)
aMLDonkeyDescriptions = { "mldonkey", "mldc client", "Lyon 2003", "dc client" }
iMLDonkeyAction = 1 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sDisconnectMessage = "You are using unauthorized client software!\r\n"..
"Disconnecting..."
-- Anti MediaForce Setup
bBlockMediaForce = 1 -- (0 = False, 1 = True)
bLogMediaForceAttempt = 1 -- (0 = False, 1 = True)
aMediaForceVersions = {"1.0.25"}
aMediaForceShareAmount = {"18552221398"}
iMediaForceAction = 2 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sMediaForceFoundMessage = " was a searchbot most likly MediaForce and was temporarily banned. ()"
-- User Registration
bLogUserRegistration = 1 -- (0 = False, 1 = True)
sCmdRegMe = "!RegMe"
sCmdReg = "!Reg"
sCmdRegHelp = "!RegHelp"
sRegistrationProfile = "Reg"
sRegistrationCompleteMessage = "You are now registered at "..sHubName.."!\r\n"..
"Add this hub to your favourites (if you haven?t done so already), and be sure to write down your account-information and password...\r\n"..
"*** Notice You Will Need To Reconnect Before Your Account Becomes Active ***\r\n"..
"HubName:\t"..sHubName.." Address:\t"..sHubAddress.."\r\n"..
"Your Nick:\t\r\n"..
"Your Password:\t"
sRegistrationHelpMessage = "By registering to join this hub you agree that you are joining a private network where the rules and policies are created by the network owner.\r\n\r\n"..
"You may NOT collect any statistics or log IP addresses for any purpose without explicit permission from the hub owner.\r\n\r\n"..
"You may NOT register to enter this hub if you are directly or indirectly affiliated with any law enforcement agency, The MPAA, The RIAA, The BSA or any other related organization.\r\n\r\n"..
"You may NOT register to enter this hub if you do not agree to these terms, ANY ATTEMPT TO ACCESS ANY INFORMATION ON THIS SERVER WITHOUT AGREEING TO THESE TERMS WILL BE CONSIDERED A 'HACK' AND VIOLATORS WILL BE PROSECUTED TO THE FULL EXTENT OF THE LAW!\r\n\r\n\r\n"..
"To register or change your password respond to this PM with the command "..sCmdRegMe.." Password where Password is the password you would like for your account."
sRegistrationError_PMRegOnly = "You may only use the "..sCmdRegMe.." command via PM. Please type "..sCmdRegHelp.." for help."
sRegistrationError_NoPassword = "You must provide a password. Please type "..sCmdRegHelp.." for help."
-- Leech Blocker
bBlockSearches = 1 -- (0 = False, 1 = True)
aBlockSearchExceptions = { }
aToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}
aLetLeech = { "zSearch[moglo]", "7www.glosearch.tk" } -- This is an array of nicks that are exempt like search bots.
sCmdLetLeech = "!LetLeech"
sWelcomeMessage = "Welcome to "..sHubName.."\r\n\r\n"
sMessageToAliens = "\t\t\t*** WARNING***\r\n"..
"YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB\r\n"..
"This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users. Please register your User Name as soon as possible by sending a pm to "..sBotName.." with the command "..sCmdRegHelp.." or by typing /msg "..sBotName.." "..sCmdRegHelp.." in the main chat window and follow the instructions that are sent to you.\r\n\r\n"..
"I am sorry for the inconvenience but by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n-"..sHubOwner.."\r\n\r\n"..
"This Annoying Message Will Stop After You Register Your Nick."
sMessageToRegNicks = "This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users.\r\n\r\n"..
"I am sorry for the inconvenience but by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n-"..sHubOwner
sMessageNotifyLeech = "You are now authorized to download for this session."
sMessageNotifyOp = "The user has been granted a special leech license."
sLeechError_UserIsReg = "The user is already registered."
sLeechError_NoUserName = "You must provide a Nick to grant leech access to."
sLeechError_UserOffilne = "The user is not currently online."
----------------------------------
-- Do not change anything below --
----------------------------------
function Main()
frmHub:EnableFullData(1)
frmHub:UnregBot(sBotName)
frmHub:RegBot(sBotName)
if bBlockSearches == 0 then
for i,v in aToBlock do
if v == "^$Search%s+(%S+)" then aToBlock[i] = nil end
end
end
end
function NewUserConnected(curUser)
if bBlockMLDonkey == 1 then
-- Anti ML Donkey
for key,checkWord in aMLDonkeyDescriptions do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
if bLogMLDonkeyAttempt == 1 then
AppendFile("../Logs/MLDonkeyBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a MLDonkey Client. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sDisconnectMessage)
if iMLDonkeyAction == 1 then
curUser:Disconnect()
elseif iMLDonkeyAction == 2 then
curUser:TempBan()
elseif iMLDonkeyAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
end
if bBlockMediaForce == 1 then
-- Anti MediaForce
local foundMediaForce = 0
for key,checkWord in aMediaForceVersions do
if strfind(curUser.iVersion, checkWord, 1, 1) then
foundMediaForce = 1
end
end
if foundMediaForce == 0 then
for key,checkWord in aMediaForceShareAmount do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
foundMediaForce = 1
end
end
end
if foundMediaForce ~= 0 then
SendToAll (sBotName, gsub(gsub(sMediaForceFoundMessage, "", curUser.sName), "", curUser.sIP))
if bLogMediaForceAttempt == 1 then
AppendFile("../Logs/MediaforceBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a Mediaforce Bot. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sMediaForceFoundMessage)
if iMediaForceAction == 1 then
curUser:Disconnect()
elseif iMediaForceAction == 2 then
curUser:TempBan()
elseif iMediaForceAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
if curUser.iProfile == -1 then
curUser:SendData(sBotName, sWelcomeMessage..sMessageToAliens)
else
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
end
function OpConnected(curUser)
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
function DataArrival(curUser, sData)
-- if Chat Cmd
if strsub(sData, 1, 1) == "<" then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdRegMe) then
curUser:SendData(sBotName, sRegistrationError_PMRegOnly)
return 1
elseif strlower(cmd) == strlower(sCmdReg) or strlower(cmd) == strlower(sCmdRegHelp) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif strlower(cmd) == strlower(sCmdLetLeech) and curUser.bOperator then
if not arg1 == nil and arg1 ~= "" then
who = GetItemByName(arg1)
if not who then
curUser:SendData(sBotName, gsub(sLeechError_UserOffilne, "", arg1))
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, gsub(sLeechError_UserIsReg, "", arg1))
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", arg1))
who:SendData(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
-- if PM Cmd
if strsub(sData, 1, 5) == "$To: " then
local s, e, whoTo, from = strfind(sData, "$To:%s+(%S+)%s+From:%s+(%S+)")
if whoTo == sBotName then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdReg) or strlower(cmd) == strlower(sCmdRegHelp) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
elseif strlower(cmd) == strlower(sCmdRegMe) then
if arg1 == nil or arg1 == "" then
curUser:SendPM(sBotName, sRegistrationError_NoPassword)
else
if curUser.iProfile == -1 then
-- New User
AddRegUser(curUser.sName, arg1, GetProfileIdx(sRegistrationProfile))
else
-- Change Password
AddRegUser(curUser.sName, arg1, curUser.iProfile)
end
curUser:SendPM(sBotName, ""..gsub(gsub(sRegistrationCompleteMessage, "", curUser.sName), "", arg1))
end
end
end
return 1
end
end
-- Annoying message to send to users that havnt registered!
if strsub(strlower(sData), 1, 7) == strlower("$MyINFO") then
if (curUser.iProfile == -1) then
curUser:SendPM(sBotName, sMessageToAliens)
curUser:SendData(sBotName, sMessageToAliens)
end
return 1
end
-- See if data should be blocked:
for _,blockstring in aToBlock do
local _, _, who = strfind(sData, blockstring)
if who then return smBlock(curUser, sData, who) end
end
end
----------------------------
-- User Defined Functions --
----------------------------
function AppendFile(sFilePath, sData)
appendto(sFilePath)
write(sData.."\r\n")
writeto()
end
function smBlock(user, data, who)
local report
local profnam = GetProfileName(user.iProfile)
if profnam then
profnam = strlower(profnam)
else
profnam = "alien"
end
-- Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
-- Also, searches pass if they are in the exception list:
-- Data also passes if user is in LetLeech list:
if (user.iProfile ~= -1) or smMatchException(data) or IsInLeechList(user) then
report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
return nil
end
-- Alien (not registered) users get blocked:
local report = "\tBlocked from "..user.sName.." ("..profnam.."):\r\n\t"..data
return 1
end
function smMatchException(data)
if strfind (data, "^$Search%s+(%S+)") then
for _,exceptword in aBlockSearchExceptions do
if strfind (strlower(data), strlower(exceptword)) then
return 1
end
end
end
return nil
end
function IsInLeechList(user)
for i,v in aLetLeech do
if i == user.sName then return 1 end
end
return nil
end
function SendDebug(sData)
SendPmToNick(sHubOwner, "Debug", sData)
return 1
end
Yes, this one is the script and?
No answers yet?. The old board was more faster helping people ;(
Does any one could help me here?. I'm trying to modify this script to make two little versions, exactly i'm removing some code, the problem is when a user connect into a hub he is getting 3 messages with the same text and i don't know if there are a good reason for this or is only a wrong implementation. I agree with 2 messages, one in pm and one in main could be usefull because some options presents into dc++ advanced settings, but the third for what?. Think in this way we are flooding the hub. The code related into this is:
if curUser.iProfile == -1 then
curUser:SendData(sBotName, sWelcomeMessage..sMessageToAliens)
else
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
if strsub(strlower(sData), 1, 7) == strlower("$MyINFO") then
if (curUser.iProfile == -1) then
curUser:SendPM(sBotName, sMessageToAliens)
curUser:SendData(sBotName, sMessageToAliens)
end
return 1
end
I think this is wrong. Some ideas people
*************
For Ptacek.
The bug related to pm messages i commented you before, if you are using this script becomes critical, instead you have one message in pm and one in main, you have the two on main. Note: The bug is ramdom, in first connection message in displayed in PM, after that, i don't remember exactly what i did, both message are displayed into main, no way to avoid settings into dc. I not see any sense for display the same message twice into the same place X(
*************
r u sure you don't have 2 or 3 of the same scripts with different names or somefink cause dat happens alot. :D
QuoteOriginally posted by raz
r u sure you don't have 2 or 3 of the same scripts with different names or somefink cause dat happens alot. :D
Totally sure, only this one, i'm rewriting/modifying scripts now using the last beta. I start scripting, when finished, i move it to a folder called scriptstested and start with a new one, the real server is running TD4 on different port.
In this way all i safe to put it into the real server and ocassionally catch a bug into Ptokax, althougth i have not started full tests on Ptokax, i'm waiting 2 or 3 betas more to place the beta into the real sever with the new scripts.
QuoteOriginally posted by [ES]latinmusic
No answers yet?. The old board was more faster helping people ;(
the old board also had 3000 people
more people=more help
Totally true this one :(
sorry for not replying, but i have ignored this thread because i thought the problem was solved..
I'll check in tomorow/today to see if it can be fixed and what the reason is....
in the main function
frmHub:UnregBot(sBotName)
frmHub:RegBot(sBotName)
this is giving the problems that SendPM is displayed in the main.
this should be enough
frmHub:RegBot(sBotName)
and the other two are from SendData
if u use SendData is always displayed in the main.
as latinmusic already pointed out there two SendData used and one SendPM
ps.
what happend with the width of this thread ?
Great, many thanks pur and skrollster to answer, and the rest of people in board too.
Pur i'm going to test what you have explain me, and both if you if possible take a look into the code to see if is possible to re-arrange a little the code to diplay only 2 messages instead 3. My english is no good but i will try to explain what i mean to see if you can catch the problem, if not ask here and i will explain till you understand it well.
What we have here?.
We have 2 differents points: The client is connecting to a server or the client is already connected to the server.
In the script we have 2 functions:
.- function NewUserConnected (): send the allien message on new user connected
.- function DataArrival (): send the allien message twice, one in pm and one in main.
The total amount of messages is equal to 3 in the case: client is connecting to the server. Reason: On connect the 2 functions are executed, function NewUserConnected () and function DataArrival ().
What we need?: We need when a client is connecting send the message ONLY twice, one in main and one in pm, then when client is (already) connected, if the user start searching or try to download, DataArrival () is fired and we will displayed the allien message again twice, one in pm and one in main chat.
Is easy to add a line for sending the message into NewUserConnected () to display the message into PM too when a user connect to the hub, but in this case, when a user connect for first time, he will recieved the message 4 time, in larger hubs, the amount of data tranfer could be very big. The problem remains only when a client is connecting because the 2 functions are fired. I think could be fixed adding a checking variable and calling the allien message inside another function, but i not good coding.
What about?.
Note: The message in main and in pm are cool because the user can have activated some options related to the messages from bots into settings of the client.
Just maintainng this topic alive, still need help here :rolleyes:
A little help here please. skrollster, pur, ptacek, phaty, tezlo, anyone please?.
script sends the msg on Connect and on every $MyINFO
so yes.. unregged users get three of em when entering the hub
youre safe getting rid of the latter..
if strsub(strlower(sData), 1, 7) == strlower("$MyINFO") then
if (curUser.iProfile == -1) then
curUser:SendPM(sBotName, sMessageToAliens)
curUser:SendData(sBotName, sMessageToAliens)
end
return 1
end
Thanks! finally i can implement this one, thanks again :P
i have changed it so its only 2 msgs. 1 thing is dat u don't always recieve it in pm, but u do half of the time. the other half u recieve it on main.u won't get 3 msgs now like b4. :D
-- The fallowing file should be included:
-- HubSecure.lua - The main script file
-- PermBan.dat - A black list of all MPAA, RIAA, and BSA related ip's
--
-- Default Commands:
-- !RegMe - PM Only
-- !RegHelp
-- !Reg
-- !LetLeech - Op Only
--
-- Variable Prefixes are:
-- b = Boolean (0 = False, 1 = True)
-- a = Array { }
-- i = Integer
-- s = String
----------------------
-- GLOBAL VARIABLES -- make changes here only
----------------------
-- Global Setup
sBotName = frmHub:GetHubBotName()
sHubName = frmHub:GetHubName()
sHubAddress = "nangiala03.no-ip.com"
sHubOwner = "[Owner]Alexei"
-- Anti ML Donkey Setup
bBlockMLDonkey = 0 -- (0 = False, 1 = True)
bLogMLDonkeyAttempt = 1 -- (0 = False, 1 = True)
aMLDonkeyDescriptions = { "mldonkey", "mldc client", "Lyon 2003", "dc client" }
iMLDonkeyAction = 1 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sDisconnectMessage = "You are using unauthorized client software!\r\n"..
"Disconnecting..."
-- Anti MediaForce Setup
bBlockMediaForce = 1 -- (0 = False, 1 = True)
bLogMediaForceAttempt = 1 -- (0 = False, 1 = True)
aMediaForceVersions = {"1.0.25"}
aMediaForceShareAmount = {"18552221398"}
iMediaForceAction = 2 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sMediaForceFoundMessage = " was a searchbot most likly MediaForce and was temporarily banned. ()"
-- User Registration
bLogUserRegistration = 1 -- (0 = False, 1 = True)
sCmdRegMe = "!RegMe"
sCmdReg = "!Reg"
sCmdRegHelp = "!RegHelp"
sRegistrationProfile = "Reg"
sRegistrationCompleteMessage = "You are now registered at "..sHubName.."!\r\n"..
"Add this hub to your favourites (if you haven?t done so already), and be sure to write down your account-information and password...\r\n"..
"*** Notice You Will Need To Reconnect Before Your Account Becomes Active ***\r\n"..
"HubName:\t"..sHubName.." Address:\t"..sHubAddress.."\r\n"..
"Your Nick:\t\r\n"..
"Your Password:\t"
sRegistrationHelpMessage = "By registering to join this hub you agree that you are joining a private network where the rules and policies are created by the network owner.\r\n\r\n"..
"You may NOT collect any statistics or log IP addresses for any purpose without explicit permission from the hub owner.\r\n\r\n"..
"You may NOT register to enter this hub if you are directly or indirectly affiliated with any law enforcement agency, The MPAA, The RIAA, The BSA or any other related organization.\r\n\r\n"..
"You may NOT register to enter this hub if you do not agree to these terms, ANY ATTEMPT TO ACCESS ANY INFORMATION ON THIS SERVER WITHOUT AGREEING TO THESE TERMS WILL BE CONSIDERED A 'HACK' AND VIOLATORS WILL BE PROSECUTED TO THE FULL EXTENT OF THE LAW!\r\n\r\n\r\n"..
"To register or change your password respond to this PM with the command "..sCmdRegMe.." Password where Password is the password you would like for your account."
sRegistrationError_PMRegOnly = "You may only use the "..sCmdRegMe.." command via PM. Please type "..sCmdRegHelp.." for help."
sRegistrationError_NoPassword = "You must provide a password. Please type "..sCmdRegHelp.." for help."
-- Leech Blocker
bBlockSearches = 1 -- (0 = False, 1 = True)
aBlockSearchExceptions = { }
aToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}
aLetLeech = { "zSearch[moglo]", "7www.glosearch.tk" } -- This is an array of nicks that are exempt like search bots.
sCmdLetLeech = "!LetLeech"
sWelcomeMessage = "Welcome to "..sHubName.."\r\n\r\n"
sMessageToAliens = "\t\t\t*** WARNING***\r\n"..
"YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB\r\n"..
"This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users. Please register your User Name as soon as possible by sending a pm to "..sBotName.." with the command "..sCmdRegHelp.." or by typing /msg "..sBotName.." "..sCmdRegHelp.." in the main chat window and follow the instructions that are sent to you.\r\n\r\n"..
"I am sorry for the inconvenience but by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n-"..sHubOwner.."\r\n\r\n"..
"This Annoying Message Will Stop After You Register Your Nick."
sMessageToRegNicks = "This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users.\r\n\r\n"..
"I am sorry for the inconvenience but by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n-"..sHubOwner
sMessageNotifyLeech = "You are now authorized to download for this session."
sMessageNotifyOp = "The user has been granted a special leech license."
sLeechError_UserIsReg = "The user is already registered."
sLeechError_NoUserName = "You must provide a Nick to grant leech access to."
sLeechError_UserOffilne = "The user is not currently online."
----------------------------------
-- Do not change anything below --
----------------------------------
function Main()
frmHub:RegBot(sBotName)
if bBlockSearches == 0 then
for i,v in aToBlock do
if v == "^$Search%s+(%S+)" then aToBlock[i] = nil end
end
end
end
function NewUserConnected(curUser)
if bBlockMLDonkey == 1 then
-- Anti ML Donkey
for key,checkWord in aMLDonkeyDescriptions do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
if bLogMLDonkeyAttempt == 1 then
AppendFile("../Logs/MLDonkeyBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a MLDonkey Client. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sDisconnectMessage)
if iMLDonkeyAction == 1 then
curUser:Disconnect()
elseif iMLDonkeyAction == 2 then
curUser:TempBan()
elseif iMLDonkeyAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
end
if bBlockMediaForce == 1 then
-- Anti MediaForce
local foundMediaForce = 0
for key,checkWord in aMediaForceVersions do
if strfind(curUser.iVersion, checkWord, 1, 1) then
foundMediaForce = 1
end
end
if foundMediaForce == 0 then
for key,checkWord in aMediaForceShareAmount do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
foundMediaForce = 1
end
end
end
if foundMediaForce ~= 0 then
SendToAll (sBotName, gsub(gsub(sMediaForceFoundMessage, "", curUser.sName), "", curUser.sIP))
if bLogMediaForceAttempt == 1 then
AppendFile("../Logs/MediaforceBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a Mediaforce Bot. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sMediaForceFoundMessage)
if iMediaForceAction == 1 then
curUser:Disconnect()
elseif iMediaForceAction == 2 then
curUser:TempBan()
elseif iMediaForceAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
if curUser.iProfile == -1 then
curUser:SendData(sBotName, sWelcomeMessage..sMessageToAliens)
else
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
curUser:SendPM(sBotName, sWelcomeMessage..sMessageToAliens)
end
function OpConnected(curUser)
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
function DataArrival(curUser, sData)
-- if Chat Cmd
if strsub(sData, 1, 1) == "<" then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdRegMe) then
curUser:SendData(sBotName, sRegistrationError_PMRegOnly)
return 1
elseif strlower(cmd) == strlower(sCmdReg) or strlower(cmd) == strlower(sCmdRegHelp) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif strlower(cmd) == strlower(sCmdLetLeech) and curUser.bOperator then
if not arg1 == nil and arg1 ~= "" then
who = GetItemByName(arg1)
if not who then
curUser:SendData(sBotName, gsub(sLeechError_UserOffilne, "", arg1))
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, gsub(sLeechError_UserIsReg, "", arg1))
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", arg1))
who:SendData(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
-- if PM Cmd
if strsub(sData, 1, 5) == "$To: " then
local s, e, whoTo, from = strfind(sData, "$To:%s+(%S+)%s+From:%s+(%S+)")
if whoTo == sBotName then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdReg) or strlower(cmd) == strlower(sCmdRegHelp) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
elseif strlower(cmd) == strlower(sCmdRegMe) then
if arg1 == nil or arg1 == "" then
curUser:SendPM(sBotName, sRegistrationError_NoPassword)
else
if curUser.iProfile == -1 then
-- New User
AddRegUser(curUser.sName, arg1, GetProfileIdx(sRegistrationProfile))
else
-- Change Password
AddRegUser(curUser.sName, arg1, curUser.iProfile)
end
curUser:SendPM(sBotName, ""..gsub(gsub(sRegistrationCompleteMessage, "", curUser.sName), "", arg1))
end
end
end
return 1
end
end
end
----------------------------
-- User Defined Functions --
----------------------------
function AppendFile(sFilePath, sData)
appendto(sFilePath)
write(sData.."\r\n")
writeto()
end
function smBlock(user, data, who)
local report
local profnam = GetProfileName(user.iProfile)
if profnam then
profnam = strlower(profnam)
else
profnam = "alien"
end
-- Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
-- Also, searches pass if they are in the exception list:
-- Data also passes if user is in LetLeech list:
if (user.iProfile ~= -1) or smMatchException(data) or IsInLeechList(user) then
report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
return nil
end
-- Alien (not registered) users get blocked:
local report = "\tBlocked from "..user.sName.." ("..profnam.."):\r\n\t"..data
return 1
end
function smMatchException(data)
if strfind (data, "^$Search%s+(%S+)") then
for _,exceptword in aBlockSearchExceptions do
if strfind (strlower(data), strlower(exceptword)) then
return 1
end
end
end
return nil
end
function IsInLeechList(user)
for i,v in aLetLeech do
if i == user.sName then return 1 end
end
return nil
end
function SendDebug(sData)
SendPmToNick(sHubOwner, "Debug", sData)
return 1
end
Does any one have noted that the Sid script, the one posted on the web and without any modification, generate the following message into ptokax script editor if you are operator or hubmaster?:
Syntax Error: attempt to index global `user' (a nil value)
Could anyone help me to fix this?, really need help here.
Fixed, i had a conflict between 2 scripts, in one i use User in the other i use curUser.
Anyway i think there is a bug inside last ptokax beta, i think one script could not affect other scripts in any way, functions, names, variables, etc, could be local or global but only inside the the current script and no for all scripts inside the server!.
Back into this again:
The following code taken from hub-secure is not working ok and also is not giving any message about errors, the command "!letleech" without parameters works but the same command with parameters does not work. Seems to have some troubles with the line:
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
or the line:
who = GetItemByName(arg1)
and with variables 'who' and 'arg1'
The code who is not working is the following:
if strsub(sData, 1, 1) == "<" then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdReg) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif strlower(cmd) == strlower(sCmdLetLeech) and curUser.bOperator then
if not arg1 == nil and arg1 ~= "" then
who = GetItemByName(arg1)
if not who then
curUser:SendData(sBotName, gsub(sLeechError_UserOffilne, "", arg1))
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, gsub(sLeechError_UserIsReg, "", arg1))
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", arg1))
who:SendData(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
Can anyone take a look into this to see what is happening and give me a little help?.
Re- requesting help here, please help me.
The only thing i see is that you use arg1 everywhere, but not in:
LetLeech[arg] = 1
QuoteOriginally posted by OpiumVolage
The only thing i see is that you use arg1 everywhere, but not in:
LetLeech[arg] = 1
Great, seems you are my main helper, totally cool :))
I don't catch what exactly you mean :( can you explain a little more?.
For me the problem is in the line:
who = GetItemByName(arg1) When i type the command !leetleech without parameters the script works and the error message 'sLeechError_NoUserName' is displayed but for instance, when i type '!leetleech' with an argument '!letleech opium' an supposing you are not connected, the message 'sLeechError_UserOffilne' should be displayed.
This not happend and ptokax does not generated any error message in every where.
Seems that the if procedure:
if not who then
....
end
are not working at all.
What can i do here?.
ok, who is the user object.
arg1 is the username (who.sName)
you create or modify LetLeech table with key username i think, it should be arg1, not arg.
It think the error is in this part of the code:
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", arg1))
who:SendData(sBotName, sMessageNotifyLeech)
end
I'm back here again, the solution not work but i think i have identified the problem, also i have detected a bug into ptokax last beta build available because this.
The problem is exactly in this line i think:
who = GetItemByName(arg1)
The above line seems to be totally ok but who is always nill, dunno why.
I have also made some probe adding the following code, see mainly black letters:
if not arg1 == nil and arg1 ~= "" then
who = GetItemByName(arg1)
[B]SendToAll (sBotName,"arg1: "..arg1)
SendToAll (sBotName,"who: "..who)[/B]
if not who then
curUser:SendData(sBotName, gsub(sLeechError_UserOffilne, "", arg1))
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, gsub(sLeechError_UserIsReg, "", arg1))
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", arg1))
who:SendData(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
If i type for instance this: !letleech OpiumVolage
With the first SendToAll i get this result: arg1: OpiumVolage. But the second SendToAll does not return anything in mainchat.
Thanks to a bug inside Ptokax i have obtained the following line in ptokax script editor: attempt to concat global `who' (a nil value)
Now, how can i make this line works as we suppose it do it?. Because if i declare at the begining like who = " " The variable is global but nothing is solved.
Also an alternate solution to do what that line does is a totally valid way to fix my problem.
What do you think opium?.
Now going to post or mail to Ptacek about the Ptokax bug.
if there was a who you have to index it with .sName
SendToAll (sBotName,"who: "..who.sName)
QuoteOriginally posted by Skrollster
if there was a who you have to index it with .sName
SendToAll (sBotName,"who: "..who.sName)
Great more help!!!
Anyway still does not work:
Syntax error: attempt to index global `who' (a nil value)
stack traceback:
1: function `DataArrival' at line 179 [file `D:\PtokaxDeveloping\scripts\HubSecure.lua'
I don't understand why this script does not want to work, i know there is a mistake in some place but where?.
I'm sorry about this, but i will rewrite it a bit, not much, what i will do is using my old tested functions as helpfunction, i'll be right back...
try this:
sCmdLetLeech = "letleech"
sCmdReg = "reg"
if strsub(sData, 1, 1) == "<" then
-- create a table
local tArgs = {}
-- Save sData in an array
tArgs = tHelpFunctions:GetArgs(sData)
-- Check if the user has used any of the hubprefixes
tArgs = tHelpFunctions:CheckIfHasPrefix(tArgs)
-- add sData as a variable to tArgs
tArgs.sData = sData
if tArgs.sPrefix then
if tArgs.sCmd == sCmdReg then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif tArgs.sCmd == sCmdLetLeech and curUser.bOperator then
if tArgs[1] and tArgs[1] ~= "" then
who = GetItemByName(tArgs[1])
if not who then
curUser:SendData(sBotName, gsub(sLeechError_UserOffilne, "", tArgs[1]))
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, gsub(sLeechError_UserIsReg, "", tArgs[1]))
else
LetLeech[arg] = 1
curUser:SendData(sBotName, gsub(sMessageNotifyOp, "", tArgs[1]))
who:SendData(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
tSettings = {tCmdPrefixes = {"!","+","gs:","?","#","?"}}
tHelpFunctions = {
CheckIfHasPrefix = function(self,tArgs)
sToCheck = tArgs.sCmd
local i
local err
for i = 1, getn(tSettings.tCmdPrefixes) do
if strsub(sToCheck, 1, strlen(tSettings.tCmdPrefixes[i])) == tSettings.tCmdPrefixes[i] then
tArgs.sCmd = strsub(sToCheck, strlen(tSettings.tCmdPrefixes[i])+1, strlen(sToCheck))
tArgs.sPrefix = tSettings.tCmdPrefixes[i]
break
end
end
return tArgs
end,
GetArgs = function(self,sData)
local tArgs = {}
_,_,sData = strfind(sData, "%b<>%s+(.+)|")
tArgs.sMessage = sData
sData = strlower(sData)
gsub(sData, "(%S+)", function (w) tinsert(%tArgs,w) end)
tArgs.sCmd = tArgs[1]
tremove(tArgs, 1)
return tArgs
end,
}
i hope you don't have to change too much
Editing this one i have made a double post :(
QuoteOriginally posted by Skrollster
I'm sorry about this...
Never be surry, you are always helping people here and we have to say you thanks for now and ever.
I'm going to test the code, i will tell you how goes but probably tomorrow, here is too late
Thanks for help me, you opium and all the board too
:P
Hi again, seems that i condenated to be posting in this thread, here we goes:
Hub-Secure have some errors from begining, at least seems to me.
Skrollster, your code works and totally good, but it give exactly the same errors that the previouws one, so the problem is not in your code as usual.
Explanation (3 problems):
1.- If you try to grant an access to an allien, command: '!letleech OpiumVolage' Ptokax answer:
Syntax error: attempt to index global `LetLeech' (a nil value) stack traceback: 1: function `DataArrival' at line 190 [file `D:\PtokaxDeveloping\scripts\HubSecure.lua'].
This is caused by the line: LetLeech[arg] = 1. if i change this line by this one: LetLeech[tArgs] = 1, i have no success anyway. If i comment the line for test, i get no errors, but the messages sMessageNotifyLeech and sMessageNotifyOp are not displayed at all.
2.- If i try to grant an access to a user who is not connected, command !letleech Skrollster the mesage: sLeechError_UserOffilne should be displayed, this is not happening, Ptokax does not give any error too.
3.- If i try to grant an acces to a registered user, command !letleech [NL]Pur, the message sLeechError_UserIsReg should be displayed, this is not happening, Ptokax does not give any error too.
The only thing who seems to works is the command without parameters: !letleech, the message: sLeechError_NoUserName is correctly displayed.
******
I think i probably will be not capable to fix this problem, is very difficult, anyway, what can i do next?. I will continues trying...
I have changed some code inside hub-secure script, read the comments inside the script to see what have changed, now i need a little help to see if the script is continous working as expected, mainly about 'Anti MediaForce blocker' and '-letleech command', in my current server configuration i can do it, please see if the script is working.
The requiered files for run the script can be found in the original script package at:
http://www.1stleg.com/1stleg/Download/Scripts/PtokaX/HubSecure_v1.0.rar
The script is posted in the following reply.
-- HubSecure v2.0 -- for PtokaX TD4 by [ES]latinmusic on 11/19/03
--------------------------------------------------------------------------------
-- Based on HubSecure v1.0 created by Sid ([URL]http://www.1stleg.com[/URL]) 08/28/03
--
-- HubSecure is a script to prevent search bot access by companies like the MPAA, RIAA, and BSA.
-- This script will make your hub 100% safe from the prying eyes of these individuals until they
-- adopt sneakier and more illegal methods of privacy invasion.
--
-- The following files should be included:
-- HubSecure.lua - The main script file
-- PermBan.dat - A black list of all MPAA, RIAA, and BSA related ip's
-- Default Commands:
-- -letleech - Op Only
-- -regme
-- ********** MAIN CHANGES **********
-- Fixed succefully: Duplicate messages when a user connected into the HUB.
-- Fixed succefully: Some messages were not diplayed before.
-- Fixed hope succefully: letleech command now should work as expected. Still need some test.
-- Some code have been rewrited, removed or added
-- The commands: !RegHelp and !Reg have been removed because a different procedure to be
-- a registered user in our net
----------------------
-- GLOBAL VARIABLES -- make changes here only
----------------------
-- Global Setup
sBotName = "![HubSecure]!?"
sHubName = frmHub:GetHubName()
sHubDescription = frmHub:GetHubDescr()
sHubAddress = "YourHUB@Whatever.no-ip.com"
sHubOwner = "@HubOwner"
-- Anti ML Donkey Setup
bBlockMLDonkey = 0 -- (0 = False, 1 = True)
bLogMLDonkeyAttempt = 1 -- (0 = False, 1 = True)
aMLDonkeyDescriptions = { "mldonkey", "mldc client", "Lyon 2003", "dc client" }
iMLDonkeyAction = 1 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sDisconnectMessage = "You are using unauthorized client software!\r\n"..
"Disconnecting..."
-- Anti MediaForce Setup
bBlockMediaForce = 1 -- (0 = False, 1 = True)
bLogMediaForceAttempt = 1 -- (0 = False, 1 = True)
aMediaForceVersions = {"1.0.25"}
aMediaForceShareAmount = {"18552221398"}
iMediaForceAction = 2 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sMediaForceFoundMessage = " was a searchbot most likly MediaForce and was temporarily banned. ()"
-- User Registration
sCmdReg = "-regme"
sEmailAddress = "YourHUB@Whatever.com"
sRegistrationHelpMessage = "***WARNING***\r\nBy registering to join this hub you agree that you are joining a PRIVATE NETWORK where the rules and policies are created by the network owner.\r\n"..
"You may NOT collect any statistics or log IP addresses for any purpose without explicit permission from the @HubOwner.\r\n"..
"You may NOT register to enter this hub if you are directly or indirectly affiliated with any law enforcement agency, The MPAA, The RIAA, The BSA, The SGAE or any other related organization.\r\n"..
"You may NOT register to enter this hub if you do not agree to these terms.\r\n\r\n"..
"ANY ATTEMPT TO ACCESS ANY INFORMATION ON THIS SERVER WITHOUT AGREEING TO THESE TERMS WILL BE CONSIDERED A 'HACK' AND VIOLATORS WILL BE PROSECUTED TO THE FULL EXTEND OF THE LAW!.\r\n\r\n"..
"To be registered into this HUB send one mail to: "..sEmailAddress.." with the following information:\r\n"..
"Your desired 'nick', your desired 'password', 'your country' and the server you want to be joined.\r\n"
-- Leech Blocker
bBlockSearches = 1 -- (0 = False, 1 = True)
aBlockSearchExceptions = { }
aToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}
LetLeech = {} -- This is an array of users nicks who are exempt to 'search and download' rule.
aLetLeech = { "zSearch[moglo]", "7www.glosearch.tk" } -- This is an array of nicks that are exempt like search bots.
sCmdLetLeech = "-letleech"
sWelcomeMessage = "Welcome to "..sHubName.." "..sHubDescription.." a part of Aracnidos Net. If you have some troubles, please contact us at: "..sEmailAddress.."\r\n\r\n"
sMessageToAliens = "*** WARNING***\r\n"..
"YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB.\r\n"..
"This hub will only accept search and download requests from registered users to prevent any unauthorized access from users such as (but not limited to members) of the MPAA, RIAA, BSA, etc; to gathering information from our users. If you really want to join us, please register your 'User Name' as soon as possible typing the following command '"..sCmdReg.."' into the main chat.\r\n"..
"I am sorry for the inconvenience but, by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n"..
"Thanks.\r\n"..sHubOwner.."\r\n"..
"This Annoying Message Will Stop After You Register Your Nick.\r\n"
sMessageToRegNicks = "This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users. "..
"I am sorry for the inconvenience but by taking this step. We are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n"..sHubOwner.."\r\n----------------------------\r\n"
sMessageNotifyLeech = "You are now authorized to download for one session."
sLeechError_NoUserName = "You must provide a Nick to grant a leech access to a user."
----------------------------------
-- Do not change anything below --
----------------------------------
function Main()
frmHub:RegBot(sBotName)
frmHub:EnableFullData(1)
local version = sBotName.." V:2.0 by [ES]latinmusic"
SendToAll(sBotName, "Script restarted.\r\n"..version..date(" launched at %B/%d/%Y. Local Time: %X.\r\n"))
if bBlockSearches == 0 then
for i,v in aToBlock do
if v == "^$Search%s+(%S+)" then aToBlock[i] = nil end
end
end
end
function NewUserConnected(curUser)
if bBlockMLDonkey == 1 then
-- Anti ML Donkey
for key,checkWord in aMLDonkeyDescriptions do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
if bLogMLDonkeyAttempt == 1 then
AppendFile("../Logs/MLDonkeyBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a MLDonkey Client. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sDisconnectMessage)
if iMLDonkeyAction == 1 then
curUser:Disconnect()
elseif iMLDonkeyAction == 2 then
curUser:TempBan()
elseif iMLDonkeyAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
end
if bBlockMediaForce == 1 then
-- Anti MediaForce
local foundMediaForce = 0
for key,checkWord in aMediaForceVersions do
if strfind(curUser.iVersion, checkWord, 1, 1) then
foundMediaForce = 1
end
end
if foundMediaForce == 0 then
for key,checkWord in aMediaForceShareAmount do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
foundMediaForce = 1
end
end
end
if foundMediaForce ~= 0 then
SendToAll (sBotName, gsub(gsub(sMediaForceFoundMessage, "", curUser.sName), "", curUser.sIP))
if bLogMediaForceAttempt == 1 then
AppendFile("../Logs/MediaforceBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a Mediaforce Bot. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sMediaForceFoundMessage)
if iMediaForceAction == 1 then
curUser:Disconnect()
elseif iMediaForceAction == 2 then
curUser:TempBan()
elseif iMediaForceAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
if curUser.iProfile ~= -1 then
curUser:SendData(sBotName, sWelcomeMessage)
else
curUser:SendData(sBotName, sWelcomeMessage)
curUser:SendPM(sBotName, sMessageToAliens)
end
end
function OpConnected(curUser)
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
function DataArrival(curUser, sData)
-- if Chat Cmd
if strsub(sData, 1, 1) == "<" then
local s, e, cmd, arg1 = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")
if not cmd == nil then
if strlower(cmd) == strlower(sCmdReg) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif strlower(cmd) == strlower(sCmdLetLeech) and curUser.bOperator then
if not arg1 == nil and arg1 ~= "" then
who = GetItemByName(arg1)
if not who then
curUser:SendData(sBotName, "The user '"..arg1.."' is not online.")
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, "The user '"..arg1.."' is already a registered user.")
else
LetLeech[arg1] = 1
SendToAll(sBotName, "The user '"..arg1.."' has been granted with an special leech license for one session.")
SendPmToOps(sBotName,"[MassMessage]?: Massive Message from: "..curUser.sName.."\r\n\r\nThe user '"..arg1.."' has been granted with an special leech license for one session.")
who:SendPM(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
-- Annoying message to send to users that havnt registered!
if strsub(strlower(sData), 1, 7) == strlower("$MyINFO") then
if (curUser.iProfile == -1) then
curUser:SendPM(sBotName, sMessageToAliens)
curUser:SendData(sBotName, sMessageToAliens)
end
return 1
end
-- See if data should be blocked:
for _,blockstring in aToBlock do
local _, _, who = strfind(sData, blockstring)
if who then return smBlock(curUser, sData, who) end
end
end
----------------------------
-- User Defined Functions --
----------------------------
function AppendFile(sFilePath, sData)
appendto(sFilePath)
write(sData.."\r\n")
writeto()
end
function smBlock(user, data, who)
local report
local profnam = GetProfileName(user.iProfile)
if profnam then
profnam = strlower(profnam)
else
profnam = "alien"
end
-- Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
-- Also, searches pass if they are in the exception list:
-- Data also passes if user is in LetLeech list:
if (user.iProfile ~= -1) or smMatchException(data) or IsInLeechList(user) or IsInaLeechList(user) then
report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
return nil
end
-- Alien (not registered) users get blocked:
local report = "\tBlocked from "..user.sName.." ("..profnam.."):\r\n\t"..data
return 1
end
function smMatchException(data)
if strfind (data, "^$Search%s+(%S+)") then
for _,exceptword in aBlockSearchExceptions do
if strfind (strlower(data), strlower(exceptword)) then
return 1
end
end
end
return nil
end
function IsInLeechList(user)
for i,v in LetLeech do
if i == user.sName then return 1 end
end
return nil
end
function IsInaLeechList(user)
for i,v in aLetLeech do
if i == user.sName then return 1 end
end
return nil
end
function SendDebug(sData)
SendPmToNick(sHubOwner, "Debug", sData)
return 1
end
function OnExit()
frmHub:UnregBot(sBotName)
end
Nice update [ES]latinmusic.
Gonna try it...
/NL
QuoteOriginally posted by NightLitch
Gonna try it...
Thanks man, i can test it now, so i need to see what happend with it, thanks a lot.
letleech fixed and tested.
-- HubSecure v2.0 -- for PtokaX TD4 by [ES]latinmusic on 11/19/03
--------------------------------------------------------------------------------
-- Based on HubSecure v1.0 created by Sid ([URL]http://www.1stleg.com[/URL]) 08/28/03
--
-- HubSecure is a script to prevent search bot access by companies like the MPAA, RIAA, and BSA.
-- This script will make your hub 100% safe from the prying eyes of these individuals until they
-- adopt sneakier and more illegal methods of privacy invasion.
--
-- The following files should be included:
-- HubSecure.lua - The main script file
-- PermBan.dat - A black list of all MPAA, RIAA, and BSA related ip's
-- Default Commands:
-- -letleech - Op Only
-- -regme
-- ********** MAIN CHANGES **********
-- Fixed succefully: Duplicate messages when a user connected into the HUB.
-- Fixed succefully: Some messages were not diplayed before.
-- Fixed hope succefully: letleech command now should work as expected. Still need some test.
-- Some code have been rewrited, removed or added
-- The commands: !RegHelp and !Reg have been removed because a different procedure to be
-- a registered user in our net
-- letleech fixed by plop
-- letleech for 1 session fixed by plop
-- coffee served by [ES]latinmusic
----------------------
-- GLOBAL VARIABLES -- make changes here only
----------------------
-- Global Setup
sBotName = "![HubSecure]!?"
sHubName = frmHub:GetHubName()
sHubDescription = frmHub:GetHubDescr()
sHubAddress = "YourHUB@Whatever.no-ip.com"
sHubOwner = "@HubOwner"
-- Anti ML Donkey Setup
bBlockMLDonkey = 0 -- (0 = False, 1 = True)
bLogMLDonkeyAttempt = 1 -- (0 = False, 1 = True)
aMLDonkeyDescriptions = { "mldonkey", "mldc client", "Lyon 2003", "dc client" }
iMLDonkeyAction = 1 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sDisconnectMessage = "You are using unauthorized client software!\r\n"..
"Disconnecting..."
-- Anti MediaForce Setup
bBlockMediaForce = 1 -- (0 = False, 1 = True)
bLogMediaForceAttempt = 1 -- (0 = False, 1 = True)
aMediaForceVersions = {"1.0.25"}
aMediaForceShareAmount = {"18552221398"}
iMediaForceAction = 2 -- (0 = Nothing, 1 = Disconnect, 2 = TempBan, 3 = Ban)
sMediaForceFoundMessage = " was a searchbot most likly MediaForce and was temporarily banned. ()"
-- User Registration
sCmdReg = "-regme"
sEmailAddress = "YourHUB@Whatever.com"
sRegistrationHelpMessage = "***WARNING***\r\nBy registering to join this hub you agree that you are joining a PRIVATE NETWORK where the rules and policies are created by the network owner.\r\n"..
"You may NOT collect any statistics or log IP addresses for any purpose without explicit permission from the @HubOwner.\r\n"..
"You may NOT register to enter this hub if you are directly or indirectly affiliated with any law enforcement agency, The MPAA, The RIAA, The BSA, The SGAE or any other related organization.\r\n"..
"You may NOT register to enter this hub if you do not agree to these terms.\r\n\r\n"..
"ANY ATTEMPT TO ACCESS ANY INFORMATION ON THIS SERVER WITHOUT AGREEING TO THESE TERMS WILL BE CONSIDERED A 'HACK' AND VIOLATORS WILL BE PROSECUTED TO THE FULL EXTEND OF THE LAW!.\r\n\r\n"..
"To be registered into this HUB send one mail to: "..sEmailAddress.." with the following information:\r\n"..
"Your desired 'nick', your desired 'password', 'your country' and the server you want to be joined.\r\n"
-- Leech Blocker
bBlockSearches = 1 -- (0 = False, 1 = True)
aBlockSearchExceptions = { }
aToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}
LetLeech = {} -- This is an array of users nicks who are exempt to 'search and download' rule.
aLetLeech = { "zSearch[moglo]", "7www.glosearch.tk" } -- This is an array of nicks that are exempt like search bots.
sCmdLetLeech = "-letleech"
sWelcomeMessage = "Welcome to "..sHubName.." "..sHubDescription.." a part of Aracnidos Net. If you have some troubles, please contact us at: "..sEmailAddress.."\r\n\r\n"
sMessageToAliens = "*** WARNING***\r\n"..
"YOU ARE UNABLE TO SEARCH OR DOWNLOAD IN THIS HUB.\r\n"..
"This hub will only accept search and download requests from registered users to prevent any unauthorized access from users such as (but not limited to members) of the MPAA, RIAA, BSA, etc; to gathering information from our users. If you really want to join us, please register your 'User Name' as soon as possible typing the following command '"..sCmdReg.."' into the main chat.\r\n"..
"I am sorry for the inconvenience but, by taking this step we are ensuring that our users are safe from the prying eyes of these individuals.\r\n"..
"Thanks.\r\n"..sHubOwner.."\r\n"..
"This Annoying Message Will Stop After You Register Your Nick.\r\n"
sMessageToRegNicks = "This hub will only accept search and download requests from registered users to prevent any unauthorized users such as but not limited to members of the MPAA, RIAA, and BSA from gathering information from our users. "..
"I am sorry for the inconvenience but by taking this step. We are ensuring that our users are safe from the prying eyes of these individuals.\r\n\r\n"..
"Thank You\r\n"..sHubOwner.."\r\n----------------------------\r\n"
sMessageNotifyLeech = "You are now authorized to download for one session."
sLeechError_NoUserName = "You must provide a Nick to grant a leech access to a user."
----------------------------------
-- Do not change anything below --
----------------------------------
function Main()
frmHub:RegBot(sBotName)
frmHub:EnableFullData(1)
local version = sBotName.." V:2.0 by [ES]latinmusic"
SendToAll(sBotName, "Script restarted.\r\n"..version..date(" launched at %B/%d/%Y. Local Time: %X.\r\n"))
if bBlockSearches == 0 then
for i,v in aToBlock do
if v == "^$Search%s+(%S+)" then aToBlock[i] = nil end
end
end
end
function NewUserConnected(curUser)
if bBlockMLDonkey == 1 then
-- Anti ML Donkey
for key,checkWord in aMLDonkeyDescriptions do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
if bLogMLDonkeyAttempt == 1 then
AppendFile("../Logs/MLDonkeyBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a MLDonkey Client. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sDisconnectMessage)
if iMLDonkeyAction == 1 then
curUser:Disconnect()
elseif iMLDonkeyAction == 2 then
curUser:TempBan()
elseif iMLDonkeyAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
end
if bBlockMediaForce == 1 then
-- Anti MediaForce
local foundMediaForce = 0
for key,checkWord in aMediaForceVersions do
if strfind(curUser.iVersion, checkWord, 1, 1) then
foundMediaForce = 1
end
end
if foundMediaForce == 0 then
for key,checkWord in aMediaForceShareAmount do
if strfind(curUser.sMyInfoString, checkWord, 1, 1) then
foundMediaForce = 1
end
end
end
if foundMediaForce ~= 0 then
SendToAll (sBotName, gsub(gsub(sMediaForceFoundMessage, "", curUser.sName), "", curUser.sIP))
if bLogMediaForceAttempt == 1 then
AppendFile("../Logs/MediaforceBot_"..date("%m-%d-%y")..".txt", curUser.sName.." ("..curUser.sIP..") was detected as a Mediaforce Bot. Version: "..curUser.iVersion.." MyInfo: "..curUser.sMyInfoString)
end
curUser:SendData(sBotName, sMediaForceFoundMessage)
if iMediaForceAction == 1 then
curUser:Disconnect()
elseif iMediaForceAction == 2 then
curUser:TempBan()
elseif iMediaForceAction == 3 then
curUser:Ban()
else
-- Do Nothing
end
end
end
if curUser.iProfile ~= -1 then
curUser:SendData(sBotName, sWelcomeMessage)
else
curUser:SendData(sBotName, sWelcomeMessage)
curUser:SendPM(sBotName, sMessageToAliens)
end
end
function OpConnected(curUser)
curUser:SendData(sBotName, sWelcomeMessage..sMessageToRegNicks)
end
function DataArrival(curUser, sData)
-- if Chat Cmd
if strsub(sData, 1, 1) == "<" then
sData=strsub(sData,1,strlen(sData)-1)
local s, e, cmd = strfind(sData, "%b<>%s(%S+)")
if cmd ~= nil then
if strlower(cmd) == strlower(sCmdReg) then
curUser:SendPM(sBotName, sRegistrationHelpMessage)
return 1
elseif strlower(cmd) == strlower(sCmdLetLeech) and curUser.bOperator then
local s,e,arg1 = strfind(sData, "%b<>%s%S+%s(%S+)")
if arg1 ~= nil then
who = GetItemByName(arg1)
if not who then
curUser:SendData(sBotName, "The user '"..arg1.."' is not online.")
elseif who.iProfile ~= -1 then
curUser:SendData(sBotName, "The user '"..arg1.."' is already a registered user.")
else
LetLeech[arg1] = 1
SendToAll(sBotName, "The user '"..arg1.."' has been granted with an special leech license for one session.")
SendPmToOps(sBotName,"[MassMessage]?: Massive Message from: "..curUser.sName.."\r\n\r\nThe user '"..arg1.."' has been granted with an special leech license for one session.")
who:SendPM(sBotName, sMessageNotifyLeech)
end
else
curUser:SendData(sBotName, sLeechError_NoUserName)
end
return 1
end
end
end
-- Annoying message to send to users that havnt registered!
if strsub(strlower(sData), 1, 7) == strlower("$MyINFO") then
if (curUser.iProfile == -1) then
curUser:SendPM(sBotName, sMessageToAliens)
curUser:SendData(sBotName, sMessageToAliens)
end
return 1
end
-- See if data should be blocked:
for _,blockstring in aToBlock do
local _, _, who = strfind(sData, blockstring)
if who then return smBlock(curUser, sData, who) end
end
end
function UserDisconnected(curUser)
if LetLeech[curUser.sName] then
LetLeech[curUser.sName] = nil
end
end
----------------------------
-- User Defined Functions --
----------------------------
function AppendFile(sFilePath, sData)
appendto(sFilePath)
write(sData.."\r\n")
writeto()
end
function smBlock(user, data, who)
local report
local profnam = GetProfileName(user.iProfile)
if profnam then
profnam = strlower(profnam)
else
profnam = "alien"
end
-- Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
-- Also, searches pass if they are in the exception list:
-- Data also passes if user is in LetLeech list:
if (user.iProfile ~= -1) or smMatchException(data) or IsInLeechList(user) or IsInaLeechList(user) then
report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
return nil
end
-- Alien (not registered) users get blocked:
local report = "\tBlocked from "..user.sName.." ("..profnam.."):\r\n\t"..data
return 1
end
function smMatchException(data)
if strfind (data, "^$Search%s+(%S+)") then
for _,exceptword in aBlockSearchExceptions do
if strfind (strlower(data), strlower(exceptword)) then
return 1
end
end
end
return nil
end
function IsInLeechList(user)
for i,v in LetLeech do
if i == user.sName then return 1 end
end
return nil
end
function IsInaLeechList(user)
for i,v in aLetLeech do
if i == user.sName then return 1 end
end
return nil
end
function SendDebug(sData)
SendPmToNick(sHubOwner, "Debug", sData)
return 1
end
function OnExit()
frmHub:UnregBot(sBotName)
end
plop
i remember there were a couple ppl who asked me 2 mod this bot a little bit.
just who and what was it i had 2 change?????
latinmusic/divxjunkie were 2 of them.
gues i'm getting old lol
plop
Well, wait a lite there plop, yesterday you saw the lite version and also you fix some bugs there, it will be posted here and after that you can do something about it, could be totally cool.