Hub Script Pascal

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Locked
plainwlkr8
Posts: 4
Joined: 2003-09-30 21:44
Contact:

Hub Script Pascal

Post by plainwlkr8 » 2003-10-03 12:33

I've been looking for scripts for my deep black hub. i found a script in the hubs and script section and when i load the script into the hub, i get an error. (1,1) I dont know anything about pascal. In general it is fairly difficult to find information about the hubs i am researching. it tells you the fuctions you can implement but it doesnt show you how to use them or simple walk thrus to start you out. I have no clue if deep black even uses pascal for scripts. i am familar with basic, cobol and i am in a class for c++. i dont have time to learn pascal to get one script working for my hub so it would be greatly appreciated if someone could debug the program.

(Pascal Error) ipbot.pscript(1,1):syntax error

how is the first line different than all the other ones? it has a ` which is a delete statement. i even took out the first line with the blank and started it with just the `=== and it still didnt work, it just changed from error (1,2) to erro (1,1). thank you in advance whoever might work on this.

'=====================================
' Direct Connect Hub IP Filter script
'-------------------------------------
' version: 1.0 (010629)
' author: [FF]yopo
' email: [email protected]
'=====================================
' This script will check users when
' connecting to the hub, and if the
' IP number is not in the oAllow list
' it will disconnect the client. You
' can also configure it to allow full
' A-, B- or C-subnets (see the
' examples below). It will also send
' a message to the user. The script
' is useful if you want to keep the
' hub open only for connection from a
' specific ISP, network or region.
'=====================================

Dim sBotName
Dim oAllow
Dim sRejectMessage

Sub Main()
Set oAllow = CreateObject("Scripting.Dictionary")

'Set these basic parameters
sBotName = "IPBotNZ" ' <- name of the bot

'The message to send to denied clients
sRejectMessage = "Sorry, no connections are allowed to those outside of New Zealand."

'Add new entries for each ip number or subnet you want to allow.
'Here are some examples of the syntax; the "descriptions" can be
'anything, except for an empty string. Remove the examples when
'you add your own.

oAllow("132.181.*") = "Uni"
oAllow("192.168.*") = "Home"

End Sub


Sub NewUserConnected(curUser)

Dim sIPfull
Dim sIPc, sIPb, sIPa

sIPfull = curUser.IP()
sIPc = Left(sIPfull, InStrRev(sIPfull, ".") - 1)
sIPb = Left(sIPc, InStrRev(sIPc, ".") - 1)
sIPa = Left(sIPb, InStrRev(sIPb, ".") - 1)
sIPa = sIPa & ".*"
sIPb = sIPb & ".*"
sIPc = sIPc & ".*"

If Not (curUser.bOperator Or oAllow.Exists(sIPfull) Or _
oAllow.Exists(sIPc) Or oAllow.Exists(sIPb) Or _
oAllow.Exists(sIPa)) Then
curUser.PrivateMessage CStr(sBotName), CStr(sRejectMessage)
frmHub.DoEventsForMe
curUser.Disconnect
End If

End Sub

Lightning Man
Posts: 53
Joined: 2003-08-09 10:00
Location: Wilmington, NC
Contact:

Post by Lightning Man » 2003-10-03 14:59

That looks like a VB script to me.

HaArD
Posts: 147
Joined: 2003-01-04 02:20
Location: Canada http://hub-link.sf.net
Contact:

Post by HaArD » 2003-10-03 16:21

Deep Black does use Pascal for scripting and Lightning Man is right, that ain't it, that's vbscript.

Try going here there are several sbHub users/scripters there, including SBSoftEA, and you'll probably get a solution.

HaArD

plainwlkr8
Posts: 4
Joined: 2003-09-30 21:44
Contact:

Post by plainwlkr8 » 2003-10-03 17:00

thats the website where i got the hub im currently using. thx for the help =)

Locked