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 ;(
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
convert table to string as you would define it, otherwise won't work.
i can't get it to work wright :s please help me on it
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
--------------------------------------------------------------------------------------------------
hmmm i can't get any thing work's ;(
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
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
i realy need some help on that script Nothin work on it HELP ME!!!!!!
Can't Get it functionel PLEASE help me out
K...No have some thing's 2 say :s
k...Never mind :s