Need a Nick/ip
 

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

Need a Nick/ip

Started by Themaster, 05 January, 2005, 20:40:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

Need a script that do some log of connected user like

+getnick -- The nick name and ip and the connected on / off time
+showall -- Show's all name and ip..
and last i do have a clear function...and i want it to clear on a week example !

i Do Realy need it  ;(
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

#1
Help...i can't get it to save to fil
There are no Error on it

UserInfo = {}
Log = "UserLog.dat"

function Main()
   LoadFromFile(Log)
end

function OnExit()
   SaveToFile(MyInfoFile , UserInfo , "UserLog")
end

function SaveUserInfo()
   SaveToFile(MyInfoFile , UserInfo , "UserLog")
end

function NewUserConnected(user,data)
   local tLogins = 1
   local tmp = UserInfo[user.sName]
   if tmp then
      tLogins = tmp["LOGINS"]+1
   end
   UserInfo[user.sName] = {["IP"]=user.sIP,["PROFILE"]=user.iProfile,["TIME"]=GetTime,["MYINFO"]=user.sMyInfoString,["ONLINE"]="YES",["LOGINS"]=tLogins}
end

function UserDisconnected(user,data)
   local tmp = UserInfo[user.sName]
	if tmp then
		UserInfo[user.sName] = {["IP"]=user.sIP,["PROFILE"]=user.iProfile,["TIME"]=GetTime,["MYINFO"]=user.sMyInfoString,["ONLINE"]="NO",["LOGINS"]=tmp["LOGINS"]}
	end
end

OpConnected = NewUserConnected
OpDisConnected = UserDisconnected

function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");
	sTab = sTab or "";
	sTmp = ""
	sTmp = sTmp..sTab..sTableName.." = {\n"
	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end
		sTmp = sTmp..",\n"
	end
	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(file)
	if (readfrom(file) ~= nil) then
		readfrom(file)
		dostring(read("*all"))
		readfrom()
	end
end
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

convert table to string as you would define it, otherwise won't work.
Everything could have been anything else and it would have just as much meaning.

Themaster

i can't get it to work wright :s please help me on it
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

blackwings

well, here is a IP/Nick logger that saves the Nick + IP of users. Themaster, you can now just add the comands(+ what they should do) and a function that loads from file.

--//IP/Nick Logger - Made by blackwings


Bot = "ipNick-Logger" 

--------------------------------------------------------------------------------------------------
function DataArrival(user,data)
	if (strsub(data, 1, 8) == "$Version") then
		msg = "["..date("%T").."] - <"..user.sName.."><"..user.sIP..">"		
		StoreLog(user.sName, msg)	
	end
end
--------------------------------------------------------------------------------------------------
function StoreLog(nick, msg)
   local sDate = gsub(date("%x"), "%D", "-")
   appendto("IPNickLogger/"..sDate.."-ipNick.log")
   write(msg.."\n")
   writeto()
   msg = nil
end
--------------------------------------------------------------------------------------------------


Themaster

hmmm i can't get any thing work's ;(
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

#6
i can't get it wright have try to do it....: ?(  Don't no have to do it any more....plz..help me on it
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

#7
i try to make this now...But it want do anything please help on it

UserInfo = {}

sOffline = "UserLog.lst"

function NewUserConnected(user,data)
   LogInfo(user)
end

LogInfo = function(user)
	dofile(sOffline)
   UserInfo[""..strlower(user.sName)..""] = {["IP"]=user.sIP,["PROFILE"]=user.iProfile,["MYINFO"]=user.sMyInfoString,["Seen"]=date("%m/%d/%y"),}
   Save_File(sOffline, UserInfo , "UserInfo")
	return 1
end

function UserInfo()
   writeto("Blade/lst/sOffline.lst")
   for a,b in sOffline do
      write(a.."\n")
   end
   writeto()
end

function LoadUserLog()
   readfrom("Blade/lst/sOffline.lst")
   while 1 do
      local line = read()
      if line == nil then 
         readfrom()
         break 
      end
      UserLog[line] = 1
   end 
end

i'm stuck on it i can't get it right :s I'm Realy lost...please help
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

i realy need some help on that script Nothin work on it HELP ME!!!!!!
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

Can't Get it functionel PLEASE help me out
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

K...No have some thing's 2 say :s
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

SMF spam blocked by CleanTalk