PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Psycho_Chihuahua on 13 October, 2004, 14:55:45

Title: Anti Open Hub Help
Post by: Psycho_Chihuahua on 13 October, 2004, 14:55:45
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
Title:
Post by: Herodes on 13 October, 2004, 14:58:55
I havent posted any of my scripts in Greek ...

would you mind changing this with the English ver ?
Title:
Post by: Psycho_Chihuahua on 13 October, 2004, 15:28:15
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

Title:
Post by: Herodes on 13 October, 2004, 17:27:13
Okie thx, now we can talk .. :)
Title:
Post by: Psycho_Chihuahua on 13 October, 2004, 23:12:36
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?
Title:
Post by: bastya_elvtars on 13 October, 2004, 23:17:53
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
Title:
Post by: Psycho_Chihuahua on 14 October, 2004, 11:25:10
edited my top posti'm not getting very far ^^ just hope i'm still on the right track
Title:
Post by: bastya_elvtars on 14 October, 2004, 11:45:43
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
Title:
Post by: Psycho_Chihuahua on 14 October, 2004, 12:07:56
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
Title:
Post by: bastya_elvtars on 14 October, 2004, 12:19:47
this does all calculation, exclude the ones u dont need from return
Title:
Post by: Psycho_Chihuahua on 14 October, 2004, 20:02:55
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
Title:
Post by: VidFamne on 15 October, 2004, 03:37:04
strsub(data, 1,7) == myinfo  ?
Whats that?
Title:
Post by: Psycho_Chihuahua on 15 October, 2004, 03:38:45
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
Title:
Post by: VidFamne on 15 October, 2004, 03:44:09
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.
Title:
Post by: Psycho_Chihuahua on 15 October, 2004, 04:19:11
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
Title:
Post by: VidFamne on 15 October, 2004, 04:36:30
Try "$MyINFO"
Title:
Post by: Psycho_Chihuahua on 15 October, 2004, 04:37:59
same effect  ;(
Title:
Post by: VidFamne on 15 October, 2004, 05:00:06
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)
Title: Well
Post by: Psycho_Chihuahua on 15 October, 2004, 05:30:01
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)
Title:
Post by: bastya_elvtars on 15 October, 2004, 14:13:22
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)
Title:
Post by: Psycho_Chihuahua on 15 October, 2004, 15:12:40
edited my last post
Title:
Post by: bastya_elvtars on 15 October, 2004, 18:01:21
replace this:

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

to this:

local msg = gsub(GKickMsg, "(%b[])", Guest)
Title:
Post by: Psycho_Chihuahua on 15 October, 2004, 18:11:53
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)
Title:
Post by: Psycho_Chihuahua on 16 October, 2004, 19:42:41
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 :(
Title:
Post by: Herodes on 16 October, 2004, 20:05:07
where do those errors happen ? lines ?
Title:
Post by: Psycho_Chihuahua on 16 October, 2004, 20:43:31
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
Title:
Post by: Herodes on 16 October, 2004, 20:55:28
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 ..
Title:
Post by: Psycho_Chihuahua on 16 October, 2004, 21:08:28
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
Title:
Post by: Psycho_Chihuahua on 17 October, 2004, 16:44:22
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
Title:
Post by: bastya_elvtars on 17 October, 2004, 17:05:58
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
Title:
Post by: Psycho_Chihuahua on 17 October, 2004, 17:18:14
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
Title:
Post by: VidFamne on 17 October, 2004, 17:59:47
This line;if ( tonumber(openhubs) > openLimit ) then to this;if ( tonumber(Guest) > openLimit ) then and try to change to "%b[]"
Title:
Post by: bastya_elvtars on 17 October, 2004, 18:18:53
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
Title:
Post by: Psycho_Chihuahua on 17 October, 2004, 18:37:38
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
Title:
Post by: bastya_elvtars on 17 October, 2004, 18:50:41
so open hubs u mean unreg hubs? then u have bad terminology... :S
Title:
Post by: Psycho_Chihuahua on 17 October, 2004, 18:54:22
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
Title:
Post by: Psycho_Chihuahua on 20 October, 2004, 23:18:46
any idea's to what's wrong?

anybody?