This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
-
NewzUK
- Master
- Posts: 200
- Joined: Mon Nov 18, 2002 3:10 am
- Location: Auckland, New Zealand
-
Contact:
Post
by NewzUK »
Hi
I have this little script which auth's to X chan services bot when I msg it to do so, but I'd like it to do it itself when it connects...
bind msg m|m auth auth
proc auth {nick host hand args} {
putserv "NOTICE $nick : I have authed to X"
putserv "PRIVMSG X :authop #NewsRoom BotNick password"
return 0
}
putlog "Auth loaded"
can this be done with this script?
Thanks.
-
Sir_Fz
- Revered One
- Posts: 3794
- Joined: Sun Apr 27, 2003 3:10 pm
- Location: Lebanon
-
Contact:
Post
by Sir_Fz »
Why don't you try it before you ask ?
also I suggest replacing args with arg (in the proc), because args has a special meaning in TCL (I don't know what it is :p)
-
egghead
- Master
- Posts: 481
- Joined: Mon Oct 29, 2001 8:00 pm
-
Contact:
Post
by egghead »
Sir_Fz wrote:[snip]
also I suggest replacing args with arg (in the proc), because args has a special meaning in TCL (I don't know what it is :p)
If the number of arguments when calling a procedure is variable, one can use the keywords "args". This will be a list with thearguments:
Code: Select all
proc variableargument { args } {
puts "CALL with [llength $args] arguments"
set argcount 0
foreach argument $args {
incr argcount
puts "ARG $argcount: $argument"
}
}
# call proc with 0 arguments
variableargument
# call proc with 1 argument
variableargument hello
# call proc with 2 arguments
variableargument hello world
results in
CALL with 0 arguments
CALL with 1 arguments
ARG 1: hello
CALL with 2 arguments
ARG 1: hello
ARG 2: world
Last edited by
egghead on Fri Aug 22, 2003 11:09 am, edited 1 time in total.
-
Sir_Fz
- Revered One
- Posts: 3794
- Joined: Sun Apr 27, 2003 3:10 pm
- Location: Lebanon
-
Contact:
Post
by Sir_Fz »
ok thanx again User
much appreciated.