Block Public hub-Users
 

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

Block Public hub-Users

Started by uffetjur, 30 March, 2005, 21:34:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

uffetjur

Need a script that kicks / warns users whos connected to public hubs and wich scans user list once or twice / hour
Somewhere in Cyberspace

bastya_elvtars

I do not clearly get what you need. What is 'public hubs'?
Everything could have been anything else and it would have just as much meaning.

??????Hawk??????

Cannot be done..  

this was asked Before..

How can you tell if a Registered user is in a public or private hub ...  ??????


??????Hawk??????

uffetjur

Im only interested of getting rids of users whos connected to public hubs without being regged there, Users whos tags shows connected as regular user


Im well aknown of the stupidity of this request but a friend of mine still wants it
Somewhere in Cyberspace

??????Hawk??????

ok  paste this to your m8 and see what he says  


this is my Tag

<++ V:0.673,M:P,H:0/1/17,S:5>


How Many Public Hubs am i in  ???????????


the fact is  im only in 2 Private hubs  all the rest are Public ( Registered in Every one of them..  


So  all your m8 has to do is LImit his hub  to a max of   1 Hub Only for all users  .  that way he will be sure there NOT in a public hub...


??????Hawk??????

Herodes

okie.. there you go.. very late to test and too dull for a script to support anymore than this .. ;)

If there is someone who can find interestin mixing up with this quitie then take it as if it was your own :)

--[[--- ----- ----- ----- ----- ----- ----- ----- ----- -----
 --= HubCut by Herodes v1 =-
----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 - Takes care of the users that are bad with their hubs ( see settings. . )
 - Works on a timed interval
----- ----- ----- ----- ----- ----- ----- ----- ----- -----
this is a very rough script .. semi-bored in doing it ..
if someone wants to take it up you're more than welcome.. ;)
--]]--- ----- ----- ----- ----- ----- ----- ----- ----- -----

Bot = { --------------------------------------------------------------------------- ADJUST BOT SETTINGS HERE!!
	register = 1, -- 1:registers the bot in the userlist..
	name = "HubCut" , -- bot's name
	email = "postman@mail.me", -- bot's email
	desc = "Post messages to other users here..", -- bot's desc
}

sets = { ------------------------------------------------------------------------------------- ADJUST CHECKS SETTINGS HERE !
	interval = 45 , -- every how many minutes should the hub be searched
	logfile = "hubcut.dat", -- this is where messages will be logged
	hubs = {
		guest = {
			limit = 10 ,  -- set to nil if you want to disable
			action = 1 , -- 0:nothing / 1:disconnect / 2:tempban / 3:logfile
			announce = 1 , -- 1:enables / 0:disables , announcing of events to operators
			address = "redirect.to-another.hub",
			bantime = 5 , -- bantime if action is set to
			msg = {
				log = "[user] was found with more than [limit] guest hubs on [date]//[time] and was [action]",  -- the text that will be logged (if logging)
				user = "You were in more than [hubs] guest hubs so you are going to be [action]", -- the notification that the user will receive
				ops = "[user] was found with more than [limit] guest hubs on [date]//[time] and was [action]", -- the notification the ops will receive ( if announcing )
			},
		},
		registered = {
			limit = 10 ,  -- set to nil if you want to disable
			action = 1 , -- 0:nothing / 1:disconnect / 2:tempban / 3:logfile
			announce = 1 , -- 1:enables / 0:disables , announcing of events to operators
			address = "redirect.to-another.hub",
			bantime = 5 , -- bantime if action is set to
			msg = {
				log = "[user] was found with more than [limit] reg hubs on [date]//[time] and was [action]",  -- the text that will be logged (if logging)
				user = "You were in more than [hubs] guest hubs so you are going to be [action]", -- the notification that the user will receive
				ops = "[user] was found with more than [limit] guest hubs on [date]//[time] and was [action]", -- the notification the ops will receive ( if announcing )
			},
		},
		operator = {
			limit = 10 ,  -- set to nil if you want to disable
			action = 1 , -- 0:nothing / 1:disconnect / 2:tempban / 3:logfile
			announce = 1 , -- 1:enables / 0:disables , announcing of events to operators
			address = "redirect.to-another.hub",
			bantime = 5 , -- bantime if action is set to
			msg = {
				log = "[user] was found with more than [limit] op hubs on [date]//[time] and was [action]",  -- the text that will be logged (if logging)
				user = "You were in more than [hubs] guest hubs so you are going to be [action]", -- the notification that the user will receive
				ops = "[user] was found with more than [limit] guest hubs on [date]//[time] and was [action]", -- the notification the ops will receive ( if announcing )
			},
		},
	},
	levels = {
		["-1"] = 1, -- unregs
		["0"] = 0, -- masters
		["1"] = 0, -- ops
		["2"] = 0, -- vips
		["3"] = 0, -- regs
		["4"] = 0, -- custom profile
		["5"] = 0, -- custom profile
	},
}

------------ end of settings


function Main()
	if (Bot.register == 1) then frmHub:RegBot(Bot.name, 1, Bot.desc, Bot.email ); end
	Bot = Bot.name
	SetTimer(sets.interval*60000)
	StartTimer()
end

function chkHubs(user)
	if sets.levels[""..user.iProfile..""] == 1 then
		local t = {
			{ (user.iHubs or user.iNormalHubs) , sets.hubs.guest },
			{ (user.iRegHubs or 0) , sets.hubs.registered },
			{ (user.iOpHubs or 0), sets.hubs.ops },
			}
		local tActions = { [1] = Disco, [2] = TBan, [3] = LogIt, }
		for i,v in t do
			if v[2].limit and v[2].limit <= v[1] then
				tActions[v[2].action]( user, v[2] )
				return user.sName
			end
		end
	end
	return false
end

function PrepareMsg( t )
	local tA = { [1] = "disconnected", [2] = "tempbanned for [bantime] minutes", [3] = "logged to [file]" }
	local tS, res= {
			["%[action%]"] = tA[t.action],
			["%[file%]"] = sets.logfile,
			["%[user%]"] = user.sName,
			["%[date%]"] = os.date("%x"),
			["%[time%]"] = os.date("%X"),
			["%[myinfo%]"] = user.sMyInfo,
			["%[bantime%]"] = t.bantime,
			["%[limit%]"] = t.limit,
			["%[address%]"] = t.address,
			["%[conn%]"] = user.sConnection,
			["%[hubs%]"] = ( (user.iHubs or user.iNormalHubs)+(user.iRegHubs or 0)+(user.iOpHubs or 0) ),
			["%[ghubs%]"] = (user.iHubs or user.iNormalHubs),
			["%[rhubs%]"] = (user.iRegHubs or 0),
			["%[ohubs%]"] = (user.iOpHubs or 0),
		}, {}
	for idx, txt in t.msg do
		for i,v in tS do res[idx] = string.gsub( txt, i, v ); end;
	end
	return res;
end

function Disco( user, t )
	user:SendData( Bot, PrepareMsg( t ) )
	user:Disconnect()
end

function TBan( user, t )
	user:SendData( Bot , PrepareMsg( t ) )
	user:TempBan ( t.bantime )
end

function LogIt( user, t )
	local f = io.open( sets.logfile, "a+" )
	f:write( PrepareMsg( t ).."\n" )
	f:close()
end

function OnTimer()
	SendToAll( Bot, "Brace your selves,... hubcut is out..")
	SendToAll( Bot, "You'll hear it when I knock on your door! >:)_ _ .  _  .     .     .   @" )
	local x t, cnt = os.clock(), {}, 0
	for i,user in frmHub:GetOnlineUsers() do
		local c = chkHubs(user)
		if c then table.insert( t, c ) end
		cnt = cnt + 1
	end
	SendToAll( Bot, cnt.." users were checked, "..table.getn(t).." were hubcut.. ( in "..(os.clock()-x).." secs)")
	SendToAll( Bot, "Until next time .. keep it trimmed ;)")
end

SMF spam blocked by CleanTalk