PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: kepp on 22 March, 2004, 23:18:44

Title: The Search-Tracker
Post by: kepp on 22 March, 2004, 23:18:44
--# Made by kepp
sBot = "Search-Tracker"

sAny = 0
sAudio = 0
sCompressed = 0
sDocuments = 0
sExe = 0
sPictures = 0
sVideos = 0
sFolders = 0

sTotal = 0


function Main()
frmHub:RegBot(sBot)
frmHub:EnableSearchData(1)
end


function DataArrival(user, data)
if strsub(data,1,7) == "$Search" then
if strfind(data,"F?T?0?1?") then
sAny = sAny + 1
elseif strfind(data,"F?T?0?2?") then
sAudio = sAudio + 1
elseif strfind(data,"F?T?0?3") then
sCompressed = sCompressed + 1
elseif strfind(data,"F?T?0?4?") then
sDocument = sDocument + 1
elseif strfind(data,"F?T?0?5?") then
sExe = sExe + 1
elseif strfind(data,"F?T?0?6?") then
sPictures = sPictures + 1
elseif strfind(data,"F?T?0?7?") then
sVideos = sVideos + 1
elseif strfind(data,"F?T?0?8?") then
sFolders = sFolders + 1
end
end
if strsub(data,1,1) == "<" then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="+searches") then
Display_Them(user, data) return 1
end
end
end

function Display_Them(user, data)
sTotal = sAny + sAudio + sCompressed + sDocuments + sExe + sPictures + sVideos + sFolders
local disp = ""
disp = disp.."\r\n\r\n"
disp = disp.."Search Statistic :\r\n"
disp = disp.."Any :: "..sAny.."\r\n"
disp = disp.."Audio :: "..sAudio.."\r\n"
disp = disp.."Compressed :: "..sCompressed.."\r\n"
disp = disp.."Documents :: "..sDocuments.."\r\n"
disp = disp.."Exe's :: "..sExe.."\r\n"
disp = disp.."Pictures :: "..sPictures.."\r\n"
disp = disp.."Videos :: "..sVideos.."\r\n"
disp = disp.."Folders :: "..sFolders.."\r\n"
disp = disp.."Total Amount :: "..sTotal.."\r\n"
user:SendPM(sBot,disp)
end