Personal Log for HubOwners
 

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

Personal Log for HubOwners

Started by Mozzilla?, 02 December, 2006, 21:46:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mozzilla?

Just a little script for all you HubOwners who want a personal log of all your hubs login's

------------------------------------------------------------------------------------------
--			Connection Log for HubOwners
--			Written by Mozzilla?
------------------------------------------------------------------------------------------
--		Each time anybody enters the hub a PM will be sent to the HubOwner(s)
--
--			Quite a lot of assistance provided by Mutor
--			Thanks for all your help Mutor with this script
------------------------------------------------------------------------------------------
  
Bot = "??CONN?CT?ON?LOG??"  
  
SendTo = {		-- Who gets the PM  
	[6] = 1,	-- Owners  
} 
 
cProfile = {		-- The profiles that will be shown in the PM each time they connect to the hub  
	[-1] = 1,  
	[0] = 1,  
	[1] = 1,  
	[2] = 1,  
	[3] = 1,  
	[4] = 1,  
	[5] = 1,  
} 

Main = function() 
	if Bot == frmHub:GetHubBotName() and frmHub:GetHubBot()== 0 or Bot ~= frmHub:GetHubBotName() then 
		frmHub:RegBot(Bot, 1,"Connection log for PtokaX ".._VERSION, "user@domain.com") 
	end 
end 
 
function NewUserConnected(user)  
	if cProfile[user.iProfile] and cProfile[user.iProfile] == 1 then 
		local Profile  = GetProfileName(user.iProfile) or "Unregistered User" 
		local msg = os.date("\r\n\tJust a little message to let the HubOwners ".. 
		"know that\r\n\t"..Profile.." "..user.sName.." with IP "..user.sIP.. 
		" \r\n\tentered "..frmHub:GetHubName().. 
		" on %a %d/%m/%Y at %H:%M:%S") 
		for i,v in ipairs(frmHub:GetOnlineRegUsers()) do 
			if SendTo[v.iProfile]and SendTo[v.iProfile] ==1 then 
				SendPmToNick(v.sName,Bot,msg) 
			end 
		end 
		if SendTo[user.iProfile]and SendTo[user.iProfile] ==1 then 
			user:SendPM(Bot,msg) 
		end 
	end 
end 
OpConnected = NewUserConnected

Posted on: November 27, 2006, 03:49:10 am
Changed the script slightly for those who don't use Profile [6]

------------------------------------------------------------------------------------------
--			Connection Log for HubOwners 					
--			Written by Mozzilla?						
------------------------------------------------------------------------------------------
--		Each time anybody enters the hub a PM will be sent to the HubOwner(s)	  
--  											
--			Quite a lot of assistance provided by Mutor			
--			Thanks for all your help Mutor with this script	
--
--			Removed Profile [6]
--		Altered script slightly to allow for HubOwners name to be entered		
------------------------------------------------------------------------------------------
  
Bot = "Your-Choice-Of-BotName-Here" or frmHub:GetBotName() 
  
HubOwner = "HubOwners-Nick-Here"    -- If more than one owner seperate with a comma and a space - "Owner1, Owner2"
 
cProfile = {		-- The profiles that will be shown in the PM each time they connect to the hub - 1 = show, 0 = don't show
	[-1] = 1,  
	[0] = 1,  
	[1] = 1,  
	[2] = 1,  
	[3] = 1,  
	[4] = 1,  
	[5] = 1,  
} 


function NewUserConnected(user)  
	if cProfile[user.iProfile] and cProfile[user.iProfile] == 1 then 
		local Profile  = GetProfileName(user.iProfile) or "Unregistered User" 
		local msg = os.date("\r\n\tJust a little message to let the HubOwners ".. 
		"know that\r\n\t"..Profile.." "..user.sName.." with IP "..user.sIP.. 
		" \r\n\tentered "..frmHub:GetHubName().. 
		" on %a %d/%m/%Y at %H:%M:%S") 
		for i,v in ipairs(frmHub:GetOnlineRegUsers()) do 
			if user.sName ~= HubOwner then 
				SendPmToNick(v.sName,Bot,msg) 
			end 
		end 
		if user.sName ~= HubOwner then 
			user:SendPM(Bot,msg) 
		end 
	end 
end 
OpConnected = NewUserConnected

Posted on: November 28, 2006, 01:41:45 pm
>:( grrrr!!!

I knew i should have tested that second script!!!

Can anybody assist me to get it working properly?

It appears that each time somebody enters the hub the person entering gets the PM and not the hub owner.

DOH@me

lol

Herodes

Maybe you want this ...
function NewUserConnected(user)  
	if cProfile[user.iProfile] and cProfile[user.iProfile] == 1 then 
		local Profile  = GetProfileName(user.iProfile) or "Unregistered User" 
		local msg = "\r\n\tJust a little message to let the HubOwners know that\r\n\t"..Profile.." "..user.sName.." with IP "..user.sIP.."\r\n\t entered "..frmHub:GetHubName().." on "..os.date(%a %d/%m/%Y at %H:%M:%S")
		for hubown in string.gmatch( HubOwner, "%,?%s*(%S+)%s*%,?") do
			SendPmToNick( hubown, Bot, msg )
		end
	end 
end


Ooh.. by the way I am moving this to [Lua 5.1 / Help with scripts]

Mozzilla?

Thanks once again for your assistance Mutor.

And thankyou also to Herodes.

SMF spam blocked by CleanTalk