PX OpOnly Script to DCH Script
 

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

PX OpOnly Script to DCH Script

Started by Madman, 09 February, 2005, 00:44:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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

Bot = "OpOnly"
NrOpHub = 2 --//Minimum Number Of OpHubs
SendInfo = 1 --//Send Info On Connect
DisRedir = 1 --//Disconnect = 1, Redirect = 0
Addy = "Put Redir Addy Here"

function DataArrival(curUser,data)
	if (strsub(data,1,7)=="$MyINFO") then
		s,e,OpHubs = strfind(data,"$MyINFO $ALL.*,H:%d+/%d+/(%d+)")
		if s then
			if (tonumber(OpHubs) < NrOpHub) then
				if DisRedir==0 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being redirected.")
					curUser:SendData(Bot, "Redirecting to: "..Addy.."|$ForceMove "..Addy.."|")
				elseif DisRedir==1 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
					curUser:Disconnect()
				end
			end
		else
			curUser:SendData(Bot, "I cant check your hubs. You are being disconnected.")
			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 " ..(OpHubs+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 " ..OpHubs.. " hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		end
	end
end

OpConnected = NewUserConnected

Hi, I made this for Daywalker when he was using PX
Now he has switched to DCH and asked me to convert it, so it works in DCH...
But i cant get it to work...
So if anyone could help us out would be nice =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

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

#1
hi m8   Give this a try  ..

--//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
--
-- Attempted Conversion to DCH++ by ??????Hawk?????? ( untested )
--
local Bot = "OpOnly"
local NrOpHub = 2 --//Minimum Number Of OpHubs
local SendInfo = 1 --//Send Info On Connect
local DisRedir = 1 --//Disconnect = 1, Redirect = 0
local Addy = "Put Redir Addy Here"

function dchpp.clientUnknownCommand( client, data )
	if (string.sub(data,1,7)=="$MyINFO") then
		s,e,OpHubs = string.find(data,"$MyINFO $ALL.*,H:%d+/%d+/(%d+)")
		if s then
			if (tonumber(OpHubs) < NrOpHub) then
				if DisRedir==0 then
					client:send(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being redirected.")
					client:send(Bot, "Redirecting to: "..Addy.."|$ForceMove "..Addy.."|")
				elseif DisRedir==1 then
					client:send(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
					client:Disconnect()
				end
			end
		else
			client:send(Bot, "I cant check your hubs. You are being disconnected.")
			client:Disconnect() 
		end
	end
end

--//The Info On Connect ;p
function dchpp.userConnected( client )
local nick = client:getNick()
local level = client:getLevel()
	if SendInfo==1 then
		if level >= 2 then
			client:send(Bot, "Hi, Op " ..nick.. " you are Op in " ..(OpHubs+1).." hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		else
			client:send(Bot, "Hi, " ..nick.. " you are Op in " ..OpHubs.. " hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		end
	end
end

6Marilyn6Manson6

#2
Hello I have change it:

--//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
--//Change redirect by 6Marilyn6Manson6
--//Add TimeBan and ban by 6Marilyn6Manson6

Bot = "OpOnly"
NrOpHub = 2 --//Minimum Number Of OpHubs
SendInfo = 1 --//Send Info On Connect
DisRedir = 0 --//Ban = 3, TimeBan = 2, Disconnect = 1, Redirect = 0

function Main()
	frmHub:EnableFullData(1)
	time = "60"
end

function DataArrival(curUser,data)
	if (strsub(data,1,7)=="$MyINFO") then
		s,e,OpHubs = strfind(data,"$MyINFO $ALL.*,H:%d+/%d+/(%d+)")
		if s then
			if (tonumber(OpHubs) < NrOpHub) then
				if DisRedir==0 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being redirected.")
					curUser:SendData(Bot, "Redirecting... |$ForceMove "..frmHub:GetRedirectAddress().."|")
				elseif DisRedir==1 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being disconnected.")
					curUser:Disconnect()
				elseif DisRedir==2 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being timeban.")
					curUser:TimeBan(time)
				elseif DisRedir==3 then
					curUser:SendData(Bot, "You are not op in " ..NrOpHub.. " hubs. You are being banned.")
					curUser:Ban()
				end
			end
		else
			curUser:SendData(Bot, "I cant check your hubs. You are being disconnected.")
			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 " ..(OpHubs+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 " ..OpHubs.. " hubs. The minimum number of ophubs allowed is " ..NrOpHub)
		end
	end
end

OpConnected = NewUserConnected


bye of6Marilyn6Manson6
MyHUB: planetarium.ichnusanet.net

Madman

Here is my script for dch++
It took some time to figuer out but we got it working...
It dont contain everything as the PX one.. but this is enough... =)

--//OpOnly Script Made By Madman
--//Tested By Daywalker™

--//Disconnect The User If He Dont Are Op In 2 Hubs
--//But If User Is Op In The Hub, It Dosent Matter If He Is Op In Less Then 2 Hubs

-- We Havent Tested With A Client Without Tag

function dchpp.userConnected(client) --//User Connect
	local msg = client:getMyInfo()
	local ret,c,desc = string.find( msg, "$MyINFO $ALL.*,H:%d+/%d+/(%d+)" ) --//Get The MyInfo
	if ret then --//If We Got It
		if client:isOp() then --//If User Is Op
			client:hubMessage(
				"Welcome, To This Nice Hub|" --//Send This
			)
		else --//If Not Op Then
			if (tonumber(desc) < 2 ) then --//If Op Hubs Below 2
				client:hubMessage( --//Send This
					"You are in "..desc.." hubs, minimum is 2\r\n"..
					"You will be Disconnected..\r\n|"
				)
				client:disconnect() --//And Disconnet
				return dchpp.ACTION_DISCONNECTED
			end
		end
	else --//If No MyInfo
		client:hubMessage( --//Send This
			"Cant read your tag!\r\n"..
			"You will be Disconneted..\r\n|"
		)
		client:disconnect() --//And Disconnect
		return dchpp.ACTION_DISCONNECTED
	end
end
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