PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Jonathan on 08 February, 2004, 21:42:18

Title: Hub file check script??
Post by: Jonathan on 08 February, 2004, 21:42:18
Hallo.

Can anyone help me with a script that cheack for a file on the harddrive like C:\Program Files\test.exe, and if the file exist should the user be kicked with a text, but it shall not kick or do something to Operators or Admins.


Thanks. Jonathan
Title:
Post by: nErBoS on 08 February, 2004, 22:15:57
Hi,

I think this is what you are looking for...

-- 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
user:SendData(Bot, "Reason: "..Reason)
user:SendData(Bot, "File: "..path.. ".")
user:SendData(Bot, "Disconnecting....")
user:Disconnect()
user:TempBan()
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

But I recomend you to use DCk++ it's better :)

Best regards, nErBoS
Title:
Post by: Jonathan on 08 February, 2004, 22:32:44
No this file check should not check in share but for a file on harddrive only if you know what i meen :)

And there can I Download DCk++ ?

Thanks

Jonathan
Title:
Post by: kepp on 08 February, 2004, 22:38:43
well, you can't check a file on a person hardrive unless he shares it..
Title:
Post by: [NL]trucker on 08 February, 2004, 22:50:14
Kepp

i,m impressed with the looks of x-ray can we see more?
Title:
Post by: kepp on 08 February, 2004, 23:24:33
QuoteOriginally posted by [NL]trucker
Kepp

i,m impressed with the looks of x-ray can we see more?


Yes, i will just clean my *.lua code up a bit and add some more features to the application..
just not to forget that my *.lua knowledge is still pretty porr, though, Learning FSO (FileSystemObject) and winsoket controls in VB is fun..

untill then i can only offer pictures :)
Title:
Post by: nErBoS on 09 February, 2004, 00:34:28
Hi,

You can get DCk++ HERE (http://www.ukdnb.dsl.pipex.com/dcpluspluskcdm/)

Best regards, nErBoS