Anti Open Hub Help
 

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

Hi trying to get Profiles Support into this one so that the script can block ppl for being in a certain ammount of Open Hubs/RegHubs/Admin Hubs

found a myinfo scanner in Lawmaker and have been trying to get things muddled around so it would work.

Now seeing i'm still a noob and got myself stuck again could someone have a look at this and tell me if i'm even going in the right direction?  :D

Bot_N = "OpenHubCheck"
openLimit = 1				--// Hier k?nnen Anzahl erlaubte Open Hubs eingestellt werden
regLimit = 5
opLimit = 3
KickMsg = "Du bist in [open] Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!" --- Vorsicht "[open]" ist teil der Nachricht und zeigt die Anzahl Open Hubs an ... 
switch = 1				--// Hier wird der Standard gesetzt 1 ein oder 0 aus
Prefix = "!"				--// Hier kommt das Prefix f?r die Befehle rein
ChangeStatus = "change"		--// Hier kommt der Befehl um den Check ein und aus zu schalten
AddUser = "oadd"			--// Hier kommt der Befehl rein um User f?r 1 Sitzung vom Check auszuschliessen 
DelUser = "odel"			--// Hier kommt der Befehl rein um User von der nicht-check liste zu streichen
ListUsers = "olist"			--// User auflisten die nicht gecheckt werden
--End User Settings----------------------------------------------------------------------------------
--AB-Hier-bitte-nichts-mehr-?ndern!!!-----------------------------------------------------------

function DataArrival(user, data)
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
		-- local s,e,openhubs = strfind(data, ",H:(%d+)");
		local _,_,openhubs,reghubs,ophubs = strfind(Hubs,"(%d+)/(%d+)/(%d+)");
		if switch == 1 and ( tonumber(openhubs) >= openLimit ) and ( tonumber(reghubs) >= regLimit ) and ( tonumber(ophubs) >= opLimit ) then
			local msg = gsub(KickMsg, "%b[open]", openhubs)
			local msg = gsub(KickMsg, "%b[rehu]", reghubs)
			local msg = gsub(KickMsg, "%b[ophu]", ophubs)
			user:SendData(Bot_N, msg)-- gsub(KickMsg, "%b[open]", openhubs) )
			user:Disconnect()
		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 deaktiviert")
			elseif switch == 0 then 
				switch = 1
				user:SendData(Bot_N, "Anti Open Hub Check aktiviert")
			end
			return 1
		elseif (cmd==Prefix..AddUser) then
			if arg  and arg ~= "" then 
				if excludeUsers[arg] then
					user:SendData("Der User "..arg.." ist bereits vom Open Hub Check ausgeschlossen")
				else
					excludeUsers[arg] = 1
					user:SendData("Der User "..arg.." wird in dieser Sitzung nicht kontrolliert ...")
				end
			else 
				user:SendData(Bot_N, "Bitte verwende: "..Prefix..AddUser.." ")
			end
		elseif (cmd==Prefix..DelUser) then
			if arg and arg ~= "" then
				if excludeUsers[arg] then
					excludeUsers[arg] = nil 
					user:SendData("User "..arg.." wird wieder vom Anti Open Hub Check kontrolliert")
				else 
					user:SendData("Ich habe keinen "..arg.." in meiner liste")
				end
			else
				user:SendData(Bot_N, "Bitte verwende: "..Prefix..DelUser.." ")
			end
		elseif (cmd==Prefix..ListUsers) then
			local msg = "Die folgenden User werden mindestens f?r diese Sitzung nicht nach Open Hubs kontrolliert\r\n"
			for nick, v in excludeUsers do
				msg = msg.."\t - "..nick.."\r\n"
			end
			user:SendData(Bot_N, msg)
		end
	end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

I havent posted any of my scripts in Greek ...

would you mind changing this with the English ver ?

Psycho_Chihuahua

#2
sure no problem

Bot_N = "OpenHubCheck"
openLimit = 1				--// Amount of Open Hubs allowed
regLimit = 5				--// Amount of Reg Hubs allowed
opLimit = 3				--// Amount of Op Hubs allowed
KickMsg = "You are in [open] Open Hubs. Which is against aour Rules. Connection Terminated!" --- Vorsicht "[open]" ist teil der Nachricht und zeigt die Anzahl Open Hubs an ... 
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 s,e,openhubs = strfind(data, ",H:(%d+)");
		local _,_,Guest,Reg,OP = strfind(Hubs,"(%d+)/(%d+)/(%d+)");
		if switch == 1 and ( tonumber(Guest) >= openLimit ) and ( tonumber(Reg) >= regLimit ) and ( tonumber(OP) >= opLimit ) then
			local msg = gsub(KickMsg, "%b[open]", Guest)
			local msg = gsub(KickMsg, "%b[rehu]", Reg)
			local msg = gsub(KickMsg, "%b[ophu]", OP)
			if 
			user:SendData(Bot_N, msg)-- gsub(KickMsg, "%b[open]", openhubs) )
			user:Disconnect()
		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
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

Okie thx, now we can talk .. :)

Psycho_Chihuahua

is this string correct btw?

local _,_,openhubs,reghubs,ophubs = strfind(Hubs,"(%d+)/(%d+)/(%d+)");

i mean to read out the amount of hubs the user is conected to an as what?
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

QuoteOriginally posted by Psycho_Chihuahua
is this string correct btw?

local _,_,openhubs,reghubs,ophubs = strfind(Hubs,"(%d+)/(%d+)/(%d+)");

i mean to read out the amount of hubs the user is conected to an as what?

no

G/R/O

its Guest/Reg/OP

beware: dcgui sends oldstyle hubcount (H:x,S:y) tag
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

edited my top posti'm not getting very far ^^ just hope i'm still on the right track
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

u know this 1:
function scanmyinfo(myinfo)
	local _,_,Hubs,Slots,speed = strfind(myinfo, "H:([^,]+),S:(%d+).*>$ $(.-).%$")
	local Guest,Reg,OP,slots,hubs,ratio
	local Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn=slotperhub[speed].max_slots,slotperhub[speed].min_ratio,slotperhub[speed].max_hubs,slotperhub[speed].min_limit
	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
	local Share = format("%0.2f", tonumber(temp)/gb)
	if limit1 then
		return hubs,slots,Guest,Reg,OP,speed,limit1,Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn,ratio,Share
	elseif limit2 then
		return hubs,slots,Guest,Reg,OP,speed,limit2,Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn,ratio,Share
	else
		return hubs,slots,Guest,Reg,OP,speed,nil,Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn,ratio,Share
	end
end

this is what u requested somewhere else

it returns 13 values
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

thnx m8

i only need the three ^^ all that is neccesary is to count in how many hubs and as what (Guest/Reg/OP).

this is only supposed to be able to block certain connection ammounts (started off with only blocking users who were guests in open hubs)

well i'll see what i can do with it as i dont understand everything included  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

this does all calculation, exclude the ones u dont need from return
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

#10
Weird no Syntax Errors No running Errors - but it just dont work  ;(

excludeUsers = {
	["bobby"]=1,			 --// Hier kommen die vom Check f?r immer ausgeschlossene User rein
	["Uwe"]=1,			 --// Hier kommen die vom Check f?r immer ausgeschlossene User rein
	["Freebird"]=1,			 --// Hier kommen die vom Check f?r immer ausgeschlossene User rein
	}  --// und so weiter...

Bot_N = "OpenHubCheck"
openLimit = 0				--// Amount of Open Hubs allowed
regLimit = 2				--// Amount of Reg Hubs allowed
opLimit = 0				--// 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 [rehu] hubs as a registered User. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [ophu] 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 Guest,Reg,OP
		if switch == 1 then
			if ( tonumber(Guest) >= openLimit ) then
				local msg = gsub(GKickMsg, "%b[open]", Guest)
			user:SendData(Bot_N, msg)-- gsub(GKickMsg, "%b[open]", openhubs) )
			user:Disconnect()
		elseif ( tonumber(Reg) >= regLimit ) then
				local msg = gsub(KickMsg, "%b[rehu]", Reg)
			user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[rehu]", Guest) )
			user:Disconnect()
		elseif ( tonumber(OP) >= opLimit ) then
				local msg = gsub(KickMsg, "%b[ophu]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[ophu]", 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,slots,hubs,ratio
	local  Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn=slotperhub[speed].max_slots,slotperhub[speed].min_ratio,slotperhub[speed].max_hubs,slotperhub[speed].min_limit
	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
	local Share = format("%0.2f", tonumber(temp)/gb)
	if limit1 then
		return  hubs,Guest,Reg,OP
	elseif limit2 then
		return  hubs,Guest,Reg,OP
	else
		return  hubs,Guest,Reg,OP
	end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

strsub(data, 1,7) == myinfo  ?
Whats that?

Psycho_Chihuahua

QuoteOriginally posted by VidFamne
strsub(data, 1,7) == myinfo  ?
Whats that?

trying to tell the bot to read it out of

function scanmyinfo(myinfo)  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

#13
Hmm, there is no myinfo in DataArrival what I know of.
Only $MyINFO
Perhaps I'm wrong
**Edit
And I think you have to declare
myinfo = user.sMyInfoString
in there some place.

Psycho_Chihuahua

#14
diesnt work with "$MYINFO" either

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				--// 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 [rehu] hubs as a registered User. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [ophu] 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)
myinfo = user.sMyInfoString 
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
		local Guest,Reg,OP;
		if switch == 1 then
			if ( tonumber(Guest) >= 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[rehu]", Reg)
			user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[rehu]", Reg) )
			user:Disconnect()
		elseif ( tonumber(OP) >= opLimit ) then
				local msg = gsub(KickMsg, "%b[ophu]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[ophu]", 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,slots,hubs,ratio
	local  Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn=slotperhub[speed].max_slots,slotperhub[speed].min_ratio,slotperhub[speed].max_hubs,slotperhub[speed].min_limit
	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
	local Share = format("%0.2f", tonumber(temp)/gb)
	if limit1 then
		return  hubs,Guest,Reg,OP
	elseif limit2 then
		return  hubs,Guest,Reg,OP
	else
		return  hubs,Guest,Reg,OP
	end
end

receive

Syntax Error: attempt to compare nil with number
Syntax Error: attempt to compare nil with number
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne


Psycho_Chihuahua

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

I would begin like this;
if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	myinfo = user.sMyInfoString
	local openhubs,Guest,Reg,OP = scanmyinfo(myinfo)

Psycho_Chihuahua

#18
I got the first check working again already ... but from there on it doesnt go on to the second(Reg) and third )OP) check.....

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				--// 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 [rehu] hubs as a registered User. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [ophu] 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)
		if switch == 1 then
			if ( tonumber(Guest) > 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


Result is

Syntax Error: bad argument #1 to `strfind' (string expected, got nil)
Syntax Error: bad argument #1 to `gsub' (string expected, got nil)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

QuoteOriginally posted by VidFamne
I would begin like this;
if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	myinfo = user.sMyInfoString
	local openhubs,Guest,Reg,OP = scanmyinfo(myinfo)

if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
	local openhubs,Guest,Reg,OP = scanmyinfo(user.sMyInfoString)
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

edited my last post
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

replace this:

local msg = gsub(GKickMsg, "%b[open]", Guest)


to this:

local msg = gsub(GKickMsg, "(%b[])", Guest)
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

#22
Bot_N = "OpenHubCheck"
openLimit = 1				--// Amount of Open Hubs allowed
regLimit = 5				--// Amount of Reg Hubs allowed
opLimit = 3				--// Amount of Op Hubs allowed
GKickMsg = "You are in [open] Open Hubs. Which is against our Rules. Connection Terminated!"
RKickMsg = "You are in [rehu] Open Hubs. Which is against our Rules. Connection Terminated!"
OKickMsg = "You are in [ophu] Open Hubs. 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 scanmyinfo(myinfo)
	local _,_,Hubs,Slots,speed = strfind(myinfo, "H:([^,]+),S:(%d+).*>$ $(.-).%$")
	local Guest,Reg,OP,slots,hubs,ratio
	local  Maxslotsforconn,Ratioforconn,Maxhubsforconn,minlimitforconn=slotperhub[spee
d].max_slots,slotperhub[speed].min_ratio,slotperhub[speed].max_hubs,slotperhub[speed].min_limit
	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
	local Share = format("%0.2f", tonumber(temp)/gb)
	if limit1 then
		return  hubs,Guest,Reg,OP
	elseif limit2 then
		return  hubs,Guest,Reg,OP
	else
		return  hubs,Guest,Reg,OP
	end
end

function DataArrival(user, data)
	if strsub(data, 1,7) == "$MyINFO" and (not excludeUsers[user.sName]) then
		local Guest,Reg,OP
		if switch == 1 then
			if ( tonumber(Guest) >= openLimit ) then
				local msg = gsub(GKickMsg, "%b[open]", Guest)
			user:SendData(Bot_N, msg)-- gsub(GKickMsg, "%b[open]", openhubs) )
			user:Disconnect()
		elseif ( tonumber(Reg) >= regLimit ) then
				local msg = gsub(KickMsg, "%b[rehu]", Reg)
			user:SendData(Bot_N, msg)-- gsub(RKickMsg, "%b[rehu]", Guest) )
			user:Disconnect()
		elseif ( tonumber(OP) >= opLimit ) then
				local msg = gsub(KickMsg, "%b[ophu]", OP)
			user:SendData(Bot_N, msg)-- gsub(OKickMsg, "%b[open]", OP) )
			user:Disconnect()
		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
whatever i do i only get this now

Syntax Error: bad argument #1 to `strfind' (string expected, got nil)
Syntax Error: bad argument #1 to `gsub' (string expected, got nil)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

done some more shuffling but still get errors

Syntax Error: bad argument #1 to `strfind' (string expected, got nil)
Syntax Error: attempt to compare nil with number

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 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
	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

i had it kicking every1 for not bein in open hubs but that also wasnt the point but now nothing works anymore :(
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

where do those errors happen ? lines ?

SMF spam blocked by CleanTalk