PtokaX forum

PtokaX => Bugs => Topic started by: Devastator on 02 November, 2003, 23:11:37

Title: Op In Reg Only Hub...2 Big Problems 4 Me
Post by: Devastator on 02 November, 2003, 23:11:37
I am an op in a registered users only hub, the hub lets unregistered user inside but does not allow them to download until they are registered by an op after their shares have been checked. For some reason i cannot download the unregistered users lists but as soon as another op registers them i can download it straight away.
I would jus like to know da reason and a solution for this and one other problem if there is.

The other problem is when i have just registered people it all shows its done correctly, however when they reconnect they get a message saying something about a brute force connection thereafter it asks for their password when they key in their correct password it says incorrect and their ip becomes permenantly banned.

i would just like to know solutions for this, and i thank you in advance for any solutions provided if any!
Title:
Post by: BlazeXxX on 03 November, 2003, 01:36:21
Devastator,
Can u copy and paste ur reg only download script here? If we can see the script, maybe someone can rewrite it , so ops acn download their file list, but not users to users...
Title:
Post by: pHaTTy on 03 November, 2003, 11:01:09
You will probably have to add in a if not user.bOperator then

and a end if
Title:
Post by: DarkElf on 03 November, 2003, 11:09:08
try this..


---------------------

-- LEECHBLOCKER 02 -- for PtokaX TD4

---------------------

-- Created by SAMPLERman - HUB: samplerman.no-ip.info

-- 5/August/2003

-- Based on an idea by OpiumVolage and RabidWombat

-- And thanks AGAIN to RabidWombat for new ideas


-------------------------------

-- SOURCES OF SCRIPTING INFO --

-------------------------------

-- Scripting.txt (comes with PtokaX)

-- <[URL]http://lua.bcs-solutions.de/[/URL]>

-- LUA reference manual 4.0.pdf



----------------------

-- GLOBAL VARIABLES -- make changes here only

----------------------

smDebugging = "0" -- Default is "0" (silent mode). "1" sends msgs to OPs

smBlockSearches = "0" -- Default is "0" (do not block searches)

smBlockSearchExceptions = { "scores", "sheet music" }



MsgToAliens = "\t\t\t*** warning***\r\n\t"..

"YOU ARE UNABLE TO DOWNLOAD IN THIS HUB\r\n\t"..

"Only registered users can download.\r\n\t"..

"You still can search and chat...\r\n\t"..

"...but the hub won't let you download until you register.\r\n"..

"\tIn order to become a registered member:\r\n\t"..

"1) Share classical sheet music in a separate folder called SCORES\r\n\t"..

"2) only then, ask an OP for a password.\r\n\t"..

"We hope you will join us."



LetLeechCommand = "!letleech"



----------------------------------

-- Do not change anything below --

----------------------------------

smBot = frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware;

-- therefore, your Hub Bot should be enabled.



ToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}

LetLeech = {}



--// This function is called when hub or script starts

function Main()

frmHub:EnableFullData(1)

frmHub:UnregBot(smBot)

frmHub:RegBot(smBot)

--// If thus configured, remove search from blocking table:

if smBlockSearches == "0" then

for i,v in ToBlock do

if v == "^$Search%s+(%S+)" then ToBlock[i] = nil end

end

end

end



--// This function is fired when a new user (non-OP) finishes login

function NewUserConnected(user)

if user.iProfile == -1 then

user:SendPM(smBot,"\r\n"..MsgToAliens)

end

end



--// This function is fired when new data arrives

function DataArrival (user, data)



--// See if data is the !letleech command:

if strsub(data, 1, 1) == "<" then

local line=strsub(data,1,strlen(data)-1) -- remove last char

local s,e,cmd = strfind(line, "%b<>%s+(%S+)")

local s,e,arg = strfind(line, "%b<>%s+%S+%s+(%S+)")

if strlower(cmd)==strlower(LetLeechCommand) then

if user.iProfile ~= 0 and user.iProfile ~= 1 then

SendToAll(smBot, "...but you are not an OP!")

return nil

end

who = GetItemByName(arg)

if not who then

SendToOps(smBot, arg.." is not online.")

return 1

end

if who.iProfile ~= -1 then

SendToOps(smBot, arg.." is registered and does not need a leech license.")

return 1

end

LetLeech[arg] = 1

SendToOps(smBot,arg.." has been granted a special leech license.")

who:SendData(smBot,arg..", you are now authorized to download for this session.")

return 1

end

end



--// See if data should be blocked:

for _,blockstring in ToBlock do

local _, _, who = strfind(data, blockstring)

if who then return smBlock(user,data,who) end

end

end



function smBlock(user,data,who)

local report

local profnam = GetProfileName(user.iProfile)

if profnam then

profnam = strlower(profnam)

else

profnam = "alien"

end

--// Activity by Masters, OPs, VIPs and REGs are just reported to OPs:

--// Also, searches pass if they are in the exception list:

--// Data also passes if user is in LetLeech list:

if (user.iProfile ~= -1) or smMatchException(data)

or IsInLeechList(user) then

report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data

smDebugToOPs(report)

return nil

end

--// Alien (not registered) users get blocked:

local report = "\tBlocked from "..user.sName.." ("..

profnam.."):\r\n\t"..data

smDebugToOPs(report)

return 1

end



function smMatchException(data)

if strfind (data, "^$Search%s+(%S+)") then

for _,exceptword in smBlockSearchExceptions do

if strfind (strlower(data), strlower(exceptword)) then

return 1

end

end

end

return nil

end



function IsInLeechList(user)

for i,v in LetLeech do

if i == user.sName then return 1 end

end

return nil

end



function smDebugToOPs(data)

if smDebugging == "1" then

SendToOps(smBot,data)

end

end
Title:
Post by: Spudman on 06 November, 2003, 23:17:45
i have used that script but get syntax errors?
Title:
Post by: DarkElf on 07 November, 2003, 01:02:52
can you paste the error, because i use it and it works perfectly...

Bye
Title:
Post by: Spudman on 08 November, 2003, 13:38:17
Ok, well i copied it as it is and got:

Syntax Error: expected;
  last token read: `<' at line 1 in string "..."

So, I removed the first line ( and ? from the last end to get No syntax errors.

But then after it has said all good, I get this:

Syntax Error: `=' expected;
  last token read: `-' at line 55 in string "
..."

Now I anit gonna do anymore cos I have absolutely no idea what I am doing, more educated guess's =P.

What am I doing wrong? Can you post it exactly as I need to save it, although you prob already have!

Thanks

Spud
Title:
Post by: NightLitch on 08 November, 2003, 13:41:06
Just clip & paste this and save it as LUA

it Should work...

---------------------

-- LEECHBLOCKER 02 -- for PtokaX TD4

---------------------

-- Created by SAMPLERman - HUB: samplerman.no-ip.info

-- 5/August/2003

-- Based on an idea by OpiumVolage and RabidWombat

-- And thanks AGAIN to RabidWombat for new ideas


-------------------------------

-- SOURCES OF SCRIPTING INFO --

-------------------------------

-- Scripting.txt (comes with PtokaX)

-- <[URL]http://lua.bcs-solutions.de/[/URL]>

-- LUA reference manual 4.0.pdf



----------------------

-- GLOBAL VARIABLES -- make changes here only

----------------------

smDebugging = "0" -- Default is "0" (silent mode). "1" sends msgs to OPs

smBlockSearches = "0" -- Default is "0" (do not block searches)

smBlockSearchExceptions = { "scores", "sheet music" }



MsgToAliens = "ttt*** warning***rnt"..

"YOU ARE UNABLE TO DOWNLOAD IN THIS HUBrnt"..

"Only registered users can download.rnt"..

"You still can search and chat...rnt"..

"...but the hub won't let you download until you register.rn"..

"tIn order to become a registered member:rnt"..

"1) Share classical sheet music in a separate folder called SCORESrnt"..

"2) only then, ask an OP for a password.rnt"..

"We hope you will join us."



LetLeechCommand = "!letleech"



----------------------------------

-- Do not change anything below --

----------------------------------

smBot = frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware;

-- therefore, your Hub Bot should be enabled.



ToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}

LetLeech = {}



--// This function is called when hub or script starts

function Main()

frmHub:EnableFullData(1)

frmHub:UnregBot(smBot)

frmHub:RegBot(smBot)

--// If thus configured, remove search from blocking table:

if smBlockSearches == "0" then

for i,v in ToBlock do

if v == "^$Search%s+(%S+)" then ToBlock[i] = nil end

end

end

end



--// This function is fired when a new user (non-OP) finishes login

function NewUserConnected(user)

if user.iProfile == -1 then

user:SendPM(smBot,"rn"..MsgToAliens)

end

end



--// This function is fired when new data arrives

function DataArrival (user, data)



--// See if data is the !letleech command:

if strsub(data, 1, 1) == "<" then

local line=strsub(data,1,strlen(data)-1) -- remove last char

local s,e,cmd = strfind(line, "%b<>%s+(%S+)")

local s,e,arg = strfind(line, "%b<>%s+%S+%s+(%S+)")

if strlower(cmd)==strlower(LetLeechCommand) then

if user.iProfile ~= 0 and user.iProfile ~= 1 then

SendToAll(smBot, "...but you are not an OP!")

return nil

end

who = GetItemByName(arg)

if not who then

SendToOps(smBot, arg.." is not online.")

return 1

end

if who.iProfile ~= -1 then

SendToOps(smBot, arg.." is registered and does not need a leech license.")

return 1

end

LetLeech[arg] = 1

SendToOps(smBot,arg.." has been granted a special leech license.")

who:SendData(smBot,arg..", you are now authorized to download for this session.")

return 1

end

end



--// See if data should be blocked:

for _,blockstring in ToBlock do

local _, _, who = strfind(data, blockstring)

if who then return smBlock(user,data,who) end

end

end



function smBlock(user,data,who)

local report

local profnam = GetProfileName(user.iProfile)

if profnam then

profnam = strlower(profnam)

else

profnam = "alien"

end

--// Activity by Masters, OPs, VIPs and REGs are just reported to OPs:

--// Also, searches pass if they are in the exception list:

--// Data also passes if user is in LetLeech list:

if (user.iProfile ~= -1) or smMatchException(data)

or IsInLeechList(user) then

report = "t"..user.sName.." ("..profnam..") sends:rnt"..data

smDebugToOPs(report)

return nil

end

--// Alien (not registered) users get blocked:

local report = "tBlocked from "..user.sName.." ("..

profnam.."):rnt"..data

smDebugToOPs(report)

return 1

end



function smMatchException(data)

if strfind (data, "^$Search%s+(%S+)") then

for _,exceptword in smBlockSearchExceptions do

if strfind (strlower(data), strlower(exceptword)) then

return 1

end

end

end

return nil

end



function IsInLeechList(user)

for i,v in LetLeech do

if i == user.sName then return 1 end

end

return nil

end



function smDebugToOPs(data)

if smDebugging == "1" then

SendToOps(smBot,data)

end

end


/NightLitch
Title:
Post by: Spudman on 08 November, 2003, 14:27:56
Thanks man, all working =)
Title:
Post by: Spudman on 09 November, 2003, 11:32:57
Well, by working, i mean there are no syntax errors, however, it aint blocking all users?

I have set it up, but unregged users can still connect to anyone? It blocks some, but not all?

Anyone else had this?

Thanks

Spud
Title:
Post by: Devastator on 16 November, 2003, 23:48:37
Well I Started This Thread & [Owner]Spudman Ma Boss Has Tried 2 Sort The Prob But Still I Cannot Download Unregistered Users Lists & When I Do Register Ppl They Get A Brute Force Attack Error Message, They Then Get An Incorrect Password Msg & Thereafter They R Banned.
If N E Bodee Can Help Me Solve This Problem That Would B Excellent.

And I Would Like 2 Say That If I Cannot Sort This Prob Out I Mite As Well Not B Op Their...However I'd Like 2 Say If N E Bodee Is Lookin 4 An Excellent Hub With An Excellent Service With Excellent Ops & Users...hiphophub.no-ip.com is the place to go to...All The Ops R Extremely Helpful, Especially [Owner]Spudman & [SU]Supermole Who Have Tried 2 Help Me A Gr8 Deal!!!

Thanx A Lot Guys!!!
& Thanx In Advance 2 N E Bodee Who Tries 2 Help!!! :)  8)  ;)  :)
Title:
Post by: DarkElf on 18 November, 2003, 07:01:51

---------------------
-- LEECHBLOCKER 02 --    for PtokaX TD4
---------------------
-- Created by SAMPLERman - HUB: samplerman.no-ip.info
-- 5/August/2003
-- Based on an idea by OpiumVolage and RabidWombat
-- And thanks AGAIN to RabidWombat for new ideas

-- This LUA script prevents users that are not registered in the hub (=aliens)
-- from connecting to other users (for downloading).
-- New users (=aliens) can chat, upload and be searched. They just can't download.

-- This way your previously private hub can again be public.

-- Optionally, the script also blocks searches (from nonregged users).
-- However, it is recommended that you allow everyone to search your hub, so that
-- new users know what they are missing.

-- NEW in version 02:
-- To allow an alien to download for 1 session, OPs can type this command:
-- !letleech

-- To do for next version:
-- Optionally, aliens can download off of other aliens

-- There are 2 kinds of hubs:
-- 1) Open hubs for sharing anything
-- 2) Small hubs that concentrate on a special interest (e.g. classical sheet music)

-- This script is NOT recommended for hub kind #1, where it is enough to
-- control how many GB users are sharing.
-- Because in hub type #1 there is no point in registering users, this script
-- should be adapted to make shared amount the criteria for letting download.
-- Even better, for hub type #1 users who share little should be allowed to download
-- from other people who share little.
-- Freedom is a strength of the Direct Connect community; please do not cut into
-- people's freedom except when absolutely necessary.
-- This script is only for closed hubs with a very specific subject.

-------------------------------
-- SOURCES OF SCRIPTING INFO --
-------------------------------
-- Scripting.txt (comes with PtokaX)
-- [URL]http://lua.bcs-solutions.de/[/URL]
-- LUA reference manual 4.0.pdf

----------------------
-- GLOBAL VARIABLES --  make changes here only
----------------------
smDebugging       = "0"   -- Default is "0" (silent mode). "1" sends msgs to OPs
smBlockSearches   = "0"   -- Default is "0" (do not block searches)
smBlockSearchExceptions = { "scores", "sheet music" }

MsgToAliens = "\t\t\t*** warning***\r\n\t"..
            "YOU ARE UNABLE TO DOWNLOAD IN THIS HUB\r\n\t"..
            "Only registered users can download.\r\n\t"..
            "You still can search and chat...\r\n\t"..
            "...but the hub won't let you download until you register.\r\n"..
            "\tIn order to become a registered member:\r\n\t"..
            "1) Share classical sheet music in a separate folder called SCORES\r\n\t"..
            "2) only then, ask an OP for a password.\r\n\t"..
            "We hope you will join us."

LetLeechCommand = "!letleech"

----------------------------------
-- Do not change anything below --
----------------------------------
smBot = frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware;
                               -- therefore, your Hub Bot should be enabled.

ToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"}
LetLeech = {}

--// This function is called when hub or script starts
function Main()
  frmHub:EnableFullData(1)
  frmHub:UnregBot(smBot)
  frmHub:RegBot(smBot)
  --// If thus configured, remove search from blocking table:
  if smBlockSearches == "0" then
    for i,v in ToBlock do
      if v == "^$Search%s+(%S+)" then ToBlock[i] = nil end
    end
  end
end

--// This function is fired when a new user (non-OP) finishes login
function NewUserConnected(user)
  if user.iProfile == -1 then
    user:SendPM(smBot,"\r\n"..MsgToAliens)
  end
end

--// This function is fired when new data arrives
function DataArrival (user, data)

  --// See if data is the !letleech command:
  if strsub(data, 1, 1) == "<" then
    local line=strsub(data,1,strlen(data)-1)  -- remove last char
    local s,e,cmd = strfind(line, "%b<>%s+(%S+)")
    local s,e,arg = strfind(line, "%b<>%s+%S+%s+(%S+)")
    if strlower(cmd)==strlower(LetLeechCommand) then
      if user.iProfile ~= 0 and user.iProfile ~= 1 then
        SendToAll(smBot, "...but you are not an OP!")
        return nil
      end
      who = GetItemByName(arg)
      if not who then
        SendToOps(smBot, arg.." is not online.")
        return 1
      end
      if who.iProfile ~= -1 then
        SendToOps(smBot, arg.." is registered and does not need a leech license.")
        return 1
      end
      LetLeech[arg] = 1
      SendToOps(smBot,arg.." has been granted a special leech license.")
      who:SendData(smBot,arg..", you are now authorized to download for this session.")
      return 1
    end
  end

  --// See if data should be blocked:
  for _,blockstring in ToBlock do
    local _, _, who = strfind(data, blockstring)
    if who then return smBlock(user,data,who) end
  end
end

function smBlock(user,data,who)
  local report
  local profnam = GetProfileName(user.iProfile)
  if profnam then
    profnam = strlower(profnam)
  else
    profnam = "alien"
  end
--// Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
--// Also, searches pass if they are in the exception list:
--// Data also passes if user is in LetLeech list:
  if (user.iProfile ~= -1) or smMatchException(data)
      or IsInLeechList(user) then
    report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
    smDebugToOPs(report)
    return nil
  end
--// Alien (not registered) users get blocked:
  local report = "\tBlocked from "..user.sName.." ("..
        profnam.."):\r\n\t"..data
  smDebugToOPs(report)
  return 1
end

function smMatchException(data)
  if strfind (data, "^$Search%s+(%S+)") then
    for _,exceptword in smBlockSearchExceptions do
      if strfind (strlower(data), strlower(exceptword)) then
        return 1
      end
    end
  end
  return nil
end

function IsInLeechList(user)
  for i,v in LetLeech do
    if i == user.sName then return 1 end
  end
  return nil
end

function smDebugToOPs(data)
  if smDebugging == "1" then
    SendToOps(smBot,data)
  end
end


Try this.... i'v not tested yet...
Title:
Post by: Kwartje on 27 February, 2004, 02:32:25
Pto 0.326 TD4.99
Robocop  6.0d

HI....sorry for bringing this old topic back up..

Some ops i know have the same prob... as they are passive (passive regged users can not connect to passive non-regged users).

I don't know if this is a bug in the script as it happens with both robocop as mean machine. If it is a bug, I hope Optimus and co could sort it out before their new release...

btw, i haven't tried using the scripts above, as i don't want to combine multiple cripts...

Hope you guys can help me out....

Kwartje
Title:
Post by: Optimus on 27 February, 2004, 10:00:52
QuoteI don't know if this is a bug in the script as it happens with both robocop as mean machine. If it is a bug, I hope Optimus and co could sort it out before their new release...
Well i managed to make to HubProtector so OP's/Masters can download/look in blocked users share. It will be there in Next RoboCop v7.0 release. Thx verry much for the report

*** About the passive users i can't do anything about that, Passive users are just bad users haha  :D
Title:
Post by: Kwartje on 27 February, 2004, 15:12:50
QuoteOriginally posted by Optimus

*** About the passive users i can't do anything about that, Passive users are just bad users haha  :D

Tnx for the quick reply..

LOL..i totaly agree, bout P users..:D But could u confirm, that it is a bug in the scripts? or is it a bof in pto itself? Bcause the  thing is, as soon as tye P users get regged other regged P users are able to get their list...they only can't when they're unregged...(btw regged users only is unthicked in pto and is only using RC regg function)

Kwartje
Title:
Post by: H?LL?L?L??nG?L on 13 July, 2004, 22:41:48
QuoteOriginally posted by Spudman
Well, by working, i mean there are no syntax errors, however, it aint blocking all users?

I have set it up, but unregged users can still connect to anyone? It blocks some, but not all?

Anyone else had this?

Thanks

Spud



Yeah im getting this too i have robo6d and i put in the hubsafe and still some unregged users are able to connect ... i tried each seperately hubsafe  and robo but both still let some unregged users download  X(  X(  X( can any clever wiz fix this  ;)  :P