Stat-logger lua 5 modified
 

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

Stat-logger lua 5 modified

Started by Loading, 25 June, 2005, 21:57:16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Loading

hi ppl
i have this script in my hub

--Lua 5 By Dessamator 

-- Stat-logger 0.3a

-- added !lastips(request by Penguin)



-- Stat-logger 0.3 by Troubadour 

-- created a seperated config file + gui



-- Stat-logger 0.2 by Troubadour 

-- to write all info to a file with the date of that day when users log in (name, e-mail, ip and share)

-- command for viewing the files is !

-- for example !280704 is the command to view the file of 28 juli 2004



-- Stat-logger 0.1 by Troubadour 

-- to write all info to a file when a user logs in (name, e-mail, ip and share)

-- command to view the file is !statlog



D = os.date("%d")

MM = os.date("%m")

Y = os.date("%y")

a={}



statlogfile = ("Data/"..D..""..MM..""..Y..".txt")

MaxLogins = 15



function Main() 

if io.open("Stat-logger03.cfg","r") then   -- is used for the settings

	dofile("Stat-logger03.cfg")

else

	BOTName = "?CIA??"

	Version = "?CIA??"

end

	frmHub:RegBot(BOTName)





	if not io.open("Data/check.dat","r") then

		os.execute("mkdir Data")

		io.output("Data/check.dat")

		io.close()

		io.output()

		
	end

	SendToAll(""..BOTName.." Iniciado a"..os.date("  %d/%m-%Y as %X ").."")

end 



function ChatArrival(user,data) 

	
data=string.sub(data,1,-2) 

s,e,cmd = string.find(data,"%b<>%s+(%S+)") 

local n,temp=0,"Os ultimos "..MaxLogins.." Users ke entraram\r\n"

	if cmd =="!lastips" then

		for line in io.lines("Data/"..D..""..MM..""..Y..".txt") do

			table.insert(a, line)

		end

		for i=table.getn(a),1, -1 do

			if n%s+(%S+)") 

cmd = string.sub(cmd, 2,string.len(cmd)) 

	if io.open("Data/"..cmd..".txt") then 

		showtext(user, cmd) 

		return 1 

	end 

	
end 





function OpConnected(user)

	description,email,share=MyInfoString(user.sMyInfoString)

	local share2 = string.format("%0.2f",(share / (1024*1024*1024)))

	--SendToAll("Stat-logger",user.sName.." com o E-mail "..email..", com este IP "..user.sIP.." E com este Share "..share2.." Gb")

	statlogfile = ("Data/"..D..""..MM..""..Y..".txt")

	file=io.open(statlogfile,"a+") 

	file:write("\t","No dia "..os.date("%d").."."..os.date("%m").."."..os.date("%y").." - "..os.date("%H")..":"..os.date("%M").." - "..user.sName.." com o E-mail : "..email..", com este IP : "..user.sIP.." E com este Share : "..share2.."Gb Conectou-se a este hub \r\n")

	file:close()



end



NewUserConnected = OpConnected



function MyInfoString(data)

	s,e,description,nada,email,share = string.find(data, "$MyINFO $ALL ([^$]+)$ $([^$]*)$([^$]*)$([^$]+)") 

	return description,email,share

end





function showtext(user, cmd) 

	lines = "\r\n\r\n" 
	for line in io.lines("Data/"..cmd..".txt") do 

		if line == nil then 

		break 

		end 

		lines = lines..line.."\r\n" 
	end 

	io.close()

	user:SendPM(BOTName, lines) 

end

it works fine but i have another one
i have 2 more commnds :   !clearlogs  and   !searchlog

can anybody put these comands in this script ?


best regards

Loading

Dessamator

Ignorance is Bliss.

Loading

thanks man
i will shek if it works im my hub

best regards

Loading

SMF spam blocked by CleanTalk