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
-
Sedulus
- Forum Moderator
- Posts: 687
- Joined: 2003-01-04 09:32
-
Contact:
Post
by Sedulus » 2003-10-04 17:12
ah, teh nice, but you forgot the | ; for the raw commands..
This command MUST end with a | ;, if not it SHOULD be discarded.
-
TasMan
- Posts: 196
- Joined: 2003-01-03 08:31
- Location: Canada
-
Contact:
Post
by TasMan » 2003-10-04 17:23
Question Sedulus : Assuming the hub has EXTENDEDPROTOCOL / Supports support, the UserCommand should be one of the params in Supports correct?
-
HaArD
- Posts: 147
- Joined: 2003-01-04 02:20
- Location: Canada http://hub-link.sf.net
-
Contact:
Post
by HaArD » 2003-10-04 23:16
Edited.. to fix handling of RAW commands...
Code: Select all
' $UserCommandBot by HaArD
' Version 1.1
' October 3, 2003
' This Script implements support in NMDC Hub for the $UserCommand Extension
' for details on this please visit the DC++ wiki pages
' http://dcplusplus.sourceforge.net/wiki/index.php/UserCommand%20command
'
' Syntax
' <number> <command>|
'
' <number> is a positive integer describing the kind of command, where:
' 0 = separator
' 1 = raw
' 2 = mainchat
' 3 = private message
' <command> is the command to be sent
Dim sUserCommands(2), sOpCommands(4)
sUserCommands(0) = "0 This text isn't used yet"
sUserCommands(1) = "1 Get IP#$$UserIP %[mynick]|"
sUserCommands(2) = "2 Read Rules$+rules"
sOpCommands(0) = "0 More unused text"
sOpCommands(1) = "3 Reg. User$RegBot$<%[mynick]> +register %[line:Nick?] %[line:Password?]"
sOpCommands(2) = "3 Op. User$RegBot$<%[mynick]> +op %[nick] %[line:Reason?]"
sOpCommands(3) = "3 DeOp. User$RegBot$<%[mynick]> +deop %[nick] %[line:Reason?]"
sOpCommands(4) = "1 Get User IP#$$UserIP %[nick]|"
Sub NewUserConnected(CurUser)
For i = 0 To UBound(sUserCommands)
CurUser.SendData "$UserCommand " & sUserCommands(i) & "|"
Next
End Sub
Sub OpConnected(CurUser)
Call NewUserConnected(CurUser)
For i = 0 To UBound(sOpCommands)
CurUser.SendData "$UserCommand " & sOpCommands(i) & "|"
Next
End Sub
In the User RAW command and the Op RAW Command (They start with "1 ...") there are two escape sequences "& #36;" and "& #124;" The space between & # should be removed when you run the script. I can't remove it here or the forum will replace it with a $ and | respectively
Thanks to Sedulus for the help with the escape sequences.
HaArD
escaped the $ and | by using &
so you won't have to remove any spaces between & and #
/Sedulus