Author Topic: NO Public Bot  (Read 3497 times)

0 Members and 1 Guest are viewing this topic.

Offline Teddy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
NO Public Bot
« on: 26 July, 2005, 19:56:30 »
Can this be fix to lua.5

-- Anti Open Hub Bot
-- by NightLitch
-- minor bugfix by psycho_chihuahua
DisconnectMessage = "### PLEASE close the public Hub ###."
function DataArrival( sUser , sData )
   if strsub( sData , 1 , 7 ) == "$MyINFO" then
      local _,_,openhubs = strfind( sData , ".+H:(%d+)" );
      if ( openhubs ~= "0" ) then
         SendToNick( sUser.sName , DisconnectMessage )
         sUser:Disconnect()
      end
   end
end
« Last Edit: 26 July, 2005, 21:22:35 by Teddy »

PtokaX forum

NO Public Bot
« on: 26 July, 2005, 19:56:30 »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #1 on: 26 July, 2005, 21:29:07 »
Code: [Select]
-- Anti Open Hub Bot
-- by NightLitch
-- minor bugfix by psycho_chihuahua
-- Converted to lua5 by Madman
DisconnectMessage = "### PLEASE close the public Hub ###."
function MyINFOArrival( sUser , sData )
if ( sUser.iNormalHubs ~= "0" ) then
SendToNick( sUser.sName , DisconnectMessage )
sUser:Disconnect()
end
end
Give this a try...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Teddy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Thanks alot
« Reply #2 on: 26 July, 2005, 22:01:51 »
Thanks you fix it

Offline Teddy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
No NO SORRY
« Reply #3 on: 26 July, 2005, 22:17:06 »
it seams to not work  X(

Offline James

  • Fulll Member
  • ****
  • Posts: 59
  • Karma: +0/-0
(No subject)
« Reply #4 on: 26 July, 2005, 22:54:44 »
maybe this : anti-open-hub by ?????? and not tested.

Code: [Select]
tBadOnes = {}
iTimeAfter = 15 -- how many seconds before disconnecting

function Main()
SetTimer( 1000 )
StartTimer()
end

function NewUserConnected(user)
if user.iNormalHubs then
if user.iNormalHubs > 0 then
tBadOnes[user.sName] = iTimeAfter
user:SendData( "PtokaX", "Du bist in PublicHubs. Die Verbindung wird in "..iTimeAfter.." Secunden unterbrochen")
end
end
end

function OnTimer()
for nick, v in tBadOnes do
local user = GetItemByName( nick )
if user.iNormalHubs then
if user.iNormalHubs == 0 then
tBadOnes[nick] = nil
user:SendData( "PtokaX", "Thanks." )
elseif user.iNormalHubs > 0 then
tBadOnes[nick] = tBadOnes[nick] - 1
if tBadOnes[nick] == 0 then
tBadOnes[nick] = nil
user:SendData( "PtokaX", "Disconnect wegen Publichubs." )
user:Disconnect()
elseif tBadOnes[nick] == math.floor( iTimeAfter / 2 ) then
user:SendData ( "PtokaX", " Bitte keine PublicHubs . Du hast noch "..math.floor( iTimeAfter / 2 ).." Secunden bis zur Trennung.." )
end
end
end
end
end

function UserDisconnected(user)
if tBadOnes[user.sName] then
tBadOnes[user.sName] = nil
collectgarbage();
end
end
« Last Edit: 26 July, 2005, 22:55:57 by James »

Offline Teddy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
NO Sorry this not work!!
« Reply #5 on: 26 July, 2005, 23:24:56 »
Have test it in hub not work!!

PtokaX forum

NO Sorry this not work!!
« Reply #5 on: 26 July, 2005, 23:24:56 »