PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: dragos_sto on 12 April, 2005, 16:06:28

Title: userinfo help
Post by: dragos_sto on 12 April, 2005, 16:06:28
i found this userinfo for lua 5 , but have an error at line 191 ,some one kant help me pls

[code]-- Simple Offline Info by NightLitch

-- Commands is sent in Main-Chat

-- Create folder UserInfo



-- BotName --

BotName = "Shantz_Info"

-- Prefix --

Prefix = "+"



--Command--

cmd1 = "userinfo"

-- Tables --

Temp = {}

Info = {}

-- Info Path --

InfoLog = "UserInfo/"



-- New User Connected --

function NewUserConnected(curUser,data)

LogInfo(curUser)

end

-- Data Arrival --

function DataArrival(curUser, data)

if strsub(data, 1, 1) == "<" then

data = strsub(data,1,strlen(data)-1)

if (GetCom(curUser,data) == 1) then

return 1

else

return 0

end

end

end

-- Get Command --

function GetCom(curUser,data)

local _,_,cmd = strfind(data,"^%b<>%s+%"..Prefix.."(%S+)")

if cmd then

if IPCommand[cmd] and curUser.iProfile==0 then

local Com = IPCommand[cmd](curUser,data)

return 1

end

end

end

-- Commands --

IPCommand = {

[cmd1] = function(curUser,data)

local _,_,nick = strfind( data,"%b<>%s+%S+%s+(%S+)")

if (nick == nil or nick == "") then

curUser:SendData(BotName,"Syntax: "..Prefix..cmd1.." ")

return 1

end

local IP, Profile, MyInfo = GetInfo(nick)

if IP==0 and Profile==0 and MyInfo==0 then

curUser:SendData(BotName,"User not found.")

return 1

end

ClientTAG = {

{ "
{ "
{ "
{ "
{ "zDC++","zDC++" },{ "","MS++V" },

{ "","MS++V" },{ "
{ "<.P>","Phantom DC++" },}

local _,_,Nick = strfind( MyInfo, "^%$MyINFO %$ALL (%S+)%s*")

local _,_,Speed,Share = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )

local _,_,Slots = strfind( MyInfo, "S:(%d+)")

local _,_, Ver,Mode = strfind(MyInfo,"V:(%S+),M:([S,A,P])")

local_,_, Hubs = strfind(MyInfo,"H:(%x+)")

local Client = "Unknown"

for i = 1,getn(ClientTAG) do

if strfind(MyInfo,ClientTAG[1]) then

Client = ClientTAG[2]

end

end

local line = "\r\n"

line = line .. "\r\nUser Info on: "..Nick

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\nIP: "..IP

line = line .. "\r\nClient: "..Client

line = line .. "\r\nVersion: "..Ver

line = line .. "\r\nMode: "..Mode

line = line .. "\r\nHubs: "..Hubs

line = line .. "\r\nSlots: "..Slots

line = line .. "\r\nSpeed: "..Speed

line = line .. "\r\nShare: "..format("%.2f",Share/1024/1024/1024)

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\n --------------------------------------------------------------------"

curUser:SendData(BotName,line)

end,



}



-- Log Users Info --

function LogInfo(curUser)

Info[strlower(curUser.sName)] = {["IP"]=curUser.sIP,["PROFILE"]=curUser.iProfile,["MYINFO"]=curUser.sMyInfoString,}

SaveToFile(InfoLog..strlower(curUser.sName)..".dat" , Info , "Info")

Info = nil

Info = {}

collectgarbage()

flush()

return 1

end

-- Get Info --

function GetInfo(nick)

LoadFromFile(InfoLog..strlower(nick)..".dat")

local usr = Info[strlower(nick)]

if usr then

IP = usr["IP"]

Profile = usr["PROFILE"]

MyInfo = usr["MYINFO"]

return IP,Profile, MyInfo

else

return 0,0,0

end

end

-- Serialize --

function Serialize(tTable, sTableName, hFile, sTab)

assert(tTable, "tTable equals nil");

assert(sTableName, "sTableName equals nil");

assert(hFile, "hFile equals nil");



assert(type(tTable) == "table", "tTable must be a table!");

assert(type(sTableName) == "string", "sTableName must be a string!");



sTab = sTab or "";



write(hFile, 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

Serialize(value, sKey, hFile, sTab.."\t");

else

local sValue = (type(value) == "string") and format("%q",value) or tostring(value);

write(hFile, sTab.."\t"..sKey.." = "..sValue);

end



write(hFile, ",\n");

end



write(hFile, sTab.."}");

end

-- Save Table to File --

function SaveToFile(file , table , tablename)

local hFile = openfile(file, "w");

Serialize(table, tablename, hFile);

closefile(hFile);

end

-- Load Table From File --

function LoadFromFile (file)

assert(readfrom(file),file.." is not found.Generating new "..file..". All is fine. Don't panic.")

dostring(read("*all"))

readfrom()

end
[code]

error at line 191 when new user connect
Title:
Post by: ConejoDelMal on 12 April, 2005, 16:10:40
I believe this is lua 4... you have to convert it..
Title:
Post by: dragos_sto on 12 April, 2005, 16:25:17
hmm , i dont know so good lua language , i convert to lua 5 whit convertor from lua 4 to lua 5 , and now i have the error to line 255

new code after conversion
-- Simple Offline Info by NightLitch

-- Commands is sent in Main-Chat

-- Create folder UserInfo



-- BotName --

BotName = "Shantz_Info"

-- Prefix --

Prefix = "+"



--Command--

cmd1 = "userinfo"

-- Tables --

Temp = {}

Info = {}

-- Info Path --

InfoLog = "UserInfo/"



-- New User Connected --

function NewUserConnected(curUser,data)

LogInfo(curUser)

end

-- Data Arrival --

function DataArrival(curUser, data)

if string.sub(data, 1, 1) == "<" then

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

if (GetCom(curUser,data) == 1) then

return 1

else

return 0

end

end

end

-- Get Command --

function GetCom(curUser,data)

local _,_,cmd = string.find(data,"^%b<>%s+%"..Prefix.."(%S+)")

if cmd then

if IPCommand[cmd] and curUser.iProfile==0 then

local Com = IPCommand[cmd](curUser,data)

return 1

end

end

end

-- Commands --

IPCommand = {

[cmd1] = function(curUser,data)

local _,_,nick = string.find( data,"%b<>%s+%S+%s+(%S+)")

if (nick == nil or nick == "") then

curUser:SendData(BotName,"Syntax: "..Prefix..cmd1.." ")

return 1

end

local IP, Profile, MyInfo = GetInfo(nick)

if IP==0 and Profile==0 and MyInfo==0 then

curUser:SendData(BotName,"User not found.")

return 1

end

ClientTAG = {

{ "
{ "
{ "
{ "
{ "zDC++","zDC++" },{ "","MS++V" },

{ "","MS++V" },{ "
{ "<.P>","Phantom DC++" },}

local _,_,Nick = string.find( MyInfo, "^%$MyINFO %$ALL (%S+)%s*")

local _,_,Speed,Share = string.find( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )

local _,_,Slots = string.find( MyInfo, "S:(%d+)")

local _,_, Ver,Mode = string.find(MyInfo,"V:(%S+),M:([S,A,P])")

local_,_, Hubs = string.find(MyInfo,"H:(%x+)")

local Client = "Unknown"

for i = 1,table.getn(ClientTAG) do

if string.find(MyInfo,ClientTAG[i][1]) then

Client = ClientTAG[i][2]

end

end

local line = "\r\n"

line = line .. "\r\nUser Info on: "..Nick

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\nIP: "..IP

line = line .. "\r\nClient: "..Client

line = line .. "\r\nVersion: "..Ver

line = line .. "\r\nMode: "..Mode

line = line .. "\r\nHubs: "..Hubs

line = line .. "\r\nSlots: "..Slots

line = line .. "\r\nSpeed: "..Speed

line = line .. "\r\nShare: "..string.format("%.2f",Share/1024/1024/1024)

line = line .. "\r\n --------------------------------------------------------------------"

line = line .. "\r\n --------------------------------------------------------------------"

curUser:SendData(BotName,line)

end,



}



-- Log Users Info --

function LogInfo(curUser)

Info[string.lower(curUser.sName)] = {["IP"]=curUser.sIP,["PROFILE"]=curUser.iProfile,["MYINFO"]=curUser.sMyInfoString,}

SaveToFile(InfoLog..string.lower(curUser.sName)..".dat" , Info , "Info")

Info = nil

Info = {}

collectgarbage()

io.flush()

return 1

end

-- Get Info --

function GetInfo(nick)

LoadFromFile(InfoLog..string.lower(nick)..".dat")

local usr = Info[string.lower(nick)]

if usr then

IP = usr["IP"]

Profile = usr["PROFILE"]

MyInfo = usr["MYINFO"]

return IP,Profile, MyInfo

else

return 0,0,0

end

end

-- Serialize --

function Serialize(tTable, sTableName, hFile, sTab)

assert(tTable, "tTable equals nil");

assert(sTableName, "sTableName equals nil");

assert(hFile, "hFile equals nil");



assert(type(tTable) == "table", "tTable must be a table!");

assert(type(sTableName) == "string", "sTableName must be a string!");



sTab = sTab or "";



write(hFile, sTab..sTableName.." = {\n" );



for key, value in tTable do

local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);



if(type(value) == "table") then

Serialize(value, sKey, hFile, sTab.."\t");

else

local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);

write(hFile, sTab.."\t"..sKey.." = "..sValue);

end



write(hFile, ",\n");

end



write(hFile, sTab.."}");

end

-- Save Table to File --

function SaveToFile(file , table , tablename)

local hFile = io.open(file, "w");

Serialize(table, tablename, hFile);

io.close(hFile);

end

-- Load Table From File --

function LoadFromFile (file)

assert(readfrom(file),file.." is not found.Generating new "..file..". All is fine. Don't panic.")



readfrom()

end

Title:
Post by: TTB on 12 April, 2005, 16:51:26
Hmz... the file handlers should also be converted (I don't know how precisly)... Some day I will find out  :D

*edit* posted when the previous message wasn't read yet...
Title:
Post by: Oz on 18 April, 2005, 22:53:22
hmmm  nice script, but doesen't worl :(
Somone please help to correct errors :)
jitten help please ;)
Title:
Post by: jiten on 19 April, 2005, 12:47:26
Here you go (not tested):
-- Simple Offline Info by NightLitch
-- Converted to Lua 5 by jiten
-- Commands is sent in Main-Chat
-- Create folder UserInfo

-- BotName --
BotName = "Shantz_Info"
-- Prefix --
Prefix = "+"

--Command--
cmd1 = "userinfo"
-- Tables --
Temp = {}
Info = {}
-- Info Path --
InfoLog = "UserInfo/" -- Create this folder before starting the script

-- New User Connected --
function NewUserConnected(curUser,data)
LogInfo(curUser)
end

-- OpConnected = NewUserConnected -- Uncomment this line if u want to log OPs info

-- Data Arrival --
function ChatArrival(curUser, data)
data = string.sub(data,1,string.len(data)-1)
if (GetCom(curUser,data) == 1) then
return 1
else
return 0
end
end

-- Get Command --
function GetCom(curUser,data)
local _,_,cmd = string.find(data,"^%b<>%s+%"..Prefix.."(%S+)")
if cmd then
if IPCommand[cmd] and curUser.iProfile==0 then
local Com = IPCommand[cmd](curUser,data)
return 1
end
end
end

-- Commands --
IPCommand = {
[cmd1] = function(curUser,data)
local _,_,nick = string.find( data,"%b<>%s+%S+%s+(%S+)")
if (nick == nil or nick == "") then
curUser:SendData(BotName,"Syntax: "..Prefix..cmd1.." ")
return 1
end
local IP, Profile, MyInfo = GetInfo(nick)
if IP==0 and Profile==0 and MyInfo==0 then
curUser:SendData(BotName,"User not found in the logs.")
return 1
end
ClientTAG = {
{ " { " { " { " { "zDC++","zDC++" },{ "","MS++V" },
{ "","MS++V" },{ " { "<.P>","Phantom DC++" },}
local _,_,Nick = string.find( MyInfo, "^%$MyINFO %$ALL (%S+)%s*")
local _,_,Speed,Share = string.find( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local _,_,Slots = string.find( MyInfo, "S:(%d+)")
local _,_, Ver,Mode = string.find(MyInfo,"V:(%S+),M:([S,A,P])")
local_,_, Hubs = string.find(MyInfo,"H:(%x+)")
local Client = "Unknown"
for i = 1,table.getn(ClientTAG) do
if string.find(MyInfo,ClientTAG[i][1]) then
Client = ClientTAG[i][2]
end
end
local line = "\r\n"
line = line .. "\r\nUser Info on: "..Nick
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\nIP: "..IP
line = line .. "\r\nClient: "..Client
line = line .. "\r\nVersion: "..Ver
line = line .. "\r\nMode: "..Mode
line = line .. "\r\nHubs: "..Hubs
line = line .. "\r\nSlots: "..Slots
line = line .. "\r\nSpeed: "..Speed
line = line .. "\r\nShare: "..string.format("%.2f",Share/1024/1024/1024)
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\n --------------------------------------------------------------------"
curUser:SendData(BotName,line)
end,}

-- Log Users Info --
function LogInfo(curUser)
Info[string.lower(curUser.sName)] = {["IP"]=curUser.sIP,["PROFILE"]=curUser.iProfile,["MYINFO"]=curUser.sMyInfoString,}
SaveToFile(InfoLog..string.lower(curUser.sName)..".dat" , Info , "Info")
Info = nil
Info = {}
collectgarbage()
io.flush()
return 1
end

-- Get Info --
function GetInfo(nick)
LoadFromFile(InfoLog..string.lower(nick)..".dat")
local usr = Info[string.lower(nick)]
if usr then
IP = usr["IP"]
Profile = usr["PROFILE"]
MyInfo = usr["MYINFO"]
return IP,Profile, MyInfo
else
return 0,0,0
end
end

-- Serialize --
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 string.format("[%q]",key) or string.format("[%d]",key);
 
                if(type(value) == "table") then
                        sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
                else
                        local sValue = (type(value) == "string") and string.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)
local handle = io.open(file,"w+")
        handle:write(Serialize(table, tablename))
handle:flush()
        handle:close()
end

function LoadFromFile(file)
local handle = io.open(file,"r")
if (handle ~= nil) then
dofile(file)
handle:flush()
handle:close()
        end
end
Best regards,

jiten
Title:
Post by: ConejoDelMal on 19 April, 2005, 15:03:53
tested it and its working good :)
Title:
Post by: jiten on 19 April, 2005, 15:43:08
Goody :]
Title:
Post by: Oz on 19 April, 2005, 18:37:54
Big thanx ;)
Title:
Post by: dragos_sto on 19 April, 2005, 23:32:01
QuoteOriginally posted by jiten
Here you go (not tested):

good work and 10x a lot for help
Title:
Post by: jiten on 20 April, 2005, 07:20:31
yw guys
Title:
Post by: dragos_sto on 01 June, 2005, 19:31:56
some modification
same problem whit this script i have whit ip checker whit strong dc++ client
so , i make some modification
-- Simple Offline Info by NightLitch
-- Converted to Lua 5 by jiten
-- Commands is sent in Main-Chat
-- Create folder UserInfo

-- BotName --
BotName = frmHub:GetHubBotName().."_Info"
-- Prefix --
Prefix = "+"

--Command--
cmd1 = "userinfo"
-- Tables --
Temp = {}
Info = {}
-- Info Path --
InfoLog = "UserInfo/" -- Create this folder before starting the script

-- New User Connected --
function NewUserConnected(curUser,data)
LogInfo(curUser)
end

function OpConnected(curUser,data)
LogInfo(curUser)
end

-- OpConnected = NewUserConnected -- Uncomment this line if u want to log OPs info

-- Data Arrival --
function ChatArrival(curUser, data)
data = string.sub(data,1,string.len(data)-1)
if (GetCom(curUser,data) == 1) then
return 1
else
return 0
end
end

-- Get Command --
function GetCom(curUser,data)
local _,_,cmd = string.find(data,"^%b<>%s+%"..Prefix.."(%S+)")
if cmd then
if IPCommand[cmd] and curUser.iProfile==0 then
local Com = IPCommand[cmd](curUser,data)
return 1
end
end
end

-- Commands --
IPCommand = {
[cmd1] = function(curUser,data)
local _,_,nick = string.find( data,"%b<>%s+%S+%s+(%S+)")
if (nick == nil or nick == "") then
curUser:SendData(BotName,"Syntax: "..Prefix..cmd1.." ")
return 1
end
local IP, Profile, MyInfo = GetInfo(nick)
if IP==0 and Profile==0 and MyInfo==0 then
curUser:SendData(BotName,"User not found in the logs.")
return 1
end
local _,_,Nick = string.find( MyInfo, "^%$MyINFO %$ALL (%S+)%s*")
local _,_,Speed,Share = string.find( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local _,_,Slots = string.find( MyInfo, "S:(%d+)")
local _,_,Client,Ver,Mode = string.find(MyInfo,"<(%S+),V:(%S+),M:([S,A,P])")
local_,_, Hubs = string.find(MyInfo,"H:(%x+)")
local line = "\r\n"
line = line .. "\r\nUser Info on: "..Nick
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\nIP: "..IP
line = line .. "\r\nClient: "..Client
line = line .. "\r\nVersion: "..Ver
line = line .. "\r\nMode: "..Mode
line = line .. "\r\nHubs: "..Hubs
line = line .. "\r\nSlots: "..Slots
line = line .. "\r\nSpeed: "..Speed
line = line .. "\r\nShare: "..(string.format("%.2f",Share/1024/1024/1024).." GB")
line = line .. "\r\n --------------------------------------------------------------------"
line = line .. "\r\n --------------------------------------------------------------------"
curUser:SendData(BotName,line)
end,}

-- Log Users Info --
function LogInfo(curUser)
Info[string.lower(curUser.sName)] = {["IP"]=curUser.sIP,["PROFILE"]=curUser.iProfile,["MYINFO"]=buildmyinfo(curUser),}
SaveToFile(InfoLog..string.lower(curUser.sName)..".dat" , Info , "Info")
Info = nil
Info = {}
collectgarbage()
io.flush()
return 1
end

-- Get Info --
function GetInfo(nick)
LoadFromFile(InfoLog..string.lower(nick)..".dat")
local usr,IP,Profile,MyInfo = Info[string.lower(nick)],nil,nil,nil
if usr then
IP = usr["IP"]
Profile = usr["PROFILE"]
MyInfo = usr["MYINFO"]
return IP,Profile, MyInfo
else
return 0,0,0
end
end

-- Serialize --
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 "";
        local sTmp = ""
 
        sTmp = sTmp..sTab..sTableName.." = {\n"
 
        for key, value in tTable do
                local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
 
                if(type(value) == "table") then
                        sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
                else
                        local sValue = (type(value) == "string") and string.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)
local handle = io.open(file,"w+")
        handle:write(Serialize(table, tablename))
handle:flush()
        handle:close()
end

function LoadFromFile(file)
local handle = io.open(file,"r")
if (handle ~= nil) then
dofile(file)
handle:flush()
handle:close()
        end
end

function buildmyinfo(curUser)
local build = nil
build = "$MyINFO $ALL "
build = build..curUser.sName
build = build..(" "..curUser.sDescription)
build = build..("<"..curUser.sClient..",V:"..curUser.sClientVersion)
build = build..(",M:"..curUser.sMode)
build = build..(",H:"..curUser.iNormalHubs.."/"..curUser.iRegHubs.."/"..curUser.iOpHubs)
build = build..(",S:"..curUser.iSlots)
build = build..(">$ $"..curUser.sConnection)
build = build..("$"..curUser.sEmail)
build = build..("$"..curUser.iShareSize.."$")
return build
end
Title: -.-
Post by: CaSaNoVa on 02 June, 2005, 06:06:10
lua:153: attempt to index local `handle' (a nil value)
Title:
Post by: jiten on 02 June, 2005, 09:50:09
QuoteOriginally posted by dragos_sto
some modification
same problem whit this script i have whit ip checker whit strong dc++ client
so , i make some modification
What exactly is the problem with the script m8?
Title:
Post by: dragos_sto on 02 June, 2005, 13:49:40
i dont know why have problem whit strong dc++ client
myinfo all seam to be indentical whyt other client , but dont work , when make charfind have an error and say error at line 71 [local _,_,Client,Ver,Mode = string.find(MyInfo,"<(%S+),V:(%S+),M:([S,A,P])") ] client a nil value
Title:
Post by: Dessamator on 02 June, 2005, 14:18:20
well if i remember correctly , strongdc can fake its tag so basically, it could look like some other client but not actually be it!
Title:
Post by: dragos_sto on 02 June, 2005, 15:10:35
and any solutions..?
but why when emulate whit strong dc++ a dc++ client dont have problem ?

and theoretic whit the modification to the script i rebuild $myinfo $all and i dont understand why dont work ... :((
Title:
Post by: Cêñoßy†ê on 09 November, 2005, 16:57:58
i have small prob... command works ok when user online... but get error when user offline =(

[17:38:53] Leviathan/functions.lua:155: attempt to index local `victim' (a nil value)
Function:tFunctions.userinfo = function(user, data)
local s,e,cmd,name = string.find(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(name)
if UserInfoTable[victim.sName] then
local border1 = " ---- --- ---- ---- ---- ---- ---- - USER INFO  ---- --- ---- ---- ---- ---- ---- -"
local disp = "\r\n\r\n"..border1.."\r\n"
disp = disp.."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][1].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][4].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][3].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][5].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][6].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][7].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][8].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][16].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][9].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][10].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][11].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][13].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][14].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][15].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][12].."\r\n"
disp = disp.." Registered by: "..RegTable[victim.sName][1].."\r\n"
disp = disp.." Registered when: "..RegTable[victim.sName][2].."\r\n"
disp = disp.." Total Logins: "..LoginTable[victim.sName].."\r\n"
disp = disp.." "..UserInfoTable[victim.sName][2].."  ("..(tConvertSwitch5[victim.bConnected] or "Offline")..")\r\n"
user:SendPM(tSettings.BotName, disp)
else
user:SendData(tSettings.BotName,"No info found with given name !!")
return 1
end
end

Table:UserInfoTable = {
["3sixty"] = {
[1] = "Name: User",
[2] = "Last Login: 09/11/2005 - 16:51:19",
[3] = "IP: xxx.xxx.xx.xx",
[4] = "Password: XXX",
[5] = "Share Size: 489.33 GB",
[6] = "Profile: Master",
[7] = "Client: DC++",
[8] = "Version: 0.674",
[9] = "Connection: 56Kbps",
[10] = "Mode: Active",
[11] = "Total Hubs: 18",
[12] = "Slots: 1",
[13] = "Normal Hubs: 0",
[14] = "Reg Hubs: 9",
[15] = "OP Hubs: 9",
[16] = "RightClick Support: Yes",
},
}
Title:
Post by: Cêñoßy†ê on 09 November, 2005, 18:33:22
Problem solved thx to Optimus

Function:
tFunctions.userinfo = function(user, data)
local s,e,cmd,name = string.find(data,"%b<>%s+(%S+)%s+(%S+)")
if UserInfoTable[name] or RegTable[name] or LoginTable[name] then
local border1 = " ----- USERS-LAST-LOGIN-INFO-IN-LOGS -----"
local disp = "\r\n\r\n"..border1.."\r\n"
disp = disp.."\r\n"
disp = disp.." "..UserInfoTable[name][1].."\r\n"
disp = disp.." "..UserInfoTable[name][4].."\r\n"
disp = disp.." "..UserInfoTable[name][3].."\r\n"
disp = disp.." "..UserInfoTable[name][5].."\r\n"
disp = disp.." "..UserInfoTable[name][6].."\r\n"
disp = disp.." "..UserInfoTable[name][7].."\r\n"
disp = disp.." "..UserInfoTable[name][8].."\r\n"
disp = disp.." "..UserInfoTable[name][16].."\r\n"
disp = disp.." "..UserInfoTable[name][9].."\r\n"
disp = disp.." "..UserInfoTable[name][10].."\r\n"
disp = disp.." "..UserInfoTable[name][11].."\r\n"
disp = disp.." "..UserInfoTable[name][13].."\r\n"
disp = disp.." "..UserInfoTable[name][14].."\r\n"
disp = disp.." "..UserInfoTable[name][15].."\r\n"
disp = disp.." "..UserInfoTable[name][12].."\r\n"
disp = disp.." Registered by: "..RegTable[name][1].."\r\n"
disp = disp.." Registered when: "..RegTable[name][2].."\r\n"
disp = disp.." Total Logins: "..LoginTable[name].."\r\n"
disp = disp.." "..UserInfoTable[name][2].." ["..UserInfoTable[name][17].."]\r\n"
user:SendPM(tSettings.BotName, disp)
else
user:SendData(tSettings.BotName,"No info found with given name !!")
return 1
end
end

Table:UserInfoTable = {
["C??o?y??"] = {
[1] = "Name: C??o?y??",
[2] = "Last Login: 09/11/2005 - 19:22:48",
[3] = "IP: xx.xx.xx.xx.xx",
[4] = "Password: xxxx",
[5] = "Share Size: xx GB",
[6] = "Profile: Master",
[7] = "Client: DC++",
[8] = "Version: 0.674",
[9] = "Connection: DSL",
[10] = "Mode: Active",
[11] = "Total Hubs: x",
[12] = "Slots: x",
[13] = "Normal Hubs: x",
[14] = "Reg Hubs: x",
[15] = "OP Hubs: x",
[16] = "RightClick Support: Yes",
[17] = "Online",
},
}