Please help with Leechblocker
 

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

Please help with Leechblocker

Started by Spudman, 15 November, 2003, 16:09:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spudman

I am using Leechblocker V2, but it dont block all users, it blocks some, but only half at the most. I know other hubs use this and have no problems, so maybe I am doing something to cause this script to fail? But as I said, it does work with some users???

Please help, fresh out of Ideas!!

I am running Ptokax V0.3.2.6 TD4, Robocop V4.0 and Leechblocker V2.

If you dont know what is wrong, maybe there is a better script for only allowing registered users to download file lists and files.

Thanks for any help.

Spud

DarkElf


---------------------
-- 
LEECHBLOCKER 02 --    for PtokaX TD4
---------------------
-- 
Created by SAMPLERman HUBsamplerman.no-ip.info
-- 5/August/2003
-- Based on an idea by OpiumVolage and RabidWombat
-- And thanks AGAIN to RabidWombat for new ideas

-- This LUA script prevents users that are not registered in the hub (=aliens)
-- 
from connecting to other users (for downloading).
-- New 
users (=alienscan chatupload and be searchedThey just can't download.

-- This way your previously private hub can again be public.

-- Optionally, the script also blocks searches (from nonregged users).
-- However, it is recommended that you allow everyone to search your hub, so that
-- new users know what they are missing.

-- NEW in version 02:
-- To allow an alien to download for 1 session, OPs can type this command:
-- !letleech <username>

-- To do for next version:
-- Optionally, aliens can download off of other aliens

-- There are 2 kinds of hubs:
-- 1) Open hubs for sharing anything
-- 2) Small hubs that concentrate on a special interest (e.g. classical sheet music)

-- This script is NOT recommended for hub kind #1, where it is enough to
-- control how many GB users are sharing.
-- Because in hub type #1 there is no point in registering users, this script
-- should be adapted to make shared amount the criteria for letting download.
-- Even better, for hub type #1 users who share little should be allowed to download
-- from other people who share little.
-- Freedom is a strength of the Direct Connect community; please do not cut into
-- people'
s freedom except when absolutely necessary.
-- 
This script is only for closed hubs with a very specific subject.

-------------------------------
-- 
SOURCES OF SCRIPTING INFO --
-------------------------------
-- 
Scripting.txt (comes with PtokaX)
-- [
URL]http://lua.bcs-solutions.de/[/URL]
-- LUA reference manual 4.0.pdf

----------------------
-- GLOBAL 
VARIABLES --  make changes here only
----------------------
smDebugging       "0"   -- Default is "0" (silent mode). "1" sends msgs to OPs
smBlockSearches   
"0"   -- Default is "0" (do not block searches)
smBlockSearchExceptions = { "scores""sheet music" }

MsgToAliens "\t\t\t*** warning***\r\n\t"..
            
"YOU ARE UNABLE TO DOWNLOAD IN THIS HUB\r\n\t"..
            
"Only registered users can download.\r\n\t"..
            
"You still can search and chat...\r\n\t"..
            
"...but the hub won't let you download until you register.\r\n"..
            
"\tIn order to become a registered member:\r\n\t"..
            
"1) Share classical sheet music in a separate folder called SCORES\r\n\t"..
            
"2) only then, ask an OP for a password.\r\n\t"..
            
"We hope you will join us."

LetLeechCommand "!letleech"

----------------------------------
-- Do 
not change anything below --
----------------------------------
smBot frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware;
                               -- 
thereforeyour Hub Bot should be enabled.

ToBlock = { "^$ConnectToMe%s(%S+)""^$RevConnectToMe%s(%S+)""^$Search%s+(%S+)"}
LetLeech = {}

--
// This function is called when hub or script starts
function Main()
  
frmHub:EnableFullData(1)
  
frmHub:UnregBot(smBot)
  
frmHub:RegBot(smBot)
  --
// If thus configured, remove search from blocking table:
  
if smBlockSearches == "0" then
    
for i,v in ToBlock do
      if 
== "^$Search%s+(%S+)" then ToBlock[i] = nil end
    end
  end
end

--// This function is fired when a new user (non-OP) finishes login
function NewUserConnected(user)
  if 
user.iProfile == -1 then
    user
:SendPM(smBot,"\r\n"..MsgToAliens)
  
end
end

--// This function is fired when new data arrives
function DataArrival (userdata)

  --
// See if data is the !letleech command:
  
if strsub(data11) == "<" then
    local line
=strsub(data,1,strlen(data)-1)  -- remove last char
    local s
,e,cmd strfind(line"%b<>%s+(%S+)")
    
local s,e,arg strfind(line"%b<>%s+%S+%s+(%S+)")
    if 
strlower(cmd)==strlower(LetLeechCommandthen
      
if user.iProfile ~= and user.iProfile ~= 1 then
        SendToAll
(smBot"...but you are not an OP!")
        return 
nil
      end
      who 
GetItemByName(arg)
      if 
not who then
        SendToOps
(smBotarg.." is not online.")
        return 
1
      end
      
if who.iProfile ~= -1 then
        SendToOps
(smBotarg.." is registered and does not need a leech license.")
        return 
1
      end
      LetLeech
[arg] = 1
      SendToOps
(smBot,arg.." has been granted a special leech license.")
      
who:SendData(smBot,arg..", you are now authorized to download for this session.")
      return 
1
    end
  end

  
--// See if data should be blocked:
  
for _,blockstring in ToBlock do
    
local __who strfind(datablockstring)
    if 
who then return smBlock(user,data,whoend
  end
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(userthen
    report 
"\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
    smDebugToOPs
(report)
    return 
nil
  end
--// Alien (not registered) users get blocked:
  
local report "\tBlocked from "..user.sName.." ("..
        
profnam.."):\r\n\t"..data
  smDebugToOPs
(report)
  return 
1
end

function smMatchException(data)
  if 
strfind (data"^$Search%s+(%S+)"then
    
for _,exceptword in smBlockSearchExceptions 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 
== user.sName then return 1 end
  end
  
return nil
end

function smDebugToOPs(data)
  if 
smDebugging == "1" then
    SendToOps
(smBot,data)
  
end
end


Try this...
Please sorry my bad english, i'm learning it :-D

\\100Gb ][ MeGaShArE @ I?? - ?u?i?N Owner [/I]
100gb.ifs-fusion.net:666 Only EliTe ShArE min 100gb
-={ I?? - ?u?i?N }=- N??Owner

Spudman

Ok, I have been trying this but get syntax errors if copied as you have put it. I dont get syntax errors when I delete the from the end. Now I get no errors, but it dont seem to be blocking users??

SMF spam blocked by CleanTalk