Users registered by who log?
 

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

Users registered by who log?

Started by QuikThinker, 19 May, 2004, 19:59:13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

QuikThinker

Hey everyone,
   Ma 2 hubs r running with Robocop 6.0d & we use the hub protection option so the users have to reg 2 download or search.
   Ma question is, is it possible 4 when an OP registers a new user there could be a log produced of who exactly registered them? A few users keep comin back & I wanna find out who registers them so I can let em know.

Thanx in advance.
Quik.

Optimus

good idea... i will build that in RC sooner or later
But for now you have to wait for a seperate script writen by some1 else.

QuikThinker

Thanx Opti, i'm glad I could offer a new angle! :D

Can any1 else offer anythin on this?

nErBoS

#3
Hi,

The command that you use to reg users is from robocop ?? what is the command syntax ??

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


nErBoS

Hi,

Try this....

--Requested by QuikThinker
--Made by nErBoS

sBot = "Reg-Logger"

reglog = {}
reglogsv = "reglog.dat"

function Main()
	frmHub:RegBot(sBot)
	LoadFromFile(reglogsv)
end

function OnExit()
	SaveToFile(reglogsv , reglog , "reglog")
end

function DataArrival(user, data)
	if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
		data = strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if (cmd == "!reguser" and user.bOperator) then
			local s,e,who,pass = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")
			if (who ~= nil and pass ~= nil) then
				reglog[strlower(who)] = user.sName
			end
			return 0
		elseif (cmd == "!reglog" and user.bOperator) then
			RegLog(user)
			return 1
		end
	end
end

function RegLog(user)
	local sTmp = "Log of registered users and by who:\r\n\r\n"
	local usr,who
	for usr, who in reglog do
		sTmp = sTmp..usr.."\tRegged by: "..who.."\r\n"
	end
	user:SendPM(sBot, sTmp)
end

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

Not sure if it will work since the command is inbuild in RoboCop.

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

QuikThinker

Just got round 2 testin this script mate & it dun seem 2 work. It creates the log file but doesn't add any entries :s

nErBoS

Hi,

That what i was afraid of, it should be working this script only compares the data reciveved by !reg it doesn't block it should be able to robocop deal with. Try to remove the "return 0" on the script.

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

SMF spam blocked by CleanTalk