Anti Open Hub Help - Page 2
 

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

Anti Open Hub Help

Started by Psycho_Chihuahua, 13 October, 2004, 14:55:45

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Psycho_Chihuahua

QuoteOriginally posted by Herodes
where do those errors happen ? lines ?

Thoes r the only Error messages given out by ptokax in the script editor part
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

try changing this
local Hubs,Guest,Reg,OP = scanmyinfo(user.sMyInfoString)
to this ...
local Hubs,Guest,Reg,OP = scanmyinfo(strsub(data, 1 ,-2) )
lets see if it works ..

Psycho_Chihuahua

nope  ;(  ;(  ;(

No syntax errors in script file antiopenhub.lua
Syntax Error: attempt to compare nil with number
Syntax Error: attempt to compare nil with number
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

any more idea's ? i've tryied changing openhubs to Hubs and vica versaand get the same errors.

I dont get anything else reported to say in which line the error is so haven't a clue to where it lies
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

ophubscount can only be 1 or 0 and indicate whether op hubs count into total no. of hubs or not... sry i forgot 2 mention
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

yeah i noticed that and u see up in my post i only set the explanation in 1 line to low ^^  so i dont think it's that causing probs but much more something in this part
function DataArrival(user, data)
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	local Hubs,Guest,Reg,OP = scanmyinfo(user.sMyInfoString)
		if switch == 1 then
			if ( tonumber(openhubs) > openLimit ) then
				local msg = gsub(GKickMsg, "%b[open]", Guest)
				user:SendData(Bot_N, msg)-- gsub(GKickMsg, "%b[open]", Guest) )
				user:Disconnect() 
			elseif ( tonumber(Reg) > regLimit ) then
				local msg = gsub(KickMsg, "%b[Reg]", Reg)
				user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[Reg]", Reg) )
				user:Disconnect()
			elseif ( tonumber(OP) > opLimit ) then
				local msg = gsub(KickMsg, "%b[OP]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[OP]", OP) )
			user:Disconnect()
		end
	end
just i dont have a clue what is wrong with it just a guess that it's somewhere in this part
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

This line;
if ( tonumber(openhubs) > openLimit ) then
to this;
if ( tonumber(Guest) > openLimit ) then
and try to change to "%b[]"

bastya_elvtars

yea that is a prob 2 but the real is:
excludeUsers = {
	["Nick1"]=1,			 --// Users who will not be checked at all
	}  --// and so on...


Bot_N = "OpenHubCheck"
openLimit = 1				--// Amount of Open Hubs allowed
regLimit = 1				--// Amount of Reg Hubs allowed
opLimit = 0
ophubscount = 1				--// Amount of Op Hubs allowed
GKickMsg = "You are in [open] hubs as a guest. Which is against our Rules. Connection Terminated!"
RKickMsg = "You are in [Reg] hubs as a registered User. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [OP] hubs as an Operator. Which is against our Rules. Connection Terminated!"
switch = 1				--// Standard 1 On oder 0 Off
Prefix = "!"				--// Prefix for the cmd's
ChangeStatus = "change"		--// Change Check Status
AddUser = "oadd"			--// Ad User to imune list 
DelUser = "odel"			--// Del User from imune list
ListUsers = "olist"			--// List imune Users
--End User Settings----------------------------------------------------------------------------------




function DataArrival(user, data)
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	local openhubs,Guest,Reg,OP = scanmyinfo(user.sMyInfoString) -- renamed the value from Hubs to openhubs, cause openhubs was an undeclared value
		if switch == 1 then
			if ( tonumber(openhubs) > openLimit ) then
				local msg = gsub(GKickMsg, "%b[open]", Guest)
				user:SendData(Bot_N, msg)-- gsub(GKickMsg, "%b[open]", Guest) )
				user:Disconnect() 
			elseif ( tonumber(Reg) > regLimit ) then
				local msg = gsub(KickMsg, "%b[Reg]", Reg)
				user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[Reg]", Reg) )
				user:Disconnect()
			elseif ( tonumber(OP) > opLimit ) then
				local msg = gsub(KickMsg, "%b[OP]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[OP]", OP) )
			user:Disconnect()
		end
	end
	elseif strsub(data, 1,1) =="<" and user.bOperator then
		data = strsub(data, 1, strlen(data)-1)
		s,e,cmd,arg = strfind(data, "%b<>%s+(%S+)%s*(.*)")
		if (cmd==Prefix..ChangeStatus) then
			if switch == 1 then 
				switch = 0
				user:SendData(Bot_N, "Anti Open Hub Check deactivated")
			elseif switch == 0 then 
				switch = 1
				user:SendData(Bot_N, "Anti Open Hub Check activated")
			end
			return 1
		elseif (cmd==Prefix..AddUser) then
			if arg  and arg ~= "" then 
				if excludeUsers[arg] then
					user:SendData("User "..arg.." is already on my immune list")
				else
					excludeUsers[arg] = 1
					user:SendData("User "..arg.." now on my immune list for this session ...")
				end
			else 
				user:SendData(Bot_N, "Please Use: "..Prefix..AddUser.." ")
			end
		elseif (cmd==Prefix..DelUser) then
			if arg and arg ~= "" then
				if excludeUsers[arg] then
					excludeUsers[arg] = nil 
					user:SendData("User "..arg.." wiped from my imune list")
				else 
					user:SendData("I dont have a "..arg.." on my list")
				end
			else
				user:SendData(Bot_N, "Please Use: "..Prefix..DelUser.." ")
			end
		elseif (cmd==Prefix..ListUsers) then
			local msg = "The following Users do not get checked by Anti Open Hub Script\r\n"
			for nick, v in excludeUsers do
				msg = msg.."\t - "..nick.."\r\n"
			end
			user:SendData(Bot_N, msg)
		end
	end
end




function scanmyinfo(myinfo)
	local _,_,Hubs,Slots,speed = strfind(myinfo, "H:([^,]+),S:(%d+).*>$ $(.-).%$")
	local Guest,Reg,OP
	local _,_,limit1=strfind(myinfo,"[BLU]:(%d+)")
	local _,_,limit2 = strfind(myinfo,"F:%d+/(%d+)")
	local _,_,temp = strfind(myinfo, "$(%d+)%$")
	if tonumber (Hubs) then
		if Hubs=="0" then
			Guest,Reg,OP= "0", "1" , "0"
		else
			Guest,Reg,OP=  Hubs, "0", "0"
		end
	else
		_,_, Guest,Reg,OP = strfind(Hubs,"(%d+)/(%d+)/(%d+)")
	end
	if ophubscount==1 then
		hubs = tonumber(Guest)+tonumber(Reg)+tonumber(OP)
		slots=tonumber(Slots)
		ratio=slots/hubs
	else
		hubs = tonumber(Guest)+tonumber(Reg)
		slots=tonumber(Slots)
		if hubs==0 then
			ratio=slots
		else
			ratio=slots/hubs
		end
	end
	if limit1 then
		return  hubs,Guest,Reg,OP
	elseif limit2 then
		return  hubs,Guest,Reg,OP
	else
		return  hubs,Guest,Reg,OP
	end
end
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

#33
well i tried that to but it doesnt seem top help...


the only one disconnecting at all so far is this on (had tried it earlier)

excludeUsers = {
	["Nick1"]=1,			 --// Users who will not be checked at all
	}  --// and so on...


Bot_N = "OpenHubCheck"
openLimit = 0				--// Amount of Open Hubs allowed
regLimit = 1				--// Amount of Reg Hubs allowed
opLimit = 0
ophubscount = 1				--// Amount of Op Hubs allowed
GKickMsg = "You are in [open] hubs as a guest. Which is against our Rules. Connection Terminated!"
RKickMsg = "You are in [Reg] hubs as a registered User. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [OP] hubs as an Operator. Which is against our Rules. Connection Terminated!"
switch = 1				--// Standard 1 On oder 0 Off
Prefix = "!"				--// Prefix for the cmd's
ChangeStatus = "change"		--// Change Check Status
AddUser = "oadd"			--// Ad User to imune list 
DelUser = "odel"			--// Del User from imune list
ListUsers = "olist"			--// List imune Users
--End User Settings----------------------------------------------------------------------------------




function DataArrival(user, data)
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	local openhubs,Guest,Reg,OP = scanmyinfo(user.sMyInfoString) -- renamed the value from Hubs to openhubs, cause openhubs was an undeclared value
		if switch == 1 then
			if ( tonumber(openhubs) > openLimit ) then
				local msg = gsub(GKickMsg, "%b[open]", Guest)
				user:SendData(Bot_N, msg)-- gsub(GKickMsg, "%b[open]", Guest) )
				user:Disconnect() 
			elseif ( tonumber(Reg) > regLimit ) then
				local msg = gsub(KickMsg, "%b[Reg]", Reg)
				user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[Reg]", Reg) )
				user:Disconnect()
			elseif ( tonumber(OP) > opLimit ) then
				local msg = gsub(KickMsg, "%b[OP]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[OP]", OP) )
			user:Disconnect()
		end
	end
	elseif strsub(data, 1,1) =="<" and user.bOperator then
		data = strsub(data, 1, strlen(data)-1)
		s,e,cmd,arg = strfind(data, "%b<>%s+(%S+)%s*(.*)")
		if (cmd==Prefix..ChangeStatus) then
			if switch == 1 then 
				switch = 0
				user:SendData(Bot_N, "Anti Open Hub Check deactivated")
			elseif switch == 0 then 
				switch = 1
				user:SendData(Bot_N, "Anti Open Hub Check activated")
			end
			return 1
		elseif (cmd==Prefix..AddUser) then
			if arg  and arg ~= "" then 
				if excludeUsers[arg] then
					user:SendData("User "..arg.." is already on my immune list")
				else
					excludeUsers[arg] = 1
					user:SendData("User "..arg.." now on my immune list for this session ...")
				end
			else 
				user:SendData(Bot_N, "Please Use: "..Prefix..AddUser.." ")
			end
		elseif (cmd==Prefix..DelUser) then
			if arg and arg ~= "" then
				if excludeUsers[arg] then
					excludeUsers[arg] = nil 
					user:SendData("User "..arg.." wiped from my imune list")
				else 
					user:SendData("I dont have a "..arg.." on my list")
				end
			else
				user:SendData(Bot_N, "Please Use: "..Prefix..DelUser.." ")
			end
		elseif (cmd==Prefix..ListUsers) then
			local msg = "The following Users do not get checked by Anti Open Hub Script\r\n"
			for nick, v in excludeUsers do
				msg = msg.."\t - "..nick.."\r\n"
			end
			user:SendData(Bot_N, msg)
		end
	end
end




function scanmyinfo(myinfo)
	local _,_,Hubs,Slots,speed = strfind(myinfo, "H:([^,]+),S:(%d+).*>$ $(.-).%$")
	local Guest,Reg,OP
	local _,_,limit1=strfind(myinfo,"[BLU]:(%d+)")
	local _,_,limit2 = strfind(myinfo,"F:%d+/(%d+)")
	local _,_,temp = strfind(myinfo, "$(%d+)%$")
	if tonumber (Hubs) then
		if Hubs=="0" then
			Guest,Reg,OP= "0", "1" , "0"
		else
			Guest,Reg,OP=  Hubs, "0", "0"
		end
	else
		_,_, Guest,Reg,OP = strfind(Hubs,"(%d+)/(%d+)/(%d+)")
	end
	if ophubscount==1 then
		hubs = tonumber(Guest)+tonumber(Reg)+tonumber(OP)
		slots=tonumber(Slots)
		ratio=slots/hubs
	else
		hubs = tonumber(Guest)+tonumber(Reg)
		slots=tonumber(Slots)
		if hubs==0 then
			ratio=slots
		else
			ratio=slots/hubs
		end
	end
	if limit1 then
		return  hubs,Guest,Reg,OP
	elseif limit2 then
		return  hubs,Guest,Reg,OP
	elseif temp then
		return  hubs,Guest,Reg,OP
	else
		return  hubs,Guest,Reg,OP
	end
end

Edit: hadnt seen your Post beforehand


and also your version bastya just take all hubs your in as open hubs and therefore just kick they dont go on to the next profile
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

so open hubs u mean unreg hubs? then u have bad terminology... :S
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

#35
hmm well yes with Open hubs i mean hubs in witch the user has Guest status

sorry but thats the translation from german to english ^^


Edit

I speak Swiss German most of the time  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

any idea's to what's wrong?

anybody?
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

SMF spam blocked by CleanTalk