welcome info not working
 

News:

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

Main Menu

welcome info not working

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


lynyrd

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

[NL]trucker

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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]Pur

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.

[NL]trucker

oke thnx pur

then i hope that someone would look into this to translate it to lua script :-)))  hint hint
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Stravides

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
Stravides
For RPG Books, Mp3 & Videos
We host trivia  and the ever failing Smeagolbot

nErBoS

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
--## nErBoS Spot ##--

kepp

yea, it's VB, i'll see what i can do.
Guarding    

[NL]trucker

Kepp

thnx i will wait and see what you can come up with .
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

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

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

#11
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
Guarding    

[NL]trucker

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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

#13
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"
Guarding    

kepp

#14
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
Guarding    

[NL]trucker

#15
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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

And you get any syntax error?
Guarding    

[NL]trucker

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']
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

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..?
Guarding    

[NL]trucker

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 :-)))
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

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']
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

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']
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

--# 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!
Guarding    

kepp

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

SMF spam blocked by CleanTalk