$UserCommand extension support for NMDC Hubs

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
HaArD
Posts: 147
Joined: 2003-01-04 02:20
Location: Canada http://hub-link.sf.net
Contact:

$UserCommand extension support for NMDC Hubs

Post by HaArD » 2003-10-04 12:28

Sedulus wrote:DCH++ (not available to the public)
+
http://wza.digitalbrains.com/DC/dchpp/l ... mmands.lua (a snippet of luascript, easily converted to ptokax)
+
http://dcplusplus.sourceforge.net/wiki/ ... %20command (a protocol extension)
+
http://utrum.dyndns.org:8000/ (BCDC++)
http://dcpro.sourceforge.net DC:Pro has implemented support for this extension too.

I have written a shell script for supporting $UserCommand on NMDC Hubs.

[code removed, see fixed code below /Sedulus]

HaArD

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 &#124 ; for the raw commands..
This command MUST end with a &#124 ;, if not it SHOULD be discarded.
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

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?
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....

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#$&#36;UserIP %[mynick]&#124;" 
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#$&#36;UserIP %[nick]&#124;"

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 &#36; and &#124; by using &
so you won't have to remove any spaces between & and #
/Sedulus

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-10-09 21:11

newest dc++ will support $UserCommand's, but with a slightly different syntax..
details: http://dcplusplus.sourceforge.net/wiki/ ... %20command

so the above script will have to be modified
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Locked