NO Public Bot
 

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

NO Public Bot

Started by Teddy, 26 July, 2005, 19:56:30

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Teddy

Can this be fix to lua.5

-- Anti Open Hub Bot
-- by NightLitch
-- minor bugfix by psycho_chihuahua
DisconnectMessage = "### PLEASE close the public Hub ###."
function DataArrival( sUser , sData )
   if strsub( sData , 1 , 7 ) == "$MyINFO" then
      local _,_,openhubs = strfind( sData , ".+H:(%d+)" );
      if ( openhubs ~= "0" ) then
         SendToNick( sUser.sName , DisconnectMessage )
         sUser:Disconnect()
      end
   end
end

Madman

-- Anti Open Hub Bot
-- by NightLitch
-- minor bugfix by psycho_chihuahua
-- Converted to lua5 by Madman
DisconnectMessage = "### PLEASE close the public Hub ###." 
function MyINFOArrival( sUser , sData )
	if ( sUser.iNormalHubs ~= "0" ) then
		SendToNick( sUser.sName , DisconnectMessage )
		sUser:Disconnect()
	end
end
Give this a try...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Teddy

Thanks you fix it

Teddy

it seams to not work  X(

James

#4
maybe this : anti-open-hub by ?????? and not tested.

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( "PtokaX", "Du bist in PublicHubs. Die Verbindung wird in "..iTimeAfter.." Secunden unterbrochen")
		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( "PtokaX", "Thanks." )
			elseif user.iNormalHubs > 0 then
				tBadOnes[nick] = tBadOnes[nick] - 1
				if tBadOnes[nick] == 0 then
					tBadOnes[nick] = nil
					user:SendData( "PtokaX", "Disconnect wegen Publichubs." )
					user:Disconnect()
				elseif tBadOnes[nick] == math.floor( iTimeAfter / 2 ) then
					user:SendData ( "PtokaX", " Bitte keine PublicHubs . Du hast noch "..math.floor( iTimeAfter / 2 ).." Secunden bis zur Trennung.." )
				end
			end
		end
	end
end

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

Teddy

Have test it in hub not work!!

SMF spam blocked by CleanTalk