OpOnly - Lua 5
 

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

OpOnly - Lua 5

Started by Madman, 23 March, 2005, 22:50:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Madman

Converted to lua 5...

damm... I just realized..
i got this script in lua 4, lua 5 for px and lua 5 for dch++

--//TagChecker Made By Madman
--//Stripped From -Dark-Mind- Made By ?
--//And Ofcourse Modded By Madman =)
--//Modded To OpOnly
--//Small changes by Optimus
--//Some Stuff Added By Madman
--//+1 If User Is Op In This Hub
--//Redir Options Requested By Daywalker
--//MOTD Will Be Shown When Redirecting
--//Nothing We Can Do About It
--//Thanks For The Help LUA Hub Tho...
--//To See If Anything Could Be Done
---------------------------------------
--//Rewritten to lua5
--//Thanks to PPK's wonderful work, i could remove lots of lines
--//If no tag, even if Px is accepting users without tag they will be droped...

--==Important!==--
--If using the redirect option
--Make sure that you have redirect address written in the field under the Network tab

Bot = "OpOnly"
NrOpHub = 2 --//Minimum number of ophubs
SendInfo = 1 --//Send info on connect
DisRedir = 1 --//Disconnect = 1, Redirect = 0

function MyINFOArrival(curUser, data)
	if curUser.bHasTag then
		if curUser.iOpHubs < NrOpHub then
			if DisRedir == 0 then
				curUser:Redirect(frmHub:GetRedirectAddress(), "You are not op in " ..NrOpHub.. " hubs.")
			elseif DisRedir == 1 then
				curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
				curUser:Disconnect()
			end
		end
	else
		if DisRedir == 0 then
			curUser:Redirect(frmHub:GetRedirectAddress(), "Cant read your tag, go away!")
		elseif DisRedir == 1 then
			curUser:SendData(Bot, "Cant read your tag, go away!")
			curUser:Disconnect()
		end
	end
end

--//The info on connect ;p
function NewUserConnected(curUser)
	if SendInfo == 1 then
		if curUser.bOperator then
			--//Added +1 to this line beacuse it dosent count your hub
			curUser:SendData(Bot, "Hi, Op " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs+1).." hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		elseif not curUser.bOperator then
			curUser:SendData(Bot, "Hi, " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs).. " hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		end
	end
end

OpConnected = NewUserConnected
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Madman

--//TagChecker Made By Madman
--//Stripped From -Dark-Mind- Made By ?
--//And Ofcourse Modded By Madman =)
--//Modded To OpOnly
--//Small changes by Optimus
--//Some Stuff Added By Madman
--//+1 If User Is Op In This Hub
--//Redir Options Requested By Daywalker
--//MOTD Will Be Shown When Redirecting
--//Nothing We Can Do About It
--//Thanks For The Help LUA Hub Tho...
--//To See If Anything Could Be Done
---------------------------------------
--//Rewritten to lua5
--//Thanks to PPK's wonderful work, i could remove lots of lines
--//If no tag, even if Px is accepting users without tag they will be droped...
--//MOTD wont be shown anymore when redirecting
--//Removed option to drop users with no tag
--//If user is regged then dont check
--//if useing DCGUI user will be disconnected, beacuse, they use old style tag, and there for cant be checked

--==Important!==--
--If using the redirect option
--Make sure that you have redirect address written in the field under the Network tab

Bot = "OpOnly"
NrOpHub = 2 --//Minimum number of ophubs
SendInfo = 1 --//Send info on connect
DisRedir = 1 --//Disconnect = 1, Redirect = 0

function MyINFOArrival(curUser, data)
	if curUser.bHasTag then
		if curUser.sClient == "Valknut" then
			curUser:SendData(Bot, "Your client cant be checked for op hubs, there for you will be disconneted")
			curUser:Disconnect()
		end
		if curUser.iOpHubs < NrOpHub then
			if curUser.bRegistered then
			else
				if DisRedir == 0 then
					curUser:Redirect(frmHub:GetRedirectAddress(), "You are not op in " ..NrOpHub.. " hubs.")
				elseif DisRedir == 1 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
					curUser:Disconnect()
				end
			end
		end
	end
end

--//The info on connect ;p
function NewUserConnected(curUser)
	if SendInfo == 1 then
		if curUser.bOperator then
			--//Added +1 to this line beacuse it dosent count your hub
			curUser:SendData(Bot, "Hi, Op " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs+1).." hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		elseif not curUser.bOperator then
			curUser:SendData(Bot, "Hi, " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs).. " hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		end
	end
end

OpConnected = NewUserConnected

a little update...

--//MOTD wont be shown anymore when redirecting
--//Removed option to drop users with no tag
--//If user is regged then dont check
--//if useing DCGUI user will be disconnected, beacuse, they use old style tag, and there for cant be checked
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Madman

--//TagChecker Made By Madman
--//Stripped From -Dark-Mind- Made By ?
--//And Ofcourse Modded By Madman =)
--//Modded To OpOnly
--//Small changes by Optimus
--//Some Stuff Added By Madman
--//+1 If User Is Op In This Hub
--//Redir Options Requested By Daywalker
--//MOTD Will Be Shown When Redirecting
--//Nothing We Can Do About It
--//Thanks For The Help LUA Hub Tho...
--//To See If Anything Could Be Done
---------------------------------------
--//Rewritten to lua5
--//Thanks to PPK's wonderful work, i could remove lots of lines
--//If no tag, even if Px is accepting users without tag they will be droped...
--//MOTD wont be shown anymore when redirecting
--//Removed option to drop users with no tag
--//If user is regged then dont check
--//if useing DCGUI user will be disconnected, beacuse, they use old style tag, and there for cant be checked
-- Added: OnError function
-- Fixed: if using old style tag they got in, fixed now, (Thanks to the stupid faker who made me notice it =))
-- Removed: Anti DcGui, shouldnt be able to enter anyway beacuse of the iOopHubs nil check....

--==Important!==--
--If using the redirect option
--Make sure that you have redirect address written in the field under the Network tab

Bot = "OpOnly"
NrOpHub = 2 --//Minimum number of ophubs
SendInfo = 1 --//Send info on connect
DisRedir = 1 --//Disconnect = 1, Redirect = 0

function MyINFOArrival(curUser, data)
	if curUser.bHasTag then
		if curUser.iOpHubs == nil or curUser.iOpHubs < NrOpHub then
			if curUser.bRegistered then
			else
				if DisRedir == 0 then
					curUser:Redirect(frmHub:GetRedirectAddress(), "You are not op in " ..NrOpHub.. " hubs.")
				elseif DisRedir == 1 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
					curUser:Disconnect()
				end
			end
		end
	end
end

--//The info on connect ;p
function NewUserConnected(curUser)
	if SendInfo == 1 then
		if curUser.bOperator then
			--//Added +1 to this line beacuse it dosent count your hub
			curUser:SendData(Bot, "Hi, Op " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs+1).." hubs. The minimum number of ophubs allowed for unregs is " ..NrOpHub)
		elseif not curUser.bOperator then
			curUser:SendData(Bot, "Hi, " ..curUser.sName.. " you are Op in " ..(curUser.iOpHubs).. " hubs. The minimum number of ophubs allowed for unregs is " ..NrOpHub)
		end
	end
end

function OnError(ErrorMsg)
SendToOps(Bot, "Error!\t" ..ErrorMsg)
end

OpConnected = NewUserConnected

Another Update...
-- Added: OnError function
-- Fixed: if using old style tag they got in, fixed now, (Thanks to the stupid faker who made me notice it =))
-- Removed: Anti DcGui, shouldnt be able to enter anyway beacuse of the iOopHubs nil check....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk