antiopenhub.V1.lua
 

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

antiopenhub.V1.lua

Started by balblub, 13 April, 2006, 14:49:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

balblub

HI

Can anybody help me please, this script work fine, but it checks only when new user connect to hub.I want that the script check all the time if any user is in a hub as guest.
??? ???


tBadOnes = {}
iTimeAfter = 15 -- how many seconds before disconnecting

function Main()
	SetTimer( 1000 )
	StartTimer()
end

function NewUserConnected(user)
	if user.iNormalHubs then
		if user.iNormalHubs > 0 then
			tBadOnes[user.sName] = iTimeAfter
			user:SendData( "Helvetia", "Du bist in Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung in "..iTimeAfter.." Sekunden zur?ckgesetzt!!!")
		end
	end
end

function OnTimer()
	for nick, v in tBadOnes do
		local user = GetItemByName( nick )
		if user.iNormalHubs then
			if user.iNormalHubs == 0 then
				tBadOnes[nick] = nil
				user:SendData( "Helvetia", "Danke, daf?r dass du die Open Hubs geschlossen hast und nun ganz Regelkonform mitmachst." )
			elseif user.iNormalHubs > 0 then
				tBadOnes[nick] = tBadOnes[nick] - 1
				if tBadOnes[nick] == 0 then
					tBadOnes[nick] = nil
					user:SendData( "Helvetia", "Du wirst jetzt Disconnected weil du in Open Hubs rumlungerst. Komm bitte erst wieder wenn du sie geschlossen hast." )
					user:Disconnect()
				elseif tBadOnes[nick] == math.floor( iTimeAfter / 2 ) then
					user:SendData ( "Helvetia", " Wir bitten euch inst?ndig, euch nicht in den offnen File-Sharing-Plattformen zu bewegen. Das ist n?mlich auch f?r uns gef?hrlich. Du hast noch "..math.floor( iTimeAfter / 2 ).." Sekunden ?brig bis zu Trennung.." )
				end
			end
		end
	end
end

function UserDisconnected(user)
	if tBadOnes[user.sName] then
		tBadOnes[user.sName] = nil
		collectgarbage();
	end
end

jiten

Here goes a quick one:

--[[

	Anti-Open Hub by Herodes

]]--

tBad = {}
Settings = {
	-- Bot Name
	sBot = frmHub:GetHubBotName(),
	-- How many seconds before disconnecting
	iTimeAfter = 15,
}

Main = function()
	SetTimer(1000); StartTimer()
end

NewUserConnected = function(user)
	if user.iNormalHubs then
		if user.iNormalHubs > 0 then
			tBad[user.sName] = Settings.iTimeAfter
			user:SendData( "Helvetia", "Du bist in Open Hubs. Dies verst?sst gegen unsere Regeln. "..
			"Deshalb wird die Verbindung in "..Settings.iTimeAfter.." Sekunden zur?ckgesetzt!!!")
		end
	end
end

OnTimer = function()
	for i,v in ipairs(frmHub:GetOnlineNonOperators()) do
		if v.iNormalHubs and v.iNormalHubs > 0 and not tBad[v.sName] then tBad[v.sName] = Settings.iTimeAfter end
	end
	for nick,v in pairs(tBad) do
		local user = GetItemByName(nick)
		if user.iNormalHubs then
			if user.iNormalHubs == 0 then
				tBad[nick] = nil
				user:SendData(Settings.sBot, "Danke, daf?r dass du die Open Hubs geschlossen hast und nun ganz "..
				"Regelkonform mitmachst.")
			elseif user.iNormalHubs > 0 then
				tBad[nick] = tBad[nick] - 1
				if tBad[nick] == 0 then
					tBad[nick] = nil
					user:SendData(Settings.sBot,"Du wirst jetzt Disconnected weil du in Open Hubs rumlungerst. "..
					"Komm bitte erst wieder wenn du sie geschlossen hast.")
					user:Disconnect()
				elseif tBad[nick] == math.floor(Settings.iTimeAfter/2) then
					user:SendData (Settings.sBot," Wir bitten euch inst?ndig, euch nicht in den offnen "..
					"File-Sharing-Plattformen zu bewegen. Das ist n?mlich auch f?r uns gef?hrlich. Du hast noch "..
					math.floor(Settings.iTimeAfter/2).." Sekunden ?brig bis zu Trennung..")
				end
			end
		end
	end
end

UserDisconnected = function(user)
	if tBad[user.sName] then tBad[user.sName] = nil; collectgarbage(); end
end

6Marilyn6Manson6

Quote from: jiten on 13 April, 2006, 15:27:41
Here goes a quick one:

--[[

	Anti-Open Hub by Herodes

]]--

tBad = {}
Settings = {
	-- Bot Name
	sBot = frmHub:GetHubBotName(),
	-- How many seconds before disconnecting
	iTimeAfter = 15,
}

Main = function()
	SetTimer(1000); StartTimer()
end

NewUserConnected = function(user)
	if user.iNormalHubs then
		if user.iNormalHubs > 0 then
			tBad[user.sName] = Settings.iTimeAfter
			user:SendData( "Helvetia", "Du bist in Open Hubs. Dies verst?sst gegen unsere Regeln. "..
			"Deshalb wird die Verbindung in "..Settings.iTimeAfter.." Sekunden zur?ckgesetzt!!!")
		end
	end
end

OnTimer = function()
	for i,v in ipairs(frmHub:GetOnlineNonOperators()) do
		if v.iNormalHubs and v.iNormalHubs > 0 and not tBad[v.sName] then tBad[v.sName] = Settings.iTimeAfter end
	end
	for nick,v in pairs(tBad) do
		local user = GetItemByName(nick)
		if user.iNormalHubs then
			if user.iNormalHubs == 0 then
				tBad[nick] = nil
				user:SendData(Settings.sBot, "Danke, daf?r dass du die Open Hubs geschlossen hast und nun ganz "..
				"Regelkonform mitmachst.")
			elseif user.iNormalHubs > 0 then
				tBad[nick] = tBad[nick] - 1
				if tBad[nick] == 0 then
					tBad[nick] = nil
					user:SendData(Settings.sBot,"Du wirst jetzt Disconnected weil du in Open Hubs rumlungerst. "..
					"Komm bitte erst wieder wenn du sie geschlossen hast.")
					user:Disconnect()
				elseif tBad[nick] == math.floor(Settings.iTimeAfter/2) then
					user:SendData (Settings.sBot," Wir bitten euch inst?ndig, euch nicht in den offnen "..
					"File-Sharing-Plattformen zu bewegen. Das ist n?mlich auch f?r uns gef?hrlich. Du hast noch "..
					math.floor(Settings.iTimeAfter/2).." Sekunden ?brig bis zu Trennung..")
				end
			end
		end
	end
end

UserDisconnected = function(user)
	if tBad[user.sName] then tBad[user.sName] = nil; collectgarbage(); end
end


Can uoi jiten post this script in english language? Thanks :D

balblub

Thank you it works perfect  ;D

Psycho_Chihuahua

#4
Quote from: 6Marilyn6Manson6 on 13 April, 2006, 15:31:45
Can uoi jiten post this script in english language? Thanks :D


I recognize this script - was mine once upon a time ;)

Here ya go a (not so good) english version

--[[

	Anti-Open Hub by Herodes

]]--

tBad = {}
Settings = {
	-- Bot Name
	sBot = frmHub:GetHubBotName(),
	-- How many seconds before disconnecting
	iTimeAfter = 15,
}

Main = function()
	SetTimer(1000); StartTimer()
end

NewUserConnected = function(user)
	if user.iNormalHubs then
		if user.iNormalHubs > 0 then
			tBad[user.sName] = Settings.iTimeAfter
			user:SendData( "Helvetia", "You are in public hubs which is violating against our hubrules. "..
			"This is why your connection will be terminated in "..Settings.iTimeAfter.." seconds!!!")
		end
	end
end

OnTimer = function()
	for i,v in ipairs(frmHub:GetOnlineNonOperators()) do
		if v.iNormalHubs and v.iNormalHubs > 0 and not tBad[v.sName] then tBad[v.sName] = Settings.iTimeAfter end
	end
	for nick,v in pairs(tBad) do
		local user = GetItemByName(nick)
		if user.iNormalHubs then
			if user.iNormalHubs == 0 then
				tBad[nick] = nil
				user:SendData(Settings.sBot, "Thank you for closing the public hubs and are now following "..
				"our rules.")
			elseif user.iNormalHubs > 0 then
				tBad[nick] = tBad[nick] - 1
				if tBad[nick] == 0 then
					tBad[nick] = nil
					user:SendData(Settings.sBot,"Your connection was terminated because you were in public hubs. "..
					"Feel free to return once you have closed your public hub connections.")
					user:Disconnect()
				elseif tBad[nick] == math.floor(Settings.iTimeAfter/2) then
					user:SendData (Settings.sBot," Please don't hang around in public "..
					"File-Sharing-Platforms. This is dangerous for you and for us. You still have "..
					math.floor(Settings.iTimeAfter/2).." seconds left until your connection is terminated..")
				end
			end
		end
	end
end

UserDisconnected = function(user)
	if tBad[user.sName] then tBad[user.sName] = nil; collectgarbage(); end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

6Marilyn6Manson6


Psycho_Chihuahua

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

jiten

Quote from: 6Marilyn6Manson6 on 13 April, 2006, 15:31:45
Can uoi jiten post this script in english language? Thanks :D

If my german was like Psycho's :P

Psycho_Chihuahua

Quote from: jiten on 13 April, 2006, 19:50:05
Quote from: 6Marilyn6Manson6 on 13 April, 2006, 15:31:45
Can uoi jiten post this script in english language? Thanks :D

If my german was like Psycho's :P

not that hard for me  ;)

i've got almost 20 years practice in german
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Cêñoßy†ê

My version  ;D

--// Disconnect publichub users
--// By C??o?y??

Check = {		-- 0=dont check 1=check
	[0] = 0,	-- Master
	[1] = 0,	-- Operator
	[2] = 1,	-- Vip
	[3] = 1,	-- Reg
	[4] = 0,	-- Extra profile
	[5] = 0,	-- Extra profile
	[-1] = 1,	-- Unregistered user
}

Message =	"Your connection was terminated because you were in public hubs. Feel free to return once you have closed your public hub connections."

CheckPublic = function(user)
	if Check[user.iProfile]== 1 then
	if user.iNormalHubs then
		if user.iNormalHubs > 0 then
			user:SendData(frmHub:GetHubBotName(),Message)
			user:Disconnect()
			end
		end
	end
end

NewUserConnected = CheckPublic
OpConnected = CheckPublic
SearchArrival = CheckPublic
ConnectToMeArrival = CheckPublic
MultiConnectToMeArrival = CheckPublic
RevConnectToMeArrival = CheckPublic
SRArrival = CheckPublic
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk