PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: [NL]trucker on 25 February, 2004, 14:59:15

Title: welcome info not working
Post by: [NL]trucker on 25 February, 2004, 14:59:15
hi all

i got this script found it in my archives deep down under
and i thought lets give it a shot but it wont work at all can someone have a closer look at this ?

Hmmm i,m wondering is this a lua script or nmdc?

code:
-----------------------------------------------------------------------

Dim sBotName
Dim iOpWelcome
Dim ThisBotsName
Dim iMinSharedBytes

Sub Main()
sBotName = "Entry bot"
ThisBotsName = "Entry bot"
iMinSharedBytes = 0 * 1024 ^ 3
iOpWelcome = 2
End Sub

Sub DataArival (curUser, sCurData)  'This event is fired when a new user logs in.
   Dim sCommand
   Dim sCurData2
   Dim x
   Dim iTheirSharedBytes
   Dim iIndex
   Dim iTheirConnection
   Dim iTempsCurData
   Dim iTheirFileDescription
   Dim iTheirEmail
   Dim iTheirIP
   Dim iTheirName
   Dim sAction
   Dim sUserBeingKicked
   Dim sKickReason
   Dim sBan
   Dim sUser
   Dim sBanReason
   Dim sIp
   Dim iTheirIndex
 sCurData2 = sCurData
 iTheirIp = curUser.IP()
 iIndex = int(curUser.iWinsockIndex)
 iTheirEmail = AfterFirst(sCurData,"$ALL ")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = BeforeFirst(iTheirEmail,"$")
 iTheirConnection = AfterFirst(sCurData,"$ALL ")
 iTheirConnection = AfterFirst(iTheirConnection,"$")
 iTheirConnection = AfterFirst(iTheirConnection,"$")
 iTheirConnection = BeforeFirst(iTheirConnection,"")
 iTheirFileDescription = AfterFirst(sCurData,"$ALL ")
 iTheirFileDescription = AfterFirst(iTheirFileDescription," ")
 iTheirFileDescription = BeforeFirst(iTheirFileDescription,"$")
 iHubMaxUsers = frmHub.sldrMaxUsers.value
 iMinClientVersion = frmHub.txtMinClientVersion
 iHubName = frmHub.txtName
 iHubAddress = frmHub.txtIP
   If isCommand(sCurData) then
      If Instr(1,sCurData," ") > 0 Then
         sCommand = BeforeFirst(sCurData, " ")
      Else
         sCommand = sCurData
      End If
      Select Case sCommand
         Case "$MyINFO"
            For x = 1 to 6
               sCurData = AfterFirst(sCurData,"$")
            Next
            iTheirSharedBytes = cdbl(BeforeFirst(sCurData,"$"))
            If int(iTheirSharedBytes) < iMinSharedBytes and int(iTheirSharedBytes) > 0 Then
   curUser.SendChatMessage cstr(sBotName), "You are sharing " & mbOrGb(int(iTheirSharedBytes)) & " and need " & mbOrGb(iMinSharedBytes-int(iTheirSharedBytes)) & " to meet the minimum share of " & mbOrGb(iMinSharedBytes) & "..."
               frmHub.DoEventsForMe
               curUser.Disconnect
               Else
   frmHub.wskLoop(iIndex).senddata "    Welkome to  " & frmHub.txtName.text & "  Hub adr = " & frmHub.txtIP & " Min DC " & frmHub.txtMinClientVersion & " and " & frmHub.sldrMaxUsers.value & " max users|"
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    WELKOM !!!" & curUser.sName & " YOUR sharing " & mbOrGb(iTheirSharedBytes) & ", IP " & curUser.IP() & ", DC "  & colUsers.ItemByName(curUser.sName).iVersion & "|"
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    " & colUsers.count() & " users are conected now " & Round((colUsers.count()/frmHub.sldrMaxUsers.value*100), 2) & "% full " & colUsers.OpperatorCount() & " OP's on Duty now|"
   frmHub.wskLoop(iIndex).senddata "                               NO 1 Hub RULE !!!!!!!|"
   frmHub.wskLoop(iIndex).senddata "                           OBEY The Owner hehehe|"
   
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    you must  put coutry or initials for your name  [NL] [DE]   use  [ ] not ( )!!! | "
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    Type +rules in the main to read the rules please read the rules and follow them  |"
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    type +ops to see the Op's online now |"
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    type +net in the main to see the network members|"
   frmHub.wskLoop(iIndex).senddata "    |"
   frmHub.wskLoop(iIndex).senddata "    all new logd,in users must read the rules and follow the rules do so and you wil have fun in her |"
            frmHub.DoEventsForMe
            End If
      End Select
   End If
   if iTheirIp = "216.232.95.233" or iTheirIp = "24.50.199.138" or iTheirIp = "24.30.4.192" or iTheirIp = "24.202.224.116" or iTheirIp = "213.122.194.182" or iTheirIp = "24.78.250.209" or iTheirIp = "24.70.144.176" or iTheirIp = "24.169.161.253" or iTheirIp = "24.215.28.13" or iTheirIp = "24.156.218.99"or iTheirIp="24.191.209.210"or iTheirIp ="213.118.127.62" then
      curUser.Kick()
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "    " & curUser.sName & ", IP " & iTheirIp & ", hit this hub with a trojan and is now being disconnected|"
      frmHub.DoEventsForMe
      next
   end if
   if iOpWelcome = 1 and curUser.bOperator = true and curUser.sName = "[NL]--MDP-Henk" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "  *****  Welcome Hub Owner**** " & curUser.sName & ",!!!! There are-->> " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
   if iOpWelcome = 1 and curUser.sName = "[NL]Jack" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "   _**** Welcome VIP*** " & curUser.sName & ", There are-->> " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
    end if
   if iOpWelcome = 1 and curUser.bOperator = true and (curUser.sName = "" or curUser.sName = "" or curUser.sName = "" or curUser.sName = "") then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "   ****** Welcome Back OP***** " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
 
   end if
   if iOpWelcome = 1 and curUser.bOperator = true and curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "   ***** Welcome special OP***** " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
   if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "   ******* Welcome poesje van de hubowner******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
     if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "   ******* Welkom Vip ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
      end if
     if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   ******* Welkom Vip ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
     if curUser.sName = "[nl]Mazda-file-police" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******hubpolice is on duty HIDE YOUR BAD FILES HEHEHEHE !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user en hubowner wonderworld!! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
     if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
     if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom OP BUGGY MAN !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
    if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
   if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
      if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom op !!en hubowner [NL]DutchAdventure ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******HALLO lievertje van de hubowner  !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
        if curUser.sName = "" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "<   *******welkom Vip user !! ******* " & curUser.sName & "|"
      frmHub.DoEventsForMe
      next
   end if
end sub

Function BeforeFirst(sIn, sFirst)
    BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
End Function

Function AfterFirst(sIn, sFirst)
    AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
End Function

Function isCommand(sData)
   isCommand = (Left(sData,1)="$")
End Function

Public Function AfterLast(sFrom, sAfterLast)
    If InStr(1, sFrom, sAfterLast) Then
        AfterLast = Right(sFrom, Len(sFrom) - InStrRev(sFrom, sAfterLast) - (Len(sAfterLast) - 1))
    Else
        AfterLast = ""
    End If
End Function

Public Function mbOrGb(iShare)
    If iShare<1024^2 Then
       mbOrGb=cstr(Round(int(iShare/1024),2))+" KB"
    Else    
       If iShare<1024^3 Then
          mbOrGb=cstr(Round((iShare/1024^2),2))+" MB"
       Else
          mbOrGb=cstr(Round((iShare/1024^3),2))+" GB"
       End If
    End If
End Function
Title:
Post by: lynyrd on 25 February, 2004, 17:07:56
hi i beleive that's a nmdc script...if it ends with .script eg "entry.script"
so that may be a reason it's not worky on ptokax ;)
Title:
Post by: [NL]trucker on 26 February, 2004, 09:29:06
lol

no it is not a nmdc script :-))  :P

but it was written for a prehistoric version of pkotax.


so if someone would give it a go to rewrite this script to a version working on  td4 and above i would surely apriciate it. :D
Title:
Post by: [NL]Pur on 26 February, 2004, 10:21:27
i think it's for nmdc hub too, it seems to be written in
VB ,  look at the DIM and Sub that not lua :)

it can be translated too lua anyhow.
Title:
Post by: [NL]trucker on 26 February, 2004, 10:35:37
oke thnx pur

then i hope that someone would look into this to translate it to lua script :-)))  hint hint
Title:
Post by: Stravides on 26 February, 2004, 10:38:11
Y dont you have a go yourself, and come back with something to help mod, try a little DIY and ask for help when ya gets stuck... thats what I'd do and did :)

you'll get more satisfaction from doing that than just raping the code :)

Thats my tuppence worth anyways
Title:
Post by: nErBoS on 26 February, 2004, 12:13:13
Hi,

Its a VB script but isn't necessary a NMDCH script it could be to another software which uses VB, this is smelling like a SHDC script :) , i guess, but there are other hub softwares which use VB scripts.

Best regards, nErBoS
Title:
Post by: kepp on 26 February, 2004, 20:33:24
yea, it's VB, i'll see what i can do.
Title:
Post by: [NL]trucker on 27 February, 2004, 08:31:42
Kepp

thnx i will wait and see what you can come up with .
Title:
Post by: kepp on 27 February, 2004, 22:11:35
Ok, qwhat do you want to be done?

So far, a table with IP's so you can block, Just what's in,

Fully customisable messages to Connecting Profiles..

This script is nothing really more like a WelcomeBot..
With a few checks...

Hubinfo command?
Title:
Post by: [NL]trucker on 27 February, 2004, 23:12:47
Kepp

your completly right with our thoughts.

it is a welcome bot with Fully customisable messages to Connecting Profiles and so it should be.

and if possiblle i would like this one adjusted to td4 and above with the same possibiltities.


perhaps even an iplog.txt with username
and if possiblle a bit more streamlined on cpu.
Title:
Post by: kepp on 28 February, 2004, 00:26:35
ok...
something like this?
I have tested it for a few seconds, but don't know yet about the delay in saving to the iplog.txt

--// Bot Name
sBot = "OoOoOo"

--// Hub owners Name
HubOwner = "Kepp"

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

--// "yes" = Enabled, "no" = Disbaled, Greetings on Entering

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

--// Messages

HUBOWNERmsg = "-=-=-=- The HUBOWNER [USER] has entered the hub :O -=-=-=-"
MASTERmsg = "-=-=-=- The MASTER [USER] has entered the hub :O -=-=-=-"
OPmsg = "-=-=-=- The OP [USER] has entered the hub :O -=-=-=-"
VIPmsg = "-=-=-=- The VIP [USER] has entered the hub :O -=-=-=-"
USERmsg = "-=-=-=- Welcome [USER], Your IP is [IP]"
DCPPmsg = "-=-=-=- The [USER] has entered the hub, Hide your bad files, HE HE HE HE :D -=-=-=-"

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
}

Logg = "iplog.txt"

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

BeforeLog = 0

LogIP = {}

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if LogIP[user.sName]==nil then
LogIP[user.sName]=user.sIP
end
if BeforeLog == 5 then
SaveIPS()
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") then
VIPmsg = gsub(VIPmsg,"%b[USER]",user.sName)
SendToAll(sBot,VIPmsg)

end
end

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

function OpConnected(user)
if user.iProfile == 0 and (WELCOMEmaster == "yes") then
MASTERmsg = gsub(MASTERmsg,"%b[USER]",user.sName)
SendToAll(sBot,MASTERmsg)
elseif user.iProfile == 1 and (WELCOMEop == "yes") then
OPmsg = gsub(OPmsg,"%b[USER]",user.sName)
SendToAll(sBot,OPmsg)
end
if user.sName == HubOwner and (WELCOMEhubowner == "yes") then
HUBOWNERmsg = gsub(HUBOWNERmsg,"%b[USER]",user.sName)
SendToAll(sBot,HUBOWNERmsg)
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()
local file = openfile(Logg,"w+")
for i,v in LogIP do
write(file,i.." - "..v.."%")
end
closefile(file)
end
Title:
Post by: [NL]trucker on 28 February, 2004, 12:45:38
Kepp

thnx

i,m runnning it ow but:

i just see welcome message for each profile not for diffrent users in that profile.

meaning i want to add  messages to diffrent users in the profile vip
something like this
===================================
if iOpWelcome = 1 and curUser.sName = "[NL]Jack" then
for m = 1 to frmHub.sldrMaxUsers.value
frmHub.wskLoop(m).senddata " _**** Welcome VIP*** " & curUser.sName & ", There are-->> " & colUsers.OpperatorCount() & " OP's on duty|"
frmHub.DoEventsForMe
=====================================

and what about these?

=========================
Dim sCommand
Dim sCurData2
Dim x
Dim iTheirSharedBytes  xxxxxx
Dim iIndex
Dim iTheirConnection    xxxxxxx
Dim iTempsCurData
Dim iTheirFileDescription xxxxxx
Dim iTheirEmail               xxxxxxx
Dim iTheirIP                    xxxxxxxx
Dim iTheirName              xxxxxxxx
Dim sAction
Dim sUserBeingKicked   xxxxxxxx
Dim sKickReason            xxxxxxx
Dim sBan                       xxxxxxxx
Dim sUser    
Dim sBanReason            xxxxxxx
Dim sIp
Dim iTheirIndex
sCurData2 = sCurData
iTheirIp = curUser.IP()
iIndex = int(curUser.iWinsockIndex)
iTheirEmail = AfterFirst(sCurData,"$ALL ") xxxxxxxx
iTheirEmail = AfterFirst(iTheirEmail,"$")  
iTheirEmail = AfterFirst(iTheirEmail,"$")
iTheirEmail = AfterFirst(iTheirEmail,"$")
iTheirEmail = BeforeFirst(iTheirEmail,"$")
iTheirConnection = AfterFirst(sCurData,"$ALL ") xxxxxxxx
iTheirConnection = AfterFirst(iTheirConnection,"$")
iTheirConnection = AfterFirst(iTheirConnection,"$")
iTheirConnection = BeforeFirst(iTheirConnection,"")
iTheirFileDescription = AfterFirst(sCurData,"$ALL ")
iTheirFileDescription = AfterFirst(iTheirFileDescription," ")
iTheirFileDescription = BeforeFirst(iTheirFileDescription,"$")
iHubMaxUsers = frmHub.sldrMaxUsers.value    xxxxxxxx
iMinClientVersion = frmHub.txtMinClientVersion  xxxxxxx
iHubName = frmHub.txtName                           xxxxxxxx
iHubAddress = frmHub.txtIP                              xxxxxxx
==============

havent seen them yet.

and iplog.txt is showing this:
--------------------------------------------------

tha__watcher - 217.121.47.240%ImmunoGoblin - 81.227.212.36%kentucky-fm - 82.168.178.186%Marianne - 62.166.240.85%[TMS]?Kumar - 62.16.155.221%poemel - 81.69.82.12%
--------------------------------------------------

could it be made like this:

date/time/name/ip  
and perhaps client version not needed but would be nice

so something like this

24-02004 | tha__watcher -  | 217.121.47.240  |dc++3.06
Title:
Post by: kepp on 28 February, 2004, 13:26:34
yea,k i will work on it..

Dim sCommand
Dim sCurData2
Dim x
Dim iTheirSharedBytes xxxxxx
Dim iIndex
Dim iTheirConnection xxxxxxx
Dim iTempsCurData
Dim iTheirFileDescription xxxxxx
Dim iTheirEmail xxxxxxx
Dim iTheirIP xxxxxxxx
Dim iTheirName xxxxxxxx
Dim sAction
Dim sUserBeingKicked xxxxxxxx
Dim sKickReason xxxxxxx
Dim sBan xxxxxxxx
Dim sUser
Dim sBanReason xxxxxxx
Dim sIp
Dim iTheirIndex


That's just what i asked you about, Do you want some hubinfo to be displayed on a timer or on a command?
or userinfo?

"Dim sKickReason xxxxxxx " is nothing until you set sKickReason to an object, Which i can't find anywhere in this script...

But yea, sure, just give me a few and i'll start working on it

The only thing that is actually used in this VB script is
"iTheirSharedBytes"
Title:
Post by: kepp on 28 February, 2004, 14:22:26
Untill you tell me what you want it to do
here's an update :)

--# Hub Name
sBot = "OoOoOo"

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

--# Set to yes to enable Profiles greeting
WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

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

--# the file's name
Logg = "iplog.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 = {}

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:(%S+),")
if LogIP[user.sName]==nil then
LogIP[user.sName]=user.sIP
end
if BeforeLog == 5 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
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
Title:
Post by: [NL]trucker on 28 February, 2004, 16:05:22
kepp

i,m gonna try the new one and let you know what else i want.

in the first version the iplog wasnt working correctly it onley logged a few names and IPs and stopped logging after that.
Title:
Post by: kepp on 28 February, 2004, 16:07:01
And you get any syntax error?
Title:
Post by: [NL]trucker on 28 February, 2004, 16:17:05
yep now i have with the new version

No syntax errors in script file welcome.lua
Syntax error: attempt to index global `MASTERWlc' (a nil value)
stack traceback:
   1:  function `OpConnected' at line 99 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
Title:
Post by: kepp on 28 February, 2004, 16:18:36
tested it and it seems to work just great here!

you know it take a while before it actually saves...


--# Hub Name
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 = 3

--# Set to yes to enable Profiles greeting
WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

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

--# the file's name
Logg = "iplog.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 = {}

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:([%d%.]+)")
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
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

if this dosen't work as you want then tell me what it ain't doing..?
Title:
Post by: [NL]trucker on 28 February, 2004, 16:31:57
you wanted me to let you know what else i wanted oke here it comes :-)

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


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 :-)))
Title:
Post by: [NL]trucker on 28 February, 2004, 16:36:29
kepp

got an error  this comes from latest release

Syntax error: attempt to index global `MASTERWlc' (a nil value)
stack traceback:
   1:  function `OpConnected' at line 102 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
Title:
Post by: [NL]trucker on 28 February, 2004, 16:55:45
got another error


Syntax error: attempt to index global `MASTERWlc' (a nil value)
stack traceback:
   1:  function `OpConnected' at line 102 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']

this happened when i logged in and out of the hub.

didnt see any messages in main or pm either
Title:
Post by: [NL]trucker on 28 February, 2004, 17:03:59
oepss another one

Syntax error: attempt to concat local `ver' (a nil value)
stack traceback:
   1:  function `SaveIPS' at line 127 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   2:  function `NewUserConnected' at line 82 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
Title:
Post by: kepp on 28 February, 2004, 17:29:26
--# Hub Name
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

--# Set to yes to enable Profiles greeting
WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

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

--# the file's name
Logg = "iplog.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 = {}

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
local s,e,client,ver = strfind(user.sMyInfoString,"<(%S+) V:([%d%.]+)")
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
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

ver i don't get though, i've been running it for 2 hours now and i don't get that!
Title:
Post by: kepp on 28 February, 2004, 17:35:32

--# Hub Name
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

--# Set to yes to enable Profiles greeting
WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "yes"
WELCOMEuser = "no"
WELCOMEDCpp = "yes"

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

--# the file's name
Logg = "iplog.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 = {}

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

ah, found the problem , untill i find a better way to catch version i added a little if nil
Title:
Post by: [NL]trucker on 28 February, 2004, 20:07:55
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
Title:
Post by: kepp on 28 February, 2004, 21:54:49
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
Title:
Post by: [NL]trucker on 29 February, 2004, 13:29:40
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 :-)))
Title:
Post by: [NL]trucker on 29 February, 2004, 13:49:08
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?
Title:
Post by: [NL]trucker on 29 February, 2004, 14:13:10
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']
Title:
Post by: kepp on 29 February, 2004, 15:49:46
I haven't forgotten you, sorry, It seems the forum has been downn... Im working on it now.
Title:
Post by: kepp on 29 February, 2004, 16:39:50

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...
Title:
Post by: kepp on 29 February, 2004, 17:07:16
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
Title:
Post by: [NL]trucker on 29 February, 2004, 18:09:52
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
=========================================
Title:
Post by: kepp on 29 February, 2004, 18:14:26
Which version of PtokaX are you running?
Mine is running well, and better it can be, but no errors..

Give me a few :)
Title:
Post by: [NL]trucker on 29 February, 2004, 18:19:56
kepp

i,m running 0.330 .15.25
robocop 6.0d
Title:
Post by: kepp on 29 February, 2004, 22:40:36
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 ?
Title:
Post by: nErBoS on 29 February, 2004, 23:48:21
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
Title:
Post by: kepp on 01 March, 2004, 06:31:57
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!
Title:
Post by: [NL]trucker on 01 March, 2004, 13:42:22
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 ""  ?
Title:
Post by: nErBoS on 01 March, 2004, 14:23:45
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
Title:
Post by: kepp on 01 March, 2004, 18:13:05
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... :)
Title:
Post by: kepp on 01 March, 2004, 18:24:20
-- 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
Title:
Post by: nErBoS on 01 March, 2004, 19:33:52
Hi,

SendHubInfo(user, client, share)    -- Ok.. (I feel stupid)
It happens to the best :)

Best regards, nErBoS
Title:
Post by: kepp on 01 March, 2004, 19:59:23
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
Title:
Post by: [NL]trucker on 01 March, 2004, 22:12:14
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.
Title:
Post by: [NL]trucker on 01 March, 2004, 22:28:33
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??
Title:
Post by: kepp on 01 March, 2004, 23:07:55
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
Title:
Post by: [NL]trucker on 01 March, 2004, 23:23:34
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 .
Title:
Post by: kepp on 01 March, 2004, 23:28:54
-- 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," client = "oDC"
elseif strfind(user.sMyInfoString," client = "DC-GUI"
elseif strfind(user.sMyInfoString,"<.P>") then
client = "Phantom DC"
elseif strfind(user.sMyInfoString," client = "Italian DC"
elseif strfind(user.sMyInfoString," client = "Neo Modus DC"
else
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;
if user.sName == Clone[user.sIP] then
Clone[user.sIP] = nil;
end
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

Title:
Post by: kepp on 01 March, 2004, 23:29:43
ah well, my misstake :D
Title:
Post by: [NL]trucker on 01 March, 2004, 23:48:29
kepp

no prob

just another question

MINshare = frmHub:GetMinShare() / 1024

this has to show min share in hub but it isnt.
but it aint giving an error either

--------------------------------------------------------------------
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         ?         DC++

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      ?         70
Current share amount      ?         2.12 TB
Hub Uptime         ?         0 Days 9 hours 40 minutes 9 seconds

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

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

and i edited this line :
-----------------------------------
write(file,date("%x").." | "..i.." | "..v.." | "..client.." - <"..ver.."\n")
--------------------------------------------------------
 hope this is oke .
i added -%X to it and now it is showing the time also in iplog.


 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

the log is now looking like this :
----------------------------------------------------
03/01/04-23:50:30 | [NL]--Liekerdjuh | 83.117.49.166 | DC++ - <0.306
03/01/04-23:50:30 | (NL)Karel12347 | 212.127.225.51 | DC++ - <0.306
-----------------------------------------------------


looks cool and clean :-))

Title:
Post by: kepp on 02 March, 2004, 00:33:00
hmm, that i don't know :S

This is my info



Welcome kepp to [BOLINA]Test
?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-?

Your IP            ?         127.0.0.1
Your Share         ?         21.47 GB
Your Client         ?         DC++

Min share in hub         ?         5 GB
Min slots in hub         ?         1
Max slots in hub         ?         10
Max Hubs in hub         ?         8
Max users in hub         ?         100
Total users connected now      ?         12
Current share amount      ?         875.29 GB
Hub Uptime         ?         9 Days 7 hours 57 minutes 21 seconds

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

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


As you can see, it shows up, BUT, mine is disabled in PtokaX, and therefor must be some kind of a bug..

You want me to make it so you can set it up by yourself?
Title:
Post by: [NL]trucker on 02 March, 2004, 10:02:51
kepp

mines is disabled in pkotax 15,25 also cause my mainbot is robo and that one needs to have all the settings in pkotax disabled.


but got an error after a night of testing .

 Syntax error: attempt to perform arithmetic on local `share' (a nil value)
stack traceback:
   1:  function `ErrCorHandler' at line 118 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   2:  function `SendHubInfo' at line 134 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
   3:  function `NewUserConnected' at line 162 [file `D:\==PTOTAX==\trucker\scripts\welcome.lua']
Title:
Post by: [NL]trucker on 02 March, 2004, 15:34:20
kepp is this oke?


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

i changed his part :
--------------------------
share = share /1024/1024/1024
   share = format("%0.2f",share)
   MINshare = frmHub:GetMinShare() / 1024
------------------------------
to

share = share /1024/1024/1024
   share = format("%0.2f",share)
   Minshare = frmHub:GetMinShare() / 1024

and this :
-------------------------------

client,ver,MINshare,SHAREa,share,days,hrs,min,sec
   end
end
------------------------

to:
----------------------------
client,ver,Minshare,SHAREa,share,days,hrs,min,sec
   end
end

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

and this :
-----------------

function SendHubInfo(user)
client,ver,MINshare,SHAREa,share,days,hrs,min,sec = ErrCorHandler(user)


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

to

----------------------------
function SendHubInfo(user)
client,ver,Minshare,SHAREa,share,days,hrs,min,sec = ErrCorHandler(user)
-----------------------------------

hope this solves a few :-))
Title:
Post by: kepp on 02 March, 2004, 16:15:14
i won't solve anything if share retuens nil;

update soon
Title:
Post by: [NL]trucker on 02 March, 2004, 22:10:49
kepp

lol i was referring to the MINshare values i changed them to Minshare in these lines

and after changing these i didnt get any errors anymore but still minshare is 0

perhaps better to make it selfadjustablle setting
although i rather go for the setting that takes it directly from hub but i,ll gues because i,m running robocop
that is out of the question.

grrrrrr.
Title:
Post by: kepp on 02 March, 2004, 22:21:03
QuoteOriginally posted by [NL]trucker
kepp

lol i was referring to the MINshare values i changed them to Minshare in these lines

and after changing these i didnt get any errors anymore but still minshare is 0

perhaps better to make it selfadjustablle setting
although i rather go for the setting that takes it directly from hub but i,ll gues because i,m running robocop
that is out of the question.

grrrrrr.

What im worried about is not that you chnaged them... not at all.. it's just that it should not matter..
about grabbing the share from PtokaX works as i said here, Mine is disabled because i let X-Ray take care of min share, though,  i have "5 GB" in the textbox, so if you keep that one on 0 then just change the amount and disable!! :)
Title:
Post by: [NL]trucker on 03 March, 2004, 00:38:05
kepp

i just did as you said and it is functioning now

i will let itt run and report back tomorrow to see if there aren,t any other errors.
Title:
Post by: [NL]trucker on 03 March, 2004, 00:39:49
well i thought i could post the script i use now

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

-- 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 = "=[[NL]?????]="


--/ 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 Share
Minshare = 5
--/ Set minimum Slots
MINslots = 2
--/ Set Max Slots
MAXslots = 20
--/ Set max Hubs
MAXhubs = 50

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

WELCOMEhubowner = "yes"
WELCOMEmaster = "yes"
WELCOMEop = "yes"
WELCOMEvip = "no"
WELCOMEuser = "yes"
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 = {
   ["pappa"]="Welcome back pappa please stay this time."}

--/ Master(s) name(s) and welcome messages
MASTERWlc = {
   ["[NL]Trucker"]   ="Put Away your bad files the master [NL]trucker has returned",
   ["Tequilla"]="Welcome o Great TeQuilla please feel at home",
   ["[NL]Mazda626"]="Welcome My fellow rider;[NL]Mazda626  let,s keep the roads clear of those drunk bastards here",
   ["[INT]masterload"]="Hehehe the great weed smoking and hasjh sniffing master;[INT]masterload is back !!"
}

--/ Operator(s) Name(s) and welcome messages
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 "}

--/ 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,"         client = "oDC"
      elseif strfind(user.sMyInfoString,"         client = "DC-GUI"
      elseif strfind(user.sMyInfoString,"<.P>") then
         client = "Phantom DC"
      elseif strfind(user.sMyInfoString,"         client = "Italian DC"
      elseif strfind(user.sMyInfoString,"         client = "Neo Modus DC"
      else
         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.."\r\n"
   t = t.."Hub Uptime               \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;
   if user.sName == Clone[user.sIP] then
      Clone[user.sIP] = nil;
   end
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-%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

=======end================================================
Title:
Post by: [NL]trucker on 03 March, 2004, 00:50:53
hmmmm

i did a hub reboot and nothing changed (:-

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           ?       DC++

Min share in hub               ?      5 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      ?   43
Current share amount          ?   1.41 TB

Hub Uptime                  ?    1 Days 10 hours 44 minutes 30 seconds

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

?-=-=-=-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-=-=-=-?
[00:45:36] <=[guard]=>

i waited a few minuts before i reconnected again and still got no online OPs or Vip,s or REg,s

and hub uptime?

Hub Uptime                  ?    1 Days 10 hours 44 minutes 30 seconds

after a hubreboot??

or is this a total time? like up and running since foundation date??
Title:
Post by: kepp on 03 March, 2004, 08:00:43
ok, im rewrting the script now...

About the hub uptime, im not so very familiar with clock()
i think that is untill you close PtokaX itself, then it will reset!! i'll see if i can find another way of doing this..

Soon to come a new
Title:
Post by: [NL]trucker on 03 March, 2004, 11:29:36
Kepp

thanks for your patience with me.

hubuptime stayd this way after a stop from pkotax hubsoft that is what i ment with hubreboot ,sorry had to be a bit more clear on that part.

edit:

Kepp perhaps you can get some idears from this:

http://board.univ-angers.fr/thread.php?threadid=1440&boardid=11&sid=579bd8b13817711a69f077accfb1883c
Title:
Post by: kepp on 03 March, 2004, 16:12:23
ok, no ideas are needed... ok, One was :)

The problem with the script not showing Online OPS are not a problem!

you see, try, 1. restartscript
2. reconnect
3. tell another OP to reconnect
4. then you reconnect again and see that 1 OP is Online.
Because everytime you reconnect you are out of the table again :O
Title:
Post by: kepp on 03 March, 2004, 19:02:49
Let's take a look at this!!


-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 1
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = 0
sOnlineVIP = 0
sOnlineReg = 0
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sDays,sHrs,sMin,sSec = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." ubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxSlots.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..sOnlineOP.."\r\n"
t = t.."Online VIP's ? "..sOnlineVIP.."\r\n"
t = t.."Online Reg's ? "..sOnlineReg
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if a == nil then a = "(N/A)"
elseif b == nil then b = "(N/A)"
elseif c == nil then c = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
local sSec = clock()
local sDays = floor(sSec/86400)
local sHrs = floor((sSec-(sDays*86400))/3600)
local sMin = floor((sSec-(sDays*86400)-(sHrs*3600))/60)
sSec = floor(sSec-(sDays*86400)-(sHrs*3600)-(sMin*60))
return sDays,sHrs,sMin,sSec
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
sOnlineVIP = sOnlineVIP + 1
end
if user.iProfile == 3 then
sOnlineReg = sOnlineReg + 1
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
sOnlineVIP = sOnlineVIP - 1
elseif user.iProfile == 3 then
sOnlineReg = sOnlineReg - 1
end
end

function OpConnected(user)
sOnlineOP = sOnlineOP + 1
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
sOnlineOP = sOnlineOP - 1
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end

This one will be updated instantly :)
Title:
Post by: kepp on 03 March, 2004, 19:43:41

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 1
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = 0
sOnlineVIP = 0
sOnlineReg = 0
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." ubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxSlots.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..sOnlineOP.."\r\n"
t = t.."Online VIP's ? "..sOnlineVIP.."\r\n"
t = t.."Online Reg's ? "..sOnlineReg
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if a == nil then a = "(N/A)"
elseif b == nil then b = "(N/A)"
elseif c == nil then c = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
sOnlineVIP = sOnlineVIP + 1
end
if user.iProfile == 3 then
sOnlineReg = sOnlineReg + 1
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
sOnlineVIP = sOnlineVIP - 1
elseif user.iProfile == 3 then
sOnlineReg = sOnlineReg - 1
end
end

function OpConnected(user)
sOnlineOP = sOnlineOP + 1
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
sOnlineOP = sOnlineOP - 1
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: kepp on 03 March, 2004, 20:41:48
You were right, i didn't show VIPS, regs nor ops

I had to go back to an OLD post to fix that ;)

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." ubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxSlots.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..getn(sOnlineOP).."\r\n"
t = t.."Online VIP's ? "..getn(sOnlineVIP).."\r\n"
t = t.."Online Reg's ? "..getn(sOnlineReg)
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if a == nil then a = "(N/A)"
elseif b == nil then b = "(N/A)"
elseif c == nil then c = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] == nil then
tinsert(sOnlineVIP,user.sName)
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] == nil then
tinsert(sOnlineReg,user.sName)
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] then
for i=1,getn(sOnlineVIP) do
if sOnlineVIP[i] then
tremove(sOnlineVIP,i)
break
end
end
end
elseif user.iProfile == 3 then
if sOnlineReg[user.sName] then
for i=1,getn(sOnlineReg) do
if sOnlineReg[i] then
tremove(sOnlineReg,i)
break
end
end
end
end
end

function OpConnected(user)
if sOnlineOP[user.sName] == nil then
tinsert(sOnlineOP,user.sName)
end
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
if sOnlineOP[user.sName] then
for i=1,getn(sOnlineOP) do
if sOnlineOP[i] then
tremove(sOnlineOP,i)
break
end
end
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: [NL]trucker on 03 March, 2004, 23:15:16
kepp

no error in script but this is result:

[23:05:16]

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

Information about you :
Your IP      ?      xxx.xxx.xxx.
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hubs as a normal user
You are in 13 ubs as a regged user =12 hubs
You are in 17 Hubs as an OP user   = 13 hubs

Hub Settings :
Minimum share      ?   0 <- still no go
Minimum slots      ?   2
Maximum slots      ?   20
Maximum hubs      ?   20
Maximum users      ?   200

Hub Statistic :
Uptime         ?   0 Days 4 Hours and 44 Minutes
Amount of users now   ?   51
Total share amount      ?   1.50 TB
Online OP's      ?   1 = 4
Online VIP's      ?   0 = tomuch ..lol
Online Reg's      ?   0 = tomuch

?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?
[23:05:16] Welcome back pappa


layout is great and info also :-)

perhaps if you tried this:

---------------------------------
?There are:       "..ProfileCounter("Master").." [MASTER] - "..ProfileCounter("Operator").." [OPERATOR] - "..ProfileCounter("Vip").." [VIP] online\r\n"
   
?There are now:      "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
-----------------------------------------------------------------------

i got thos from a piece of script by optimus out of the other threat i mentioned before.
Title:
Post by: kepp on 03 March, 2004, 23:19:30
lol, i just noticed myself...
update tomorow!

Did you have a look in the iplog.txt? lol...
the last person the get's in the table, the version of that person gets saved on everyone :S
Title:
Post by: [NL]trucker on 03 March, 2004, 23:24:30
oepps

there is a error

Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
   1:  function `strfind' [C]
   2:  function `Client_Check' at line 120 [file `D:\==PTOTAX==\trucker\scripts\kepss_welcome.lua']
   3:  function `NewUserConnected' at line 168 [file `D:\==PTOTAX==\trucker\scripts\kepss_welcome.lua']


these are the line 118 till 171.
----------------------------------------------------------------------
function Client_Check(user)
--Ver,Client
   local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
   local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
   if strfind(user.sMyInfoString,"<++") then
      sClient = "DC++"
   elseif strfind(user.sMyInfoString,"      sClient = "Opera DC"
   elseif strfind(user.sMyInfoString,"      sClient = "Opera DC"
   elseif strfind(user.sMyInfoString,"      sClient = "DC-GUI"
   elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
      sClient = "DC-GUI"
   elseif strfind(user.sMyInfoString,"      sClient = "DC:PRO"
   elseif strfind(user.sMyInfoString,"<.P>") then
      sClient = "Phantom DC"
   elseif strfind(user.sMyInfoString,"      sClient = "NeoModus Direct Connect"
   else
      sClient = "(N/A)"
   end
   if strfind(user.sMyInfoString,"M:P") then
      sMode = "Passive"
   elseif strfind(user.sMyInfoString,"M:A") then
      sMode = "Active"
   else
      sMode = "(N/A)"
   end
   if a == nil then a = "(N/A)"
   elseif b == nil then b = "(N/A)"
   elseif c == nil then c = "(N/A)"
   end
   if ver == nil then
      ver = "(N/A)"
   end
   if a == nil then a = "(N/A)" end
   if b == nil then b = "(N/A)" end
   if c == nil then c = "(N/A)" end
   return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
   return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
   tLogIp[user.sName] = user.sIP
end

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

lol forgot to add a %X  so i just see name and ip and version but your right the verions are all the same :-))
Title:
Post by: kepp on 03 March, 2004, 23:37:17
ok...

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." Hubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxSlots.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..getn(sOnlineOP).."\r\n"
t = t.."Online VIP's ? "..getn(sOnlineVIP).."\r\n"
t = t.."Online Reg's ? "..getn(sOnlineReg)
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] == nil then
tinsert(sOnlineVIP,user.sName)
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] == nil then
tinsert(sOnlineReg,user.sName)
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] then
for i=1,getn(sOnlineVIP) do
if sOnlineVIP[i] then
tremove(sOnlineVIP,i)
break
end
end
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] then
for i=1,getn(sOnlineReg) do
if sOnlineReg[i] then
tremove(sOnlineReg,i)
break
end
end
end
end
end

function OpConnected(user)
if sOnlineOP[user.sName] == nil then
tinsert(sOnlineOP,user.sName)
end
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
if sOnlineOP[user.sName] then
for i=1,getn(sOnlineOP) do
if sOnlineOP[i] then
tremove(sOnlineOP,i)
break
end
end
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
This shall solve the error atleast!

"Minimum share ? 0 <- still no go"

The script grabs the part from PtokaX, so don't blame me, Blame PtokaX :P

"You are in 13 ubs as a regged user =12 hubs"

my answer to that is : "WTF?? lol" Honestly, i have no idea, it's not possible

"Online OP's ? 1 = 4"

Again... As soon as you restartscripts all those 3 will be back to 0, so each op must reconnect and then it will show... (I Promisse)

the iplog.txt part will be fixed tomorow!!
until then, report bugs / errors
Title:
Post by: [NL]trucker on 04 March, 2004, 00:15:56
oke here we go :-))

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

info in main

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

[00:06:23]

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

Information about you :
Your IP      ?      217.121.195.6
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hubs as a normal user
You are in 15 Hubs as a regged user
You are in 16 Hubs as an OP user

Hub Settings :
Minimum share      ?   0
Minimum slots      ?   1
Maximum slots      ?   10
Maximum hubs      ?   10
Maximum users      ?   200

Hub Statistic :
Uptime         ?   0 Days 5 Hours and 45 Minutes
Amount of users now   ?   43
Total share amount      ?   1.26 TB
Online OP's      ?   1
Online VIP's      ?   0
Online Reg's      ?   0

?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?
[00:06:23] Welcome back pappa

howcome?

no error in scripteditor from pkotax sofar.

i will let it run overnight and see tomorrow if there is something changed.
Title:
Post by: kepp on 04 March, 2004, 00:20:10
i already see something weird :S

sMaxHubs = 8

Maximum hubs ? 10
Title:
Post by: kepp on 04 March, 2004, 00:21:46
-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." Hubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxHubs.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..getn(sOnlineOP).."\r\n"
t = t.."Online VIP's ? "..getn(sOnlineVIP).."\r\n"
t = t.."Online Reg's ? "..getn(sOnlineReg)
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] == nil then
tinsert(sOnlineVIP,user.sName)
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] == nil then
tinsert(sOnlineReg,user.sName)
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] then
for i=1,getn(sOnlineVIP) do
if sOnlineVIP[i] then
tremove(sOnlineVIP,i)
break
end
end
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] then
for i=1,getn(sOnlineReg) do
if sOnlineReg[i] then
tremove(sOnlineReg,i)
break
end
end
end
end
end

function OpConnected(user)
if sOnlineOP[user.sName] == nil then
tinsert(sOnlineOP,user.sName)
end
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
if sOnlineOP[user.sName] then
for i=1,getn(sOnlineOP) do
if sOnlineOP[i] then
tremove(sOnlineOP,i)
break
end
end
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: [NL]trucker on 04 March, 2004, 00:40:18
kepp first scripterror


Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
   1:  function `strfind' [C]
   2:  function `Client_Check' at line 120 [file `D:\==PTOTAX==\trucker\scripts\kep-info.lua']
   3:  function `NewUserConnected' at line 164 [file `D:\==PTOTAX==\trucker\scripts\kep-info.lua']
Title:
Post by: kepp on 04 March, 2004, 00:42:57
See if this solves it

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." Hubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxHubs.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..getn(sOnlineOP).."\r\n"
t = t.."Online VIP's ? "..getn(sOnlineVIP).."\r\n"
t = t.."Online Reg's ? "..getn(sOnlineReg)
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
if user.sMyInfoString == nil then
user:Disconnect()
end
local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
if strfind(user.sMyInfoString,"M:P") then
sMode = "Passive"
elseif strfind(user.sMyInfoString,"M:A") then
sMode = "Active"
else
sMode = "(N/A)"
end
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end
return a,b,c,sMode,ver,sClient
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] == nil then
tinsert(sOnlineVIP,user.sName)
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] == nil then
tinsert(sOnlineReg,user.sName)
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] then
for i=1,getn(sOnlineVIP) do
if sOnlineVIP[i] then
tremove(sOnlineVIP,i)
break
end
end
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] then
for i=1,getn(sOnlineReg) do
if sOnlineReg[i] then
tremove(sOnlineReg,i)
break
end
end
end
end
end

function OpConnected(user)
if sOnlineOP[user.sName] == nil then
tinsert(sOnlineOP,user.sName)
end
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
if sOnlineOP[user.sName] then
for i=1,getn(sOnlineOP) do
if sOnlineOP[i] then
tremove(sOnlineOP,i)
break
end
end
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: [NL]trucker on 04 March, 2004, 01:19:51
oke here is main again:

[01:05:36]

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

Information about you :
Your IP      ?      217.121.195.6
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hubs as a normal user
You are in 14 Hubs as a regged user
You are in 17 Hubs as an OP user

Hub Settings :
Minimum share      ?   5
Minimum slots      ?   2
Maximum slots      ?   20
Maximum hubs      ?   35
Maximum users      ?   200

Hub Statistic :
Uptime         ?   0 Days 6 Hours and 44 Minutes
Amount of users now   ?   34
Total share amount      ?   965.46 GB
Online OP's      ?   1
Online VIP's      ?   0
Online Reg's      ?   0

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

it is looking great dont you think?


and i did set the minshare in pkotax again.
so i think that is why the minshare wasnt working.

but i allready told you i disablled all those settings in pkotax because of robocop.so my gues was you were trying to get the info from the settings in robo.

hmm typical miscommunication oh well atleast it is working sofar.
did you see the info i posted upon optimus script?


aiii i spoke to soon (:-

Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
   1:  function `strfind' [C]
   2:  function `Client_Check' at line 121 [file `D:\==PTOTAX==\trucker\scripts\info-kepp.lua']
   3:  function `NewUserConnected' at line 165 [file `D:\==PTOTAX==\trucker\scripts\info-kepp.lua']


lol iplog :

03/04/04-01:08:35 | [NL]--Liekerdjuh | 83.117.85.10 | DC++ - 0.306
03/04/04-01:08:35 | [chello]guajiro | 62.179.20.40 | DC++ - 0.306
03/04/04-01:08:35 | TwenteEnschedeeeOleeOlee | 217.123.207.140 | DC++ - 0.306
Title:
Post by: [NL]trucker on 04 March, 2004, 01:23:31
kepp

i would like to invite you into my hub to take a look at my tag.

[01:20:43] <=[guard]=>

   ? User Name: pappa
   ? User Profile: Master
   ? User IP: xxx.xxx.xxx.x
   ? Client: DC++
   ? User iVersion: 0.191
   ? Descr: <++ V:0.261,M:A,H:0/13/18,S:3>
   ? Mode: Actief
   ? Conn: Cable
   ? E-Mail: None
   ? Tag Status: Ok
   ? Kicked: No kicks
   ? Warned: No warnings
   ? Away Mess: None
   ? Total Time: 0 months, 5 days, 3 hours, 16 minutes.
   ? Session Time: 12 min
   ? Share: 56.50 GB

   ? Hub(s) as Regular user: 0
   ? Hub(s) as Registerd user: 13
   ? Hub(s) as Operator: 18
   ? Open Slots: 3

   ? Upload limit: None

and tell me wich is wrong now?

script or userinfo from robo cause i dont know.
Title:
Post by: kepp on 04 March, 2004, 06:34:25
hmm, i don't know.. is there any diference between them?

all i kinow is that betas are weird and i still believ there is a bug when you load scripts
-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hubs as a normal user\r\n"
t = t.."You are in "..b.." Hubs as a regged user\r\n"
t = t.."You are in "..c.." Hubs as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxHubs.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online OP's ? "..getn(sOnlineOP).."\r\n"
t = t.."Online VIP's ? "..getn(sOnlineVIP).."\r\n"
t = t.."Online Reg's ? "..getn(sOnlineReg)
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 Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
if user.sMyInfoString ~= nil then
local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if ver == nil then
ver = "(N/A)"
end
if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end

if sMode == "A" then sMode = "Active"
elseif sMode == "P" then sMode = "Passive"
else sMode = "(N/A)"
end

if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
return a,b,c,sMode,ver,sClient
end
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] == nil then
tinsert(sOnlineVIP,user.sName)
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] == nil then
tinsert(sOnlineReg,user.sName)
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 0 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
if user.iProfile == 2 then
if sOnlineVIP[user.sName] then
for i=1,getn(sOnlineVIP) do
if sOnlineVIP[i] then
tremove(sOnlineVIP,i)
break
end
end
end
end
if user.iProfile == 3 then
if sOnlineReg[user.sName] then
for i=1,getn(sOnlineReg) do
if sOnlineReg[i] then
tremove(sOnlineReg,i)
break
end
end
end
end
end

function OpConnected(user)
if sOnlineOP[user.sName] == nil then
tinsert(sOnlineOP,user.sName)
end
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

function OpDisconnected(user)
if sOnlineOP[user.sName] then
for i=1,getn(sOnlineOP) do
if sOnlineOP[i] then
tremove(sOnlineOP,i)
break
end
end
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"w+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: [NL]trucker on 05 March, 2004, 18:36:53
Kepp

are ya still with me on this one?


if so Optimus helped me with this script perhaps we can implement it.

------------------------
--test by [NL]trucker.

BotName = "-Info-"

function NewUserConnected(user)
Message(user)
end

function OpConnected(user)
Message(user)
end

--// Profile Counter
function ProfileCounter(profile)
   local table, count = GetUsersByProfile(profile), 0
   for i, User in table do
      if GetItemByName(User) then
         count = count + 1
      end
   end
   return count
end
 
function Message(user)
   local disp = ""
   doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
   disp = disp.."  \r\n===========================================================\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Master").." [MASTER] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Operator").." [OPERATOR] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Vip").." [VIP] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Reg").." [Registerd users] online \r\n"
   disp = disp.." \r\n"
   disp = disp.." ?There are now: "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
   disp = disp.." ==================================================================="
   user:SendData(BotName, disp)
end



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

let me know what you think of it.
if you wanna see it work it is running now in my hub.
Title:
Post by: kepp on 05 March, 2004, 19:02:07
it does the same :S
Title:
Post by: [NL]trucker on 05 March, 2004, 21:53:12
Kepp

you,re correct it does the same but with one diffrence

you dont have to wait for the folks to login again before it shows the correct ammount.

i started it and it showed me directly the right amount of op,s vip,s and reg,s and masters connected.
Title:
Post by: kepp on 05 March, 2004, 22:48:32
ok, i'll take a look at it while im working at X-Ray for a bit..
I really want to understand what im doing before i go ahead and add it :)
Title:
Post by: [NL]trucker on 05 March, 2004, 22:52:42
okies np there kepp

just take your time

i was just trying to help make this script work..,
causse i really like it.
Title:
Post by: kepp on 06 March, 2004, 10:52:49

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxHubs.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online Masters ? "..CountProfiles("Master").."\r\n"
t = t.."Online Ops ? "..CountProfiles("Operator").."\r\n"
t = t.."Online VIPs ? "..CountProfiles("Vip").."\r\n"
t = t.."Online Regs             ? "..CountProfiles("Reg")
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 CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
for i,user in t do
if GetItemByName(user) then
c = c + 1
end
end
return c
end

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
if user.sMyInfoString ~= nil then
local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if ver == nil then
ver = "(N/A)"
end

if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end

if sMode == "A" then sMode = "Active"
elseif sMode == "P" then sMode = "Passive"
else sMode = "(N/A)"
end

if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
return a,b,c,sMode,ver,sClient
end
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 2 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
end

function OpConnected(user)
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"a+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end

ihope this is OK?
i don't know about the iplog yet... seems to work better.. :)
Title:
Post by: Tarot on 06 March, 2004, 11:13:38
i have test it it work oke
it is a great Welcome message
Title:
Post by: [NL]trucker on 06 March, 2004, 11:25:02
Kepp

it is working fine just one little thing isnt right yet.

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

Information about you :
Your IP      ?      xxx.xxx.xxx
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hub(s) as a normal user
You are in 15 Hub(s) as a regged user
You are in 16 Hub(s) as an OP user

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

info on user
--------------
[11:22:08] <=[guard]=>

   ? User Name: pappa
   ? User Profile: Master
   ? User IP: xxx.xxx.xxx.xxx.
   ? Client: DC++
   ? User iVersion: 0.191
   ? Descr: <++ V:0.261,M:A,H:0/14/17,S:3>
   ? Mode: Actief
   ? Conn: Cable
   ? E-Mail: trucker01@home.nl
   ? Tag Status: Ok
   ? Kicked: No kicks
   ? Warned: No warnings
   ? Away Mess: None
   ? Total Time: 0 months, 7 days, 11 hours, 53 minutes.
   ? Session Time: 4 min
   ? Share: 56.50 GB

   ? Hub(s) as Regular user: 0
   ? Hub(s) as Registerd user: 14
   ? Hub(s) as Operator: 17
   ? Open Slots: 3

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

hubcount is not correct yet.

online OP,s and Vips en reg users is working fine now :-))

wel done and thnx
Title:
Post by: kepp on 06 March, 2004, 11:35:46
hubcount is not que?
:S

What's wrong with it? ;)
Title:
Post by: [NL]trucker on 06 March, 2004, 14:21:57
kepp

sorry m8 look at this: this comes from info from robocop.

 Hub(s) as Regular user: 0
? Hub(s) as Registerd user: 14
? Hub(s) as Operator: 17
? Open Slots: 3

and now look at the info from the bot:

Information about you :
Your IP ? xxx.xxx.xxx
Your Client ? DC++
Version ? 0.261
Mode ? Active
Your share ? 56.50

You are in 0 Hub(s) as a normal user
You are in 15 Hub(s) as a regged user
You are in 16 Hub(s) as an OP user


there is a difrence between where i am regged and where i am an OP between those two.


that was what i ment with wong hubcount.
Title:
Post by: kepp on 06 March, 2004, 15:25:51
Ok... i can't fix that!
because there is nothing wrong with it..
Title:
Post by: kepp on 06 March, 2004, 17:53:37
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")

a is the first number(s) after H: in your decscription tag,
then b is H:Number/number2           and c is     /number3

so, that is, for instance H:0/1/1

and as you can see

You are in "..a.." Hub(s) as a normal user\r\n
You are in "..b.." Hub(s) as a normal user\r\n
You are in "..c.." Hub(s) as a normal user\r\n

That will print the numbers from your tag.

0 1 1
Title:
Post by: [NL]trucker on 07 March, 2004, 12:55:55
kepp

the problem is most likley that in your own hub you are counted as a regged user that is why there is a diffrence between client and bot.

i got this knowledge from someone alse :-))
Title:
Post by: [NL]trucker on 07 March, 2004, 12:57:30
Kepp

no other errors sofar script is working fine now thanks alot for your time and effort.
Title:
Post by: kepp on 07 March, 2004, 21:33:50
Np, tell me if you wish anything else :P
Title:
Post by: [NL]trucker on 09 March, 2004, 09:47:12
kepp

i get this error after a nght testdrive (:-

Syntax error: attempt to perform arithmetic on local `share' (a nil value)
stack traceback:
   1:  function `Arithmetic' at line 117 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   2:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `NewUserConnected' at line 190 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

i added 4 lines to the scrpt in the welcome part there just names of ops and vips
Title:
Post by: kepp on 09 March, 2004, 13:35:46
ok, since it was ok for a long time i can only think of this

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeOp = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

tWelcomeVip = {
["kepp"]="Welcome message here.",
["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sBeforeLog = 0
sTimers = 0


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

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
t = t.."Your IP ? "..user.sIP.."\r\n"
t = t.."Your Client ? "..sClient.."\r\n"
t = t.."Version ? "..ver.."\r\n"
t = t.."Mode ? "..sMode.."\r\n"
t = t.."Your share ? "..share.."\r\n"
t = t.."\r\n"
t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
t = t.."\r\n"
t = t.."Hub Settings :\r\n"
t = t.."Minimum share ? "..sMinShare.."\r\n"
t = t.."Minimum slots ? "..sMinSlots.."\r\n"
t = t.."Maximum slots ? "..sMaxSlots.."\r\n"
t = t.."Maximum hubs ? "..sMaxHubs.."\r\n"
t = t.."Maximum users ? "..frmHub:GetMaxUsers().."\r\n"
t = t.."\r\n"
t = t.."Hub Statistic :\r\n"
t = t.."Uptime ? "..sUpTime.."\r\n"
t = t.."Amount of users now ? "..frmHub:GetUsersCount().."\r\n"
t = t.."Total share amount ? "..sCurShare.."\r\n"
t = t.."Online Masters ? "..CountProfiles("Master").."\r\n"
t = t.."Online Ops ? "..CountProfiles("Operator").."\r\n"
t = t.."Online VIPs ? "..CountProfiles("Vip").."\r\n"
t = t.."Online Regs             ? "..CountProfiles("Reg")
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 CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
for i,user in t do
if GetItemByName(user) then
c = c + 1
end
end
return c
end

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = tonumber(share)
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
if user.sMyInfoString ~= nil then
local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
if ver == nil then
ver = "(N/A)"
end

if a == nil then a = "(N/A)" end
if b == nil then b = "(N/A)" end
if c == nil then c = "(N/A)" end

if sMode == "A" then sMode = "Active"
elseif sMode == "P" then sMode = "Passive"
else sMode = "(N/A)"
end

if strfind(user.sMyInfoString,"<++") then
sClient = "DC++"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "Opera DC"
elseif strfind(user.sMyInfoString," sClient = "DC-GUI"
elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
sClient = "DC-GUI"
elseif strfind(user.sMyInfoString," sClient = "DC:PRO"
elseif strfind(user.sMyInfoString,"<.P>") then
sClient = "Phantom DC"
elseif strfind(user.sMyInfoString," sClient = "NeoModus Direct Connect"
else
sClient = "(N/A)"
end
return a,b,c,sMode,ver,sClient
end
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
if tClone[user.sIP] then
user:SendData(sBot,"You are a clone of "..user.sIP..".")
Write_Clone(user)
user:Disconnect()
else
tClone[user.sIP] = user.sName
end
end
Send_Info(user)
if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
SendToAll(sBot,tWelcomeVip[user.sName])
elseif user.iProfile == -1 then
sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
user:SendData(sBot,sUsrmsg)
end
if sBeforeLog == 2 then
SAVE_IPS(user,sClient,ver)
sBeforeLog = 0
else
sBeforeLog = sBeforeLog + 1
end
end

function UserDisconnected(user)
tLogIp[user.sName] = nil;
if user.sName == tClone[user.sIP] then
tClone[user.sIP] = nil;
end
end

function OpConnected(user)
Send_Info(user)
if user.iProfile == 0 and sMaster == 1 and tWelcomeMaster[user.sName] then
SendToAll(sBot,tWelcomeMaster[user.sName])
elseif user.iProfile == 1 and sOp == 1 and tWelcomeOp[user.sName] then
SendToAll(sBot,tWelcomeOp[user.sName])
elseif sHubOwner == 1 and tWelcomeHubOwner[user.sName] then
SendToAll(sBot,tWelcomeHubOwner[user.sName])
end
end

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

end

function SAVE_IPS(user,sClient,ver)
local file = openfile(fLogg,"a+")
for i,v in tLogIp do
write(file,date("%x").." | "..i.." | "..v.." | "..sClient.." - "..ver.."\n")
end
closefile(file)
end

function SendHubAdd()
local t = ""
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?\r\n\r\n"
t = t.."Hub Name ? "..frmHub:GetHubName().."\r\n"
t = t.."Network ? "..sNetwork.."\r\n"
t = t.."Website ? "..sWebSite.."\r\n"
t = t.."\r\n"
t = t.."?-=-=-=-=-=-=-=-? H U B A D D Y ?-=-=-=-=-=-=-=-?"
T = t
SendToAll(sBot,T)
end

function OnTimer()
if sTriggerEight == 0 and sTimers == 0 then
SendHubAdd()
elseif sTriggerEight == 1 and sTimers == 0 then
sTimers = 1
elseif sTriggerEight == 1 and sTimers == 1 then
SendHubAdd()
sTimers = 0
end
end
Title:
Post by: [NL]trucker on 09 March, 2004, 15:32:29
Kepp

thnx

can you tell me what you have changed?
Title:
Post by: kepp on 09 March, 2004, 15:43:34
share = tonumber(share)
Title:
Post by: [NL]trucker on 16 March, 2004, 09:53:39
Kepp

i get this error

Syntax error: attempt to perform arithmetic on local `share' (a nil value)
stack traceback:
   1:  function `Arithmetic' at line 118 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   2:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `NewUserConnected' at line 191 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

so dont know what is wrong with it
could you please help?

first line = 65
last line = 197
-----------------------------------------------------------------


function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(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.."Information about you :\r\n"
   t = t.."Your IP      ?      "..user.sIP.."\r\n"
   t = t.."Your Client   ?      "..sClient.."\r\n"
   t = t.."Version      ?      "..ver.."\r\n"
   t = t.."Mode      ?      "..sMode.."\r\n"
   t = t.."Your share   ?      "..share.."\r\n"
   t = t.."\r\n"
   t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
   t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
   t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
   t = t.."\r\n"
   t = t.."Hub Settings :\r\n"
   t = t.."Minimum share      ?   "..sMinShare.."\r\n"
   t = t.."Minimum slots      ?   "..sMinSlots.."\r\n"
   t = t.."Maximum slots      ?   "..sMaxSlots.."\r\n"
   t = t.."Maximum hubs      ?   "..sMaxHubs.."\r\n"
   t = t.."Maximum users      ?   "..frmHub:GetMaxUsers().."\r\n"
   t = t.."\r\n"
   t = t.."Hub Statistic :\r\n"
   t = t.."Uptime         ?   "..sUpTime.."\r\n"
   t = t.."Amount of users now   ?   "..frmHub:GetUsersCount().."\r\n"
   t = t.."Total share amount      ?   "..sCurShare.."\r\n"
   t = t.."Online Masters      ?   "..CountProfiles("Master").."\r\n"
   t = t.."Online Ops      ?   "..CountProfiles("Operator").."\r\n"
   t = t.."Online VIPs      ?   "..CountProfiles("Vip").."\r\n"
   t = t.."Online Regs                ?   "..CountProfiles("Reg")
   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 CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
   for i,user in t do
      if GetItemByName(user) then
      c = c + 1
      end
   end
   return c
end

function Arithmetic(user)
   local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
   share = tonumber(share)
   share = format("%0.2f",(share / 1024 / 1024 / 1024))

   sMinShare = frmHub:GetMinShare() / 1024
   sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
   if strlen(sCurShare) <= 6 then
      sCurShare = sCurShare.." GB"
   else
      sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
   end
   return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
   if user.sMyInfoString ~= nil then
      local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
      local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
      if ver == nil then
         ver = "(N/A)"
      end

      if a == nil then a = "(N/A)" end
      if b == nil then b = "(N/A)" end
      if c == nil then c = "(N/A)" end

      if sMode == "A" then sMode = "Active"
      elseif sMode == "P" then sMode = "Passive"
      else sMode = "(N/A)"
      end

      if strfind(user.sMyInfoString,"<++") then
         sClient = "DC++"
      elseif strfind(user.sMyInfoString,"         sClient = "Opera DC"
      elseif strfind(user.sMyInfoString,"         sClient = "Opera DC"
      elseif strfind(user.sMyInfoString,"         sClient = "DC-GUI"
      elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
         sClient = "DC-GUI"
      elseif strfind(user.sMyInfoString,"         sClient = "DC:PRO"
      elseif strfind(user.sMyInfoString,"<.P>") then
         sClient = "Phantom DC"
      elseif strfind(user.sMyInfoString,"         sClient = "NeoModus Direct Connect"
      else
         sClient = "(N/A)"
      end
      return a,b,c,sMode,ver,sClient
   end
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
   return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
   tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
   if tClone[user.sIP] then
      user:SendData(sBot,"You are a clone of "..user.sIP..".")
      Write_Clone(user)
      user:Disconnect()
   else
      tClone[user.sIP] = user.sName
   end
end
Send_Info(user)
   if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
      SendToAll(sBot,tWelcomeVip[user.sName])
   elseif user.iProfile == -1 then
      sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
      sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
      user:SendData(sBot,sUsrmsg)
------------------------------------------------------------------------
Title:
Post by: Skrollster on 16 March, 2004, 10:02:05
change:

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = tonumber(share)
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

to

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
share = tonumber(share)
if not share then
error("Couldn't get the user: "..user.sName.."'s share, myinfo string is: "..user.sMyInfoString)
end
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

now you will know why it gets like this, and then you can post the error message here and someone will know what to do..
Title:
Post by: [NL]trucker on 16 March, 2004, 14:51:58
thnks skrollster

if i get any error i will post it here.
Title:
Post by: [NL]trucker on 17 March, 2004, 00:29:30
skrollster

i think your solution worked.

here is the error i get

yntax error: Couldn't get the user: Whipper's share, myinfo string is: $MyINFO $ALL Whipper $ $LAN(T3)$$174568945745.92$|
stack traceback:
   1:  function `error' [C]
   2:  function `Arithmetic' at line 119 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   4:  function `NewUserConnected' at line 195 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

Syntax error: Couldn't get the user: Whipper's share, myinfo string is: $MyINFO $ALL Whipper $ $LAN(T3)$$174568945745.92$|
stack traceback:
   1:  function `error' [C]
   2:  function `Arithmetic' at line 119 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   4:  function `NewUserConnected' at line 195 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']


as far as i can see this user has a rotten Myinfo

is there something we can do about this?
Title:
Post by: Skrollster on 17 March, 2004, 00:49:09
there is 2 ways as i see it, either we let the users have a decimal share, this isn't possible in reality:

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+%.?%d*)%$")-- this should capure shares with a dot in the number...
share = tonumber(share)
if not share then
error("Couldn't get the user: "..user.sName.."'s share, myinfo string is: "..user.sMyInfoString)
end
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end

or we can consider the share to be 0, though the user probably fakes any how...

function Arithmetic(user)
local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+%.?%d*)%$")-- this should capure shares with a dot in the number...
share = tonumber(share)
if not share then
share = 0
end
share = format("%0.2f",(share / 1024 / 1024 / 1024))

sMinShare = frmHub:GetMinShare() / 1024
sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
if strlen(sCurShare) <= 6 then
sCurShare = sCurShare.." GB"
else
sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
end
return share,sMinShare,sCurShare
end
Title:
Post by: [NL]trucker on 17 March, 2004, 12:01:19
thnx skrollster

i,m gonna give the last option a try as this isnt a sharecheck bot but a welcominfo bot.

will let you know if this works.
Title:
Post by: kepp on 17 March, 2004, 12:11:19
Thanks Skrollster!!

I've never seen a InfoString like that :S

Later