welcome info not working - Page 2
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

welcome info not working

Started by [NL]trucker, 25 February, 2004, 14:59:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

#25
kepp

this is from iplog ...looking good :-))
02/28/04 | ((UKSN))(CZ)djpitr | 66.169.8.168 | DC - <2.02 |

this is from mainchat. :-)) perfect

[19:57:56] He hallo daar ook weer terug ?

now another request

a douple ip log

like user connects twice with same ip and diffrent name
or with same name and diffrent ip
then blocking the second attempt. and ip gets banned and added to banlist [badip,s]
but then in a dir like welcome-logs
cause i really want the script dir as clean as possiblle.


i use now this script it works perfect could you perhaps merge those two scripts?


=====================================

-- By Optimus 23-02-2004
-- Checks double IPs logins
-- If found then writen to a TxT file
-- ZZZZZzzzz l8trs ;)

botname = "ZZZZZzzzz"

ip = {}
IpToTableFile = "IpToTable.tbl"
LogDoubles = "LogDoubles.txt"

function Main()
  --   frmHub:RegBot(botname)
   doloadTable(ip)
   if frmHub:GetUsersCount() == 0 then ip = {}
   dosaveTable(ip) end
end

function OnExit()
   dosaveTable(ip)
end

function NewUserConnected(user)
   Check_DoubleIp(user)
end

function UserDisconnected(user)
   if ip[user.sIP] == user.sName then
   ip[user.sIP]=nil dosaveTable(ip) end
end

--OpConnected = NewUserConnected

function Check_DoubleIp(user)
   if ip[user.sIP] == nil then ip[user.sIP] = user.sName dosaveTable(ip) else
   user:SendData(botname, "*** There is allready some 1 connected with the same IP, you are now disconnected!")
   Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..user.sName.." ("..user.sIP..") tryed to double login with another nick!")
   user:Disconnect() end
end

function doloadTable(ip)
   assert(readfrom(IpToTableFile))
   dostring(read("*all")) readfrom()
end

function dosaveTable(ip)
   writeto(IpToTableFile) write("ip = {")
   for a,b in ip do if b then
   write("[\""..a.."\"]=\""..b.."\",")
   end end write("}" ) writeto()
end

function Writetolog(what)
   appendto(LogDoubles)
   write(what.."\n") writeto()
end

========================================


Btw you are gonna look into my other request to?
great job sofar i,m in your debt.


tia peter
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

ok

sBot = "OoOoOo"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2


WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:([%d%.]+)")
	if client == nil then
		client = "(N/A)"
	end
	if LogIP[user.sName]==nil then
		LogIP[user.sName]=user.sIP
	end
	if BeforeLog == SaveIntervall then
		SaveIPS(client, ver)
		BeforeLog = 0
	else
		BeforeLog = BeforeLog + 1
	end
	if user.iProfile == -1 and (WELCOMEuser == "yes") then
		USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
		USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
		user:SendData(sBot,USERmsg)
	elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
		SendToAll(sBot,VIPWlc[user.sName])

	end
	if Clone[user.sIP] then
		user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
		WriteClone(user)
		user:Ban()    --// Are you sure about this?
		user:Disconnect()
	else
		Clone[user.sIP] = user.sName
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function SaveIPS(client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.." |")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end

I have tested it and it seems to work just great!

Chnage these:
Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

for your needs, But you have to make the folder yourself
Guarding    

[NL]trucker

thnx kepp i,m gonna test it .

what about these?


info on login either pm or main

welcome user to [hubname]
#########################
your ip =
your share =
your client =
total amount of your logins =
min share in hub =
min slots in hub =
max slots in hub =
max hubs allowed =
max users connected =
total users connected now =
total share in hub now =
hubuptime after last reboot =
##########################

if shown in main it would be nice that is shown only to user who logs in.

and on timer in main

welcome user to [hubname]
#########################
min share in hub =
min slots in hub =
max slots in hub =
max hubs allowed =
max users connected =
total users connected now =
total share in hub now =
hubuptime after last reboot =
hub running since = a kind of foundation date
###########################


think this will keep you busy for a while :-)))
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

kepp

it is running fine sofar

but "hehehhhe" i still found something

02/29/04 | [0.5MBIT][SWE]meme | 217.210.193.126 | ++ - <0.306 |02/29/04 | [NL]Remco_S | 62.21.188.52 | ++ - <0.306 |02/29/04 | [CZ]kryten | 217.75.209.208 | ++ - <0.306 |02/29/04 | [NL]matrix | 82.136.204.21 | ++ - <0.306 |02/29/04 | cdelaboulettejepass | 82.224.145.34 | ++ - <0.306 |02/29/04 | Tuim | 80.100.96.56 | ++ - <0.306

the iplog.txt looks like a mess it is all behind each other

could it be made so that 1 line 1 user?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

kepp


still got that error message

Syntax error: attempt to concat local `ver' (a nil value)
stack traceback:
   1:  function `SaveIPS' at line 137 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   2:  function `NewUserConnected' at line 84 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

I haven't forgotten you, sorry, It seems the forum has been downn... Im working on it now.
Guarding    

kepp

sBot = "OoOoOo"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 1
MAXslots = 10
MAXhubs = 8

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t	"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t	"..share.." GB \r\n"
	t = t.."Your Client		\t?\t	<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB"
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
SendHubInfo(user, client, share)
	if client == nil then
		client = "(N/A)"
	end
	if ver == nil then
		ver = "(N/A)"
	end
	if LogIP[user.sName]==nil then
		LogIP[user.sName]=user.sIP
	end
	if BeforeLog == SaveIntervall then
		SaveIPS(user, client, ver)
		BeforeLog = 0
	else
		BeforeLog = BeforeLog + 1
	end
	if user.iProfile == -1 and (WELCOMEuser == "yes") then
		USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
		USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
		user:SendData(sBot,USERmsg)
	elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
		SendToAll(sBot,VIPWlc[user.sName])

	end
	if Clone[user.sIP] then
		user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
		WriteClone(user)
		user:Ban()    --// Are you sure about this?
		user:Disconnect()
	else
		Clone[user.sIP] = user.sName
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end

I'll add the timer soon, i must go away for a sec, but here's a little prewiew...
Guarding    

kepp

sBot = "OoOoOo"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 1
MAXslots = 10
MAXhubs = 8

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0
TIMERs = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t	"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t	"..share.." GB \r\n"
	t = t.."Your Client		\t?\t	<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB"
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
SendHubInfo(user, client, share)
	if client == nil then
		client = "(N/A)"
	end
	if ver == nil then
		ver = "(N/A)"
	end
	if LogIP[user.sName]==nil then
		LogIP[user.sName]=user.sIP
	end
	if BeforeLog == SaveIntervall then
		SaveIPS(user, client, ver)
		BeforeLog = 0
	else
		BeforeLog = BeforeLog + 1
	end
	if user.iProfile == -1 and (WELCOMEuser == "yes") then
		USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
		USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
		user:SendData(sBot,USERmsg)
	elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
		SendToAll(sBot,VIPWlc[user.sName])

	end
	if Clone[user.sIP] then
		user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
		WriteClone(user)
		user:Ban()    --// Are you sure about this?
		user:Disconnect()
	else
		Clone[user.sIP] = user.sName
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function Syncro()
	local sec = clock() 
	local days = floor(sec/86400) 
	local hrs = floor((sec-(days*86400))/3600) 
	local min = floor((sec-(days*86400)-(hrs*3600))/60) 
	sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
	return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
	if TIMERs == 0 then
		Waiting_For_The_King()
		TIMERs = 1
	elseif TIMERs == 1 then
		TIMERs = 2
	elseif TIMERs == 2 then
		Waiting_For_The_King()
		TIMERs = 0
	end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB\r\n"
	t = t.."Hub uptime            \t\t?\t   "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
end
Guarding    

[NL]trucker

kepp

i,ve got n error (:-

Syntax error: attempt to concat local `client' (a nil value)
stack traceback:
   1:  function `SendHubInfo' at line 97 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   2:  function `NewUserConnected' at line 115 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']

this is the one i use now.
========================================

sBot = "[NL]?????"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 2
MAXslots = 20
MAXhubs = 50

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "no"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
   ["24.50.199.138"]=1,
   ["24.30.199.200"]=2,
   ["213.17.210.95"]=3,
   ["213.122.194.182"]=4,
   ["212.181.76.156"]=5,
   ["213.118.127.62"]=6,
   ["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
   ["pappa"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
   ["[NL]Trucker"]   ="Put Away your bad files the master has returned",
   ["Tequilla"]="Welcome o Great one please feel at home",
   ["[NL]Mazda626"]="Welcome My fellow rider let,s keep the roads clear of those drunk bastards here",
   ["[INT]masterload"]="Hehehe the great weed smoking and hasjh sniffing master is back !!"

}

--# All Ops here
OPWlc = {
   ["[NL]Janeb"]="Welcome Janeb always nice to see you back on duty",
   ["[NL[fuego_gtx"]="Welcome Fuego_gtx just passing through in your high speed car?",
   ["[NL]Spikey"]="Watch and tremble the great Spikey has arrived",
   ["hhps"]="Welcome hhps be Aware dear User obey his command or feel his wrath "

}

--# All VIPS here
VIPWlc = {
   ["kepp"]="Welcome kepp ;)",
   ["nErBoS"]="Welcome Message here",
   ["Skrolster"]="Welcome Message here",
   ["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0
TIMERs = 0

LogIP = {}
Clone = {}

function Main()
   frmHub:RegBot(sBot)
   SetTimer(1000*60*40)
   StartTimer()
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
   t = t.."\r\n\r\n"
   t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
   t = t.."Your IP         \t?\t   "..user.sIP.."\r\n"
   t = t.."Your Share      \t?\t   "..share.." GB \r\n"
   t = t.."Your Client      \t?\t   <"..client.."\r\n"
   t = t.."\r\n"
   t = t.."Min share in hub      \t?\t   "..MINshare.." GB\r\n"
   t = t.."Min slots in hub      \t?\t   "..MINslots.."\r\n"
   t = t.."Max slots in hub      \t?\t   "..MAXslots.."\r\n"
   t = t.."Max Hubs in hub      \t?\t   "..MAXhubs.."\r\n"
   t = t.."Max users in hub      \t?\t   "..frmHub:GetMaxUsers().."\r\n"
   t = t.."Total users connected now   \t?\t   "..frmHub:GetUsersCount().."\r\n"
   t = t.."Current share amount   \t?\t   "..SHAREa.." GB"
   t = t.."\r\n\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
   T = t
   user:SendData(sBot,T)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
SendHubInfo(user, client, share)
   if client == nil then
      client = "(N/A)"
   end
   if ver == nil then
      ver = "(N/A)"
   end
   if LogIP[user.sName]==nil then
      LogIP[user.sName]=user.sIP
   end
   if BeforeLog == SaveIntervall then
      SaveIPS(user, client, ver)
      BeforeLog = 0
   else
      BeforeLog = BeforeLog + 1
   end
   if user.iProfile == -1 and (WELCOMEuser == "yes") then
      USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
      USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
      user:SendData(sBot,USERmsg)
   elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
      SendToAll(sBot,VIPWlc[user.sName])

   end
   if Clone[user.sIP] then
      user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
      WriteClone(user)
      user:Ban()    --// Are you sure about this?
      user:Disconnect()
   else
      Clone[user.sIP] = user.sName
   end
end

function UserDisconnected(user)
   LogIP[user.sName]=nil;
end

function OpConnected(user)
   if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
      SendToAll(sBot,MASTERWlc[user.sName])
   elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
      SendToAll(sBot,OPWlc[user.sName])
   end
   if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
      SendToAll(sBot,HubOwnerWlc[user.sName])
   elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
      DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
      SendToAll(sBot,DCPPmsg)
   end
end

function DataArrival(user, data)
   if strsub(data,1,7)=="$MyINFO" then
      if BlockIP[user.sIP] then
         user:SendData(sBot,"Your IP is blocked in this hub.")
         user:Disconnect()
      end
   end
end

function Syncro()
   local sec = clock()
   local days = floor(sec/86400)
   local hrs = floor((sec-(days*86400))/3600)
   local min = floor((sec-(days*86400)-(hrs*3600))/60)
   sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
   return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
   for i,v in LogIP do
      write(file,date("%x-%X").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
   end
   closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
   write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
   closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
   if TIMERs == 0 then
      Waiting_For_The_King()
      TIMERs = 1
   elseif TIMERs == 1 then
      TIMERs = 2
   elseif TIMERs == 2 then
      Waiting_For_The_King()
      TIMERs = 0
   end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
   t = t.."\r\n\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
   t = t.."Min share in hub      \t?\t   "..MINshare.." GB\r\n"
   t = t.."Min slots in hub      \t?\t   "..MINslots.."\r\n"
   t = t.."Max slots in hub      \t?\t   "..MAXslots.."\r\n"
   t = t.."Max Hubs in hub      \t?\t   "..MAXhubs.."\r\n"
   t = t.."Max users in hub      \t?\t   "..frmHub:GetMaxUsers().."\r\n"
   t = t.."Total users connected now   \t?\t   "..frmHub:GetUsersCount().."\r\n"
   t = t.."Current share amount   \t?\t   "..SHAREa.." GB\r\n"
   t = t.."Hub uptime            \t\t?\t   "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
   t = t.."\r\n\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
   T = t
end
=========================================
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

Which version of PtokaX are you running?
Mine is running well, and better it can be, but no errors..

Give me a few :)
Guarding    

[NL]trucker

kepp

i,m running 0.330 .15.25
robocop 6.0d
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

ok, since i don't get that error i can't do anything about it, sorry :(

maybe if you could figure out when it appear, if it happens when specific client loggs in ?
Guarding    

nErBoS

Hi,

Try to put this before search myinfostring...

if (user.MyInfoString ~= nil) then
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:") 
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$") 
all code...
else
end

I was having the same queistion but where is the answer to this sysntax erros..

http://board.univ-angers.fr/thread.php?threadid=1446&boardid=6&styleid=1&sid=cf331b82680f0e1a0a2c5e1f45c74b86

Best regards, nErBoS
--## nErBoS Spot ##--

kepp

#38
ok, let's hope you are right, Must be a bug, cause i have no errors with it :S

sBot = "OoOoOo"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 1
MAXslots = 10
MAXhubs = 8

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0
TIMERs = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t	"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t	"..share.." GB \r\n"
	t = t.."Your Client		\t?\t	<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB"
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
	if user.sMyInfoString ~= nil then
		local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
		local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
		SendHubInfo(user, client, share)
			if client == nil then
				client = "(N/A)"
			end
			if ver == nil then
				ver = "(N/A)"
			end
			if LogIP[user.sName]==nil then
				LogIP[user.sName]=user.sIP
			end
			if BeforeLog == SaveIntervall then
				SaveIPS(user, client, ver)
				BeforeLog = 0
			else
				BeforeLog = BeforeLog + 1
			end
			if user.iProfile == -1 and (WELCOMEuser == "yes") then
				USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
				USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
				user:SendData(sBot,USERmsg)
			elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
				SendToAll(sBot,VIPWlc[user.sName])

			end
			if Clone[user.sIP] then
				user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
				WriteClone(user)
				user:Ban()    --// Are you sure about this?
				user:Disconnect()
			else
				Clone[user.sIP] = user.sName
		end
	else
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function Syncro()
	local sec = clock() 
	local days = floor(sec/86400) 
	local hrs = floor((sec-(days*86400))/3600) 
	local min = floor((sec-(days*86400)-(hrs*3600))/60) 
	sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
	return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
	if TIMERs == 0 then
		Waiting_For_The_King()
		TIMERs = 1
	elseif TIMERs == 1 then
		TIMERs = 2
	elseif TIMERs == 2 then
		Waiting_For_The_King()
		TIMERs = 0
	end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB\r\n"
	t = t.."Hub uptime      \t\t\t?\t                 "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	SendToAll(sBot,T)
end

oh yea, another bug, SendToAll(sBot,T) is now added to the timer. lol, forgot that!
Guarding    

[NL]trucker

#39
kepp

another error

Syntax error: attempt to concat local `client' (a nil value)
stack traceback:
   1:  function `SendHubInfo' at line 97 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   2:  function `NewUserConnected' at line 116 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']


still running with 0.330 15.25 and robocop 6.0d

and i didnt get an userinfo on login is this because i,m master??

edit:

is it possiblle to let the script say the names in the welcome message?
Or do i have to put them in manuelly?


after i looked at the code i changed this in code

========================================

local t = ""
   t = t.."\r\n\r\n"
   t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
   t = t.."Your IP         \t?\t   "..user.sIP.."\r\n"
   t = t.."Your Share      \t?\t   "..share.." GB \r\n"
   t = t.."Your Client      \t?\t   <"..client.."\r\n"
   t = t.."\r\n"
   t = t.."Min share in hub      \t?\t   "..MINshare.." GB\r\n"
   t = t.."Min slots in hub      \t?\t   "..MINslots.."\r\n"
   t = t.."Max slots in hub      \t?\t   "..MAXslots.."\r\n"
   t = t.."Max Hubs in hub      \t?\t   "..MAXhubs.."\r\n"
   t = t.."Max users in hub      \t?\t   "..frmHub:GetMaxUsers().."\r\n"
   t = t.."Total users connected now   \t?\t   "..frmHub:GetUsersCount().."\r\n"
   t = t.."Current share amount   \t?\t   "..SHAREa.." GB"
   t = t.."\r\n\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
   t = t
   user:SendData(sBot,T)
end

=======================================


it was :

t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
   T = t

and i was wondering about :

local t = ""  is it normal to have a doublle ""  ?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


nErBoS

Probably will fix the error...

sBot = "OoOoOo"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Enter the name the client uses (DC++k)?
DCpp = "BadFileChecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 1
MAXslots = 10
MAXhubs = 8

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0
TIMERs = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t	"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t	"..share.." GB \r\n"
	t = t.."Your Client		\t?\t	<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB"
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
	if user.sMyInfoString ~= nil then
		local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
		local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
			if client == nil then
				client = "(N/A)"
			end
			if ver == nil then
				ver = "(N/A)"
			end
		SendHubInfo(user, client, share)
			if LogIP[user.sName]==nil then
				LogIP[user.sName]=user.sIP
			end
			if BeforeLog == SaveIntervall then
				SaveIPS(user, client, ver)
				BeforeLog = 0
			else
				BeforeLog = BeforeLog + 1
			end
			if user.iProfile == -1 and (WELCOMEuser == "yes") then
				USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
				USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
				user:SendData(sBot,USERmsg)
			elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
				SendToAll(sBot,VIPWlc[user.sName])

			end
			if Clone[user.sIP] then
				user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
				WriteClone(user)
				user:Ban()    --// Are you sure about this?
				user:Disconnect()
			else
				Clone[user.sIP] = user.sName
		end
	else
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",user.sName)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function Syncro()
	local sec = clock() 
	local days = floor(sec/86400) 
	local hrs = floor((sec-(days*86400))/3600) 
	local min = floor((sec-(days*86400)-(hrs*3600))/60) 
	sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
	return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
	if TIMERs == 0 then
		Waiting_For_The_King()
		TIMERs = 1
	elseif TIMERs == 1 then
		TIMERs = 2
	elseif TIMERs == 2 then
		Waiting_For_The_King()
		TIMERs = 0
	end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB\r\n"
	t = t.."Hub uptime      \t\t\t?\t                 "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	SendToAll(sBot,T)
end

Best regards, nErBoS
--## nErBoS Spot ##--

kepp

Yea that is normal and for me better and so much faster..

insstead of getting the bot infront of all information like

Welcome to some Hub Name
Your IP : 127.0.0.1
and so on
...
...
...

i just get it like



All info i need here!

So it is normal!

Thanks nerbos for the correction of OpConnected()

It is working just great for me... :)
Guarding    

kepp

-- Request from [NL]Trucker
-- Origanally made by kepp
-- Modified and bugs fixed (Hopefully) by nErBoS
-- Hub Up time taken from skrolsters.... (Can't remember)
-- kepp fixed nErBoS small bug

sBot = "OoOoOo"

Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--# Dc++k client name here
DCpp = "BadFilechecker"

--# It will hold the info untill there has been made 3 connections, then it will save
SaveIntervall = 2

--# Set your hubs settings.
MINslots = 1
MAXslots = 10
MAXhubs = 8

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--# Enter those IPs you want to block from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7
}

--# Enter the Hubowner(s) Name(s) here!
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"
}

--# Enter all Masters Name(s) here!
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"
}

--# All Ops here
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"
}

--# All VIPS here
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"
}

--// Do not chnage anything below this point.. ok then....
--// Only if there are some bugs ;)

BeforeLog = 0
TIMERs = 0

LogIP = {}
Clone = {}

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function SendHubInfo(user, client, share)
share = share /1024/1024/1024
share = format("%0.2f",share)
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)

local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t	"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t	"..share.." GB \r\n"
	t = t.."Your Client		\t?\t	<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB"
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
	if user.sMyInfoString ~= nil then
		local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
		local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
			if client == nil then
				client = "(N/A)"
			end
			if ver == nil then
				ver = "(N/A)"
			end
		SendHubInfo(user, client, share)    -- Ok.. (I feel stupid)
			if LogIP[user.sName]==nil then
				LogIP[user.sName]=user.sIP
			end
			if BeforeLog == SaveIntervall then
				SaveIPS(user, client, ver)
				BeforeLog = 0
			else
				BeforeLog = BeforeLog + 1
			end
			if user.iProfile == -1 and (WELCOMEuser == "yes") then
				USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
				USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
				user:SendData(sBot,USERmsg)
			elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
				SendToAll(sBot,VIPWlc[user.sName])

			end
			if Clone[user.sIP] then
				user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
				WriteClone(user)
				user:Ban()    --// Are you sure about this?
				user:Disconnect()
			else
				Clone[user.sIP] = user.sName
		end
	else
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
end

function OpConnected(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",DCpp)
		SendToAll(sBot,DCPPmsg)
	end
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function Syncro()
	local sec = clock() 
	local days = floor(sec/86400) 
	local hrs = floor((sec-(days*86400))/3600) 
	local min = floor((sec-(days*86400)-(hrs*3600))/60) 
	sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
	return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
	if TIMERs == 0 then
		Waiting_For_The_King()
		TIMERs = 1
	elseif TIMERs == 1 then
		TIMERs = 2
	elseif TIMERs == 2 then
		Waiting_For_The_King()
		TIMERs = 0
	end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB\r\n"
	t = t.."Hub uptime      \t\t\t?\t                 "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	SendToAll(sBot,T)
end
Guarding    

nErBoS

#43
Hi,

SendHubInfo(user, client, share)    -- Ok.. (I feel stupid)

It happens to the best :)

Best regards, nErBoS
--## nErBoS Spot ##--

kepp

Ok, here goes, a little update :O

-- Request from [NL]Trucker
-- Origanally made by kepp
-- Modified and bugs fixed (Hopefully) by nErBoS
-- Hub Up time taken from skrolsters.... (Can't remember)
-- kepp fixed nErBoS small bug
-- Yet another bug fixed
-- Added Online Status of Op's Regs and VIPS

--/ Bot Name
sBot = "OoOoOo"

--/ Files / Folders 
Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--/ If you use a DC++k client on your hub then enter the name of the client here
DCpp = "BadFilechecker"

--/ This one is the amount of connection that must be made before it saves to file
SaveIntervall = 2

--/ Set minimum Slots
MINslots = 1
--/ Set Max Slots
MAXslots = 10
--/ Set max Hubs
MAXhubs = 8

--/ yes:no  Set to "yes" to enable welcome greetings

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

--/ Configure your own messages for a normal user and the DC++k client
USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--/  All IPS in this table will be blocked from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7}

--/ HubOwner(s) name(s) and welcome messages
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"}

--/ Master(s) name(s) and welcome messages
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"}

--/ Operator(s) Name(s) and welcome messages
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"}

--/ VIP(s) and Welcome messages
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"}

--/ Don't change anything below this point.

LogIP = {}
Clone = {}
OnlineOP = {}
OnlineVIP = {}
OnlineReg = {}
BeforeLog = 0
TIMERs = 0

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function ErrCorHandler(user)
	if user.sMyInfoString ~= nil then
	local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),M:")
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
		if client == nil then client = "(N/A)" end
		if ver == nil then ver = "(N/A)" end

	share = share /1024/1024/1024
	share = format("%0.2f",share)
	MINshare = frmHub:GetMinShare() / 1024
	local SHAREa = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))

		if strlen(SHAREa) <= 6 then
			SHAREa = SHAREa.." GB"
		else
			SHAREa = format("%0.2f",(SHAREa / 1024)).." TB"
		end
		days,hrs,min,sec = Syncro()
		return client,ver,MINshare,SHAREa,share,days,hrs,min,sec
	end
end

function SendHubInfo(user)
client,ver,MINshare,SHAREa,share,days,hrs,min,sec = ErrCorHandler(user)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." to "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Your IP			\t?\t		"..user.sIP.."\r\n"
	t = t.."Your Share		\t?\t		"..share.." GB \r\n"
	t = t.."Your Client		\t?\t		<"..client.."\r\n"
	t = t.."\r\n"
	t = t.."Min share in hub		\t?\t		"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t		"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t		"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t		"..MAXhubs.."\r\n"
	t = t.."Max users in hub	\t\t?\t		"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t		"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t		"..SHAREa.."\r\n"
	t = t.."Hub Uptime	\t\t?\t\t	"..days.." Days "..hrs.." hours "..min.." minutes "..sec.." seconds\r\n"
	t = t.."\r\n"
	t = t.."Online Ops                      \t\t?\t\t	"..getn(OnlineOP).."\r\n"
	t = t.."Online VIPs                     \t\t?\t\t	"..getn(OnlineVIP).."\r\n"
	t = t.."Online Regs                     \t\t?\t\t	"..getn(OnlineReg)
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function NewUserConnected(user)
	SendHubInfo(user)
	if LogIP[user.sName]==nil then
		LogIP[user.sName]=user.sIP
	end
	if BeforeLog == SaveIntervall then
		SaveIPS(user, client, ver)
		BeforeLog = 0
	else
		BeforeLog = BeforeLog + 1
	end
	if user.iProfile == -1 and (WELCOMEuser == "yes") then
		USERmsg = gsub(USERmsg,"%b[USER]",user.sName)
		USERmsg = gsub(USERmsg,"%b[IP]",user.sIP)
		user:SendData(sBot,USERmsg)
	elseif user.iProfile == 2 and (WELCOMEvip == "yes") and VIPWlc[user.sName] then
		SendToAll(sBot,VIPWlc[user.sName])
	end
	if Clone[user.sIP] then
		user:SendData(sBot,"There is allready someone with the same IP in this hub, You are now disconnected.")
		WriteClone(user)
		user:Ban()    --// Are you sure about this?
		user:Disconnect()
	else
		Clone[user.sIP] = user.sName
	end
	if user.iProfile == 2 then
		if OnlineVIP[user.sName] == nil then
			OnlineVIP[user.sName] = 1;
	elseif user.iProfile == 3 then
		if OnlineReg[user.sName] == nil then
			OnlineReg[user.sName] = 1;
			end
		end
	end
end

function UserDisconnected(user)
	LogIP[user.sName]=nil;
	OnlineVIP[user.sName]=nil;
	OnlineReg[user.sName]=nil;
end

function OpConnected(user)
	SendHubInfo(user)
	if user.iProfile == 0 and (WELCOMEmaster == "yes") and MASTERWlc[user.sName] then
		SendToAll(sBot,MASTERWlc[user.sName])
	elseif user.iProfile == 1 and (WELCOMEop == "yes") and OPWlc[user.sName] then
		SendToAll(sBot,OPWlc[user.sName])
	end
	if HubOwnerWlc[user.sName] and (WELCOMEhubowner == "yes") then
		SendToAll(sBot,HubOwnerWlc[user.sName])
	elseif user.sName == DCpp and (WELCOMEDCpp == "yes") then
		DCPPmsg = gsub(DCPPmsg,"%b[USER]",DCpp)
		SendToAll(sBot,DCPPmsg)
	end
	if OnlineOP[user.sName]==nil then
		OnlineOP[user.sName] = 1;
	end
end

function OpDisconnected(user)
	OnlineOP[user.sName]=nil;
end

function DataArrival(user, data)
	if strsub(data,1,7)=="$MyINFO" then
		if BlockIP[user.sIP] then
			user:SendData(sBot,"Your IP is blocked in this hub.")
			user:Disconnect()
		end
	end
end

function Syncro()
	local sec = clock() 
	local days = floor(sec/86400) 
	local hrs = floor((sec-(days*86400))/3600) 
	local min = floor((sec-(days*86400)-(hrs*3600))/60) 
	sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
	return days,hrs,min,sec
end

function SaveIPS(user, client, ver)
local file = openfile(Logg,"w+")
	for i,v in LogIP do
		write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
	end
	closefile(file)
end

function WriteClone(user)
local file = openfile(CLONES,"a+")
	write(file,date("%x - %X").." - "..user.sName.." ["..user.sIP.."] tried to login with another nickname\n")
	closefile(file)
end


function OnTimer()
days,hrs,min,sec = Syncro()
	if TIMERs == 0 then
		Waiting_For_The_King()
		TIMERs = 1
	elseif TIMERs == 1 then
		TIMERs = 2
	elseif TIMERs == 2 then
		Waiting_For_The_King()
		TIMERs = 0
	end
end

function Waiting_For_The_King()
MINshare = frmHub:GetMinShare() / 1024
SHAREa = frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024
SHAREa = format("%0.2f",SHAREa)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Min share in hub		\t?\t	"..MINshare.." GB\r\n"
	t = t.."Min slots in hub		\t?\t	"..MINslots.."\r\n"
	t = t.."Max slots in hub		\t?\t	"..MAXslots.."\r\n"
	t = t.."Max Hubs in hub		\t?\t	"..MAXhubs.."\r\n"
	t = t.."Max users in hub		\t?\t	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."Total users connected now	\t?\t	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Current share amount	\t?\t	"..SHAREa.." GB\r\n"
	t = t.."Hub uptime      \t\t\t?\t                 "..days.." Days "..hrs.." Hours "..min.." Sec "..sec
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	SendToAll(sBot,T)
end
Guarding    

[NL]trucker

kepp

i got a little prob with the script

when a user uses the reconnect button he gets the message :
There is allready someone with the same IP in this hub, You are now disconnected .

and i think we need a kind of buffer to solve this.
cause i think it looks a lot like your nick is allready taken message.

but gonna test the update and let you know what is happening.

thnx both of you sofar for your work allready done on this script.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

#46
kepp i get this when i connect as master

[22:24:45] <[NL]?????>

Welcome pappa to ???? [NL] ????? ]-[?? [NL]
?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-?

Your IP            ?         217.121.195.6
Your Share         ?         56.50 GB
Your Client         ?         <++

Min share in hub         ?         0 GB
Min slots in hub         ?         2
Max slots in hub         ?         20
Max Hubs in hub         ?         50
Max users in hub         ?         200
Total users connected now      ?         83
Current share amount      ?         2.58 TB
Hub Uptime         ?         0 Days 8 hours 23 minutes 39 seconds

Online Ops                            ?         0
Online VIPs                           ?         0
Online Regs                           ?         0

?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-?

it eems i have no OPs- vips or reg users

lol usercount in hub =87  [oepss that is with bot,s]

and client??
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

well, i thought that was what you wanted?

A script so user's with the same IP can't enter?
But yea, im gonna take a closer look at it in next update!

"it eems i have no OPs- vips or reg users "

well, for how long did you run the script after entering your hub..?

It's all tables and there's nothing else todo. everytime you restart scripts that will be lost..

lol usercount in hub =87 [oepss that is with bot,s]

Mm, yea, nothing i can do there either...

It's the "frmHub:GetUsersCount()" which i cannot change.

A table here would solve this problem but then again, it's back to 0 everytime you restartscripts

Client... oh ya, will be fixed too ;)
With a little more details about which client it actually is..

Just stay calm
Guarding    

[NL]trucker

Kepp

this last post wasnt ment as a comment
just a few details i noticed .
and as i stated before i,m allready a happy person that someone is willing to make this script for me .


[qoute]
lol usercount in hub =87 [oepss that is with bot,s]

Mm, yea, nothing i can do there either... [/qoute]

i didnt want it to be changed it is correct the way it is now
just noticed the diffrence after i typed it so i added "[oepss that is with bot,s]"instead of removing the comment .
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

-- Request from [NL]Trucker
-- Origanally made by kepp
-- Modified and bugs fixed (Hopefully) by nErBoS
-- Hub Up time taken from skrolsters.... (Can't remember)
-- kepp fixed nErBoS small bug
-- Yet another bug fixed
-- Added Online Status of Op's Regs and VIPS
-- Several bugs fixed, Hoppefully new one's showed up :D
-- Added, A little client support.. 

--/ Bot Name
sBot = "OoOoOo"

--/ Files / Folders 
Logg = "OoOoOo/iplog.txt"
CLONES = "OoOoOo/clones.txt"

--/ If you use a DC++k client on your hub then enter the name of the client here
DCpp = "BadFilechecker"

--/ This one is the amount of connection that must be made before it saves to file
SaveIntervall = 2

--/ Set minimum Slots
MINslots = 1
--/ Set Max Slots
MAXslots = 10
--/ Set max Hubs
MAXhubs = 8

--/ yes:no  Set to "yes" to enable welcome greetings

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

--/ Configure your own messages for a normal user and the DC++k client
USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

--/  All IPS in this table will be blocked from entering your hub
BlockIP = {
	["24.50.199.138"]=1,
	["24.30.199.200"]=2,
	["213.17.210.95"]=3,
	["213.122.194.182"]=4,
	["212.181.76.156"]=5,
	["213.118.127.62"]=6,
	["213.118.127.62"]=7}

--/ HubOwner(s) name(s) and welcome messages
HubOwnerWlc = {
	["Some Name here"]="Welcome Message here"}

--/ Master(s) name(s) and welcome messages
MASTERWlc = {
	["[NL]Trucker"]	="Welcome Message here",
	["Plopi-plop-plop"]="Welcome Message here",
	["Optimus"]="Welcome Message here",
	["Phatty"]="Welcome Message here"}

--/ Operator(s) Name(s) and welcome messages
OPWlc = {
	["[NL]Pur"]="Welcome Message here",
	["NightLitch"]="Welcome Message here",
	["Snowman"]="Welcome Message here",
	["Chilla"]="Welcome Message here"}

--/ VIP(s) and Welcome messages
VIPWlc = {
	["kepp"]="Welcome kepp ;)",
	["nErBoS"]="Welcome Message here",
	["Skrolster"]="Welcome Message here",
	["Tezlo"]="Welcome Message here"}

--/ Don't change anything below this point.

LogIP = {}
Clone = {}
OnlineOP = {}
OnlineVIP = {}
OnlineReg = {}
BeforeLog = 0
TIMERs = 0

function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function ErrCorHandler(user)
	if user.sMyInfoString ~= nil then
	local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
		if strfind(user.sMyInfoString,"<++") then
			client = "DC++"
		elseif strfind(user.sMyInfoString,"") then
			client = "Phantom DC"
		elseif strfind(user.sMyInfoString,"
Guarding    

SMF spam blocked by CleanTalk