userinfo help
 

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

userinfo help

Started by dragos_sto, 12 April, 2005, 16:06:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dragos_sto

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 = {

{ "
{ "
{ "http://dc.ketelhot.de","DCGUI" },

{ "
{ "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

ConejoDelMal

I believe this is lua 4... you have to convert it..
Rede-DC Comunidade Portuguesa de DC

dragos_sto

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 = {

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

{ "","MS++V" },{ "","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

TTB

#3
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...
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Oz

hmmm  nice script, but doesen't worl :(
Somone please help to correct errors :)
jitten help please ;)

jiten

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 = { 
		{ "","MS++V" }, 
		{ "","MS++V" },{ "","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

ConejoDelMal

tested it and its working good :)
Rede-DC Comunidade Portuguesa de DC

jiten


Oz


dragos_sto

QuoteOriginally posted by jiten
Here you go (not tested):

good work and 10x a lot for help

jiten


dragos_sto

#11
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

CaSaNoVa

lua:153: attempt to index local `handle' (a nil value)

jiten

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?

dragos_sto

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

Dessamator

well if i remember correctly , strongdc can fake its tag so basically, it could look like some other client but not actually be it!
Ignorance is Bliss.

dragos_sto

#16
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 ... :((

Cêñoßy†ê

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",
	},
}
Powered By Leviathan™ 2nd Generation v. 1.9

Cêñoßy†ê

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",
	},
}
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk