+info <user offline nick)
 

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

+info

Started by D-J Valhala, 22 February, 2004, 00:39:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

D-J Valhala

High Ya All :P Can AnyBody Posy Me A Script That Take +info From User That OffLine?
10x M8t's :P
CyA All
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

NightLitch

Try one of the bigger bots, CB my NXS-3 allowes it.

/NL
//NL

D-J Valhala

lol i use robocop :P i love robocop it's the best for my hub... :)
i need one script not AllInOne script...
10x
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

D-J Valhala

??????????????????????????????????????????????????????????????????????????????????????????????????????
:\
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Like NightLitch that commands are in big bots, to make one is need some serious code, and that takes time.

What type of info you want to the command show ???

Best regards, nErBoS
--## nErBoS Spot ##--

NightLitch

Just to make you happy...

create a folder called - UserInfo - all userinfo's will be stored there.

-- Simple Offline Info by NightLitch
-- Commands must be sent to Bot.
-- Create folder UserInfo

-- BotName --
BotName = "-Info-Bot-"
-- Prefix --
Prefix = "!"

-- 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, 4) == "$To:" then
		local s,e,to,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
		if to == BotName then
			data = text
			data = strsub(data,1,strlen(data)-1)
			if (GetCom(curUser,data) == 1) then
				return 0
			else
				return 0
			end
		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 = {
["getinfo"] = function(curUser,data)
			local _,_,nick = strfind( data,"%b<>%s+%S+%s+(%S+)")
			if (nick == nil or nick == "") then 
				curUser:SendPM(BotName,"Syntax: "..Prefix.."getinfo ")
				return 1
			end
			local IP, Profile, MyInfo = GetInfo(nick)
			if IP==0 and Profile==0 and MyInfo==0 then
				curUser:SendPM(BotName,"User not found.")
				return 1
			end
			ClientTAG = {
			{ "","MS++V" },
			{ "","MS++V" },{ "","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[i][1]) then
					Client = ClientTAG[i][2]
				end
			end
			local line = "\r\n"
			line = line .. "\r\n	User Info on: "..Nick
			line = line .. "\r\n --------------------------------------------------------------------"
			line = line .. "\r\n --------------------------------------------------------------------"
			line = line .. "\r\n	IP: "..IP
			line = line .. "\r\n	Client: "..Client
			line = line .. "\r\n	Version: "..Ver
			line = line .. "\r\n	Mode: "..Mode
			line = line .. "\r\n	Hubs: "..Hubs
			line = line .. "\r\n	Slots: "..Slots
			line = line .. "\r\n	Speed: "..Speed
			line = line .. "\r\n	Share: "..format("%.2f",Share/1024/1024/1024)
			line = line .. "\r\n --------------------------------------------------------------------"
			line = line .. "\r\n --------------------------------------------------------------------"
			curUser:SendPM(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

hope this work this is a clean rip from my NXS-3 & IP-NXS-RANGER

/NL
//NL

D-J Valhala

thank you dude but i cant see the commend... !getinfi = ptokax commend
*** Nick: shantoxcy IP: 192.117.244.37
so what can i do? and maybe you can do it? the commend can be somthing like +off usernick\ip
and again thank you m8 :)))
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

NightLitch

Send the command PM to bot.
//NL

D-J Valhala

and where is the "UserInfo" folder should be in the script's folder or the ptokax folder 10x :P
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

D-J Valhala

BTW the bot is not reggd in the code... and it's more good to me that the bot is offline bot ... hope you can help me :)
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

NightLitch

here you go:

-- Simple Offline Info by NightLitch
-- Commands is sent in Main-Chat
-- Create folder UserInfo

-- BotName --
BotName = "-Info-Bot-"
-- Prefix --
Prefix = "!"

--Command--
cmd1 = "offinfo"
-- 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.."getinfo ")
				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 = 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[i][1]) then
					Client = ClientTAG[i][2]
				end
			end
			local line = "\r\n"
			line = line .. "\r\n	User Info on: "..Nick
			line = line .. "\r\n --------------------------------------------------------------------"
			line = line .. "\r\n --------------------------------------------------------------------"
			line = line .. "\r\n	IP: "..IP
			line = line .. "\r\n	Client: "..Client
			line = line .. "\r\n	Version: "..Ver
			line = line .. "\r\n	Mode: "..Mode
			line = line .. "\r\n	Hubs: "..Hubs
			line = line .. "\r\n	Slots: "..Slots
			line = line .. "\r\n	Speed: "..Speed
			line = line .. "\r\n	Share: "..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
/NL
//NL

D-J Valhala

nope it's not working :\
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

NightLitch

Well above code works for me.

BUT! As you wanted it. Offline info the info file must exist.

It does work for me.

I have here a link with all that is needed:

Offline Info Download
//NL

D-J Valhala

yo yo yo thank's man it's work Pefect !!!

CyA :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

SMF spam blocked by CleanTalk