PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: DorianG on 30 March, 2004, 00:52:22

Title: Problem With the function $SR and $Search with users in Passive Mode
Post by: DorianG on 30 March, 2004, 00:52:22
Hi to all. Gui i have a little problem with this scrips...

BotName = "?Anti-Illegal_Files?"

function Main()
frmHub:UnRegBot(BotName);
end

Files = {
["F?F?0?1?windowsshell.manifest"]=" Don?t share Your WINDOWS Folders! t.ex C:\WINDOWS",
["F?F?0?1?explorer.scf"]=" Don?t share Your WINDOWS Folders! t.ex C:\WINDOWS",
["F?F?0?1?iexplorer.exe"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?MSIMGSIZ.DAT"]=" Don?t share Your Program/Files ore Windows Folders.",
["F?F?0?1?wab32res.dll"]=" Don?t share Your Program/Files ore Windows Folders.",
["F?F?0?1?wmplayer.exe"]=" Don?t share Your Program/Files ore Windows Folders.",
["F?F?0?1?mssoapr.dll"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?drmv2.lic"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?IEXPLORE.EXE"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?compmgmt.msc"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?taskman.exe"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?hmmapi.dll"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?winipcfg.exe"]=" Don?t share Your Program/Files Ore Windows Folders.",
["F?F?0?1?Qages DC Network Hacks.exe"]=" Don?t share DC Hack program!!.",
["F?F?0?1?Dc and dc++ hack.zip"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?QAGES_DC_NETWORK_HACKS.ZIP"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?Qages DC Network Hacks.rar"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?Qages DC Network Hacks.zip"]="Don?t share DC Hack ore share faker program!!.",
["F?F?0?1?Qages DC Network Hacks(1).exe"]=" DDon?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DC Hack.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DC Hack (1).exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.163!BLUE Share Faker v1.03.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.162 Share Faker v1.02.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.171 Share Faker v1.01.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.154 Share Faker v1.03.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.16 Share Faker v1.02.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.161 Share Faker v1.02.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.172 Share Faker v1.01.exe"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?Qagesfakkerdll.dll"]=" Don?t share DC Hack Ore share faker program!!.",
["F?F?0?1?DCPP 0.16 Share Faker v1.02.exe"]=" DDon?t share DC Hack ore share faker program!!.",
["F?F?0?1?rrcm.dll"]="Don?t share installed netmeeting",
["F?F?0?1?cimwin32.dll"]="Don?t share installed win",
["F?F?0?1?win.ini"]="Don?t share windows folder!",
["F?F?0?1?part.met"]="Don?t share incomplete files!",
["F?F?0?1?.tmp"]="Don?t share temp files!",
["F?F?0?1?.getright"]="Don?t share incomplete files!",
["F?F?0?1?.vob"]="Don?t share vob files!",
["F?F?0?1?.temp"]="Don?t share temp files!",
["F?F?0?1?share faker"]="Don?t share tools to share fake!",
["F?F?0?1?share hacker"]="Don?t share tools to share fake!",
["F?F?0?1?.eml"]="Don?t share .eml files can be virus"
}

function Main()
frmHub:EnableSearchData(1)
end

Kicked = {}

function NewUserConnected(curUser)
if( Kicked[curUser.sName] == 1 ) then
Kicked[curUser.sName] = nil
end
for i,v in Files do
local lngBotNr = random(1, 100000)
curUser:SendData("$Search Hub:"..BotName..lngBotNr.." "..i)
end
end

function OpConnected(curUser)
if( Kicked[curUser.sName] == 1 ) then
Kicked[curUser.sName] = nil
end
for i,v in Files do
local lngBotNr = random(1, 100000)
curUser:SendData("$Search Hub:"..BotName..lngBotNr.." "..i)
end
end

function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
if (strsub(nick, 1, strlen(BotName)) == BotName and Kicked[curUser.sName] == nil ) then
Kicked[curUser.sName] = 1
Reason = FindWhat(data)
SearchPat = FindWhot(data)
SendPmToOps(OpChatName, "*** User "..curUser.sName.." kicked. Reason: "..Reason)
curUser:SendPM(BotName, "You are been kicked. "..Reason)
curUser:Disconnect()
end
end
end

function FindWhat(data)
local iFind = ""
for i,v in Files do
_,_,iFind = strfind(i, "%a%?%a%?%d%?%d%?(.+)")
--    iFind = i
if( strfind(strlower(data), strlower(iFind)) ) then
return v.." Filter matched on: "..data
end
end
return "Other files"
end

function FindWhot(data)
local iFind = ""
for i,v in Files do
_,_,iFind = strfind(i, "%a%?%a%?%d%?%d%?(.+)")
--    iFind = i
if( strfind(strlower(data), strlower(iFind)) ) then
return iFind
end
end
return "Other files"
end



My problem is that the bot not ban the users in passive mode.

Does Anybody know why?
Title:
Post by: nErBoS on 30 March, 2004, 01:42:56
Hi,

I don't belive that is bannig anyone because you have this in DataArrival...
curUser:Disconnect()if you want to to ban just use..
curUser:Ban()
About not baning passive users its because $SR only responds to active users.

Best regards, nErBoS
Title:
Post by: DorianG on 30 March, 2004, 02:19:09
i have write ban but i want write diconnect.. sorry
But the problem is that the bot disconnect only users in active mode
Title:
Post by: nErBoS on 30 March, 2004, 13:20:21
Hi,

I have already answer to that question..
QuoteAbout not baning passive users its because $SR only responds to active users.

Best regards, nErBoS
Title:
Post by: kp on 30 March, 2004, 14:04:38
well, its becuase

you do a passive search in your hub

e.g. $Search Hub ...

well and to passive searches only active clients can reply, so a good way to overun your bot would be, go passive mode ;).

To search as active you would need to use sockets...
I wrote a script for bcdc, to check the Search, well the client is in active mode of course.