Min Share Bot
 

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

Min Share Bot

Started by Swimate, 07 January, 2004, 13:00:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Swimate

Hello!

I'm want a script that:

- Search for files like the ones bellow

   Name: 1x01 - CHILDREN OF THE GODS.avi
   Size: 735.940.608 bytes

   Name: 1x02 - THE ENEMY WITHIN.avi
   Size: 367.489.024 bytes

- and kick the user if he don't have 6 of those files

This script is already modified to kick the user if he don't have the files, but I want to add the "exact size for the file" and the "number of matches"

-- Simple Illegalist v0.1
-- Created by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modificed by Leo (for music hub)
-- Modified by nErBoS

Bot = "(-Alexandra-)"

Files = {
[".dll"]="No .dll files in this hub, hang on!",
[".exe"]="No .exe files in this hub, hang on!",
[".dat"]="No .dat files in this hub, hang on!",
[".sys"]="No .sys files in this hub, hang on!",
[".ini"]="No .ini files in this hub, hang on!",
[".ocx"]="No .ocx files in this hub, hang on!"
}

Kicked = {}

function NewUserConnected(user)
   frmHub:EnableSearchData(1)
   if( Kicked[user.sName] == 1 ) then
      Kicked[user.sName] = nil
   end
   for i,v in Files do
   user:SendData("$Search Hub:"..Bot.." F?F?0?1?"..i)
   end
end


function DataArrival(user, data)
      if( strsub(data, 1, 3) == "$SR" ) then
      _,_,nick = strfind( data, "\05(%S*)|$" )
      local s = 5 + strlen(user.sName)
      local e = strfind(data, "%d+%s%d+/%d+") - 2
      local path = strsub(data, s, e)
      if( nick == Bot and Kicked[user.sName] == nil ) then
      Kicked[user.sName] = 1
      Reason = FindWhat(data)
      if (Reason == "Other files") then return end
      else
      user:SendData(Bot, "N?o tens os ficheiros obrigat?rios para ter no share.")
      user:SendData(Bot, "Desconnectando...")
      user:Disconnect()
      end
      end
end

function FindWhat(data)
   for i,v in Files do
   if( strfind(strlower(data), i) ) then
   return v
   end
   end
   return "Other files"
end

plop

i personaly hate scripts like these, there not fail proof.
1 of the reasons it can screw up is with users with big shares.
scripts like these cause a search spam witch makes the client ignore the search, result you'll never get 6 files and the user flyes out whether he has 6 or more.
better 2 have some good OP's 2 do this task.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

c h i l l a

+ one can only check. active users...
and I hate it when comming in ahub and getting sharechecked, so do you want your users to go passive?

or soon people will start blocking a searches comming to their client...

SMF spam blocked by CleanTalk