Code: Select all
bind evnt - init-server login_to_chanserv
proc login_to_chanserv {args} {
putserv "PRIVMSG chanserv :logincommand with pass and username goes here"
}
First off, sure the parameters are trashed, but why use ARGS? To confuse people? Your using it for no reason and it's a special variable..ughPapillon wrote:It's been a long time since I did anything on irc, but don't you need to "log in" to chanserv to make it recognise it is you? If that is the case just do something likeput it at the end of your config-file or make a tcl-file and load it from the config-fileCode: Select all
bind evnt - init-server login_to_chanserv proc login_to_chanserv {args} { putserv "PRIVMSG chanserv :logincommand with pass and username goes here" }
In his defense, he doesn't actually use it, it is probably for his convenience since he may or may not remember the actual arguments an init-server bound procedure is called with. As to your second point, yes it is a special variable, and yes, it does exist. If it were to never be used, it wouldn't exist at all, so don't take such offence to it and it being used. oy vay.speechles wrote: First off, sure the parameters are trashed, but why use ARGS? To confuse people? Your using it for no reason and it's a special variable..ugh
wow, you really do forget things quickly. Look here:Papillon wrote:don't be afraid speechless, the args will not bite you. no need to be terrified of it.
In place of shouting at people using it (which I did not do) you could try to explain what is so special about it (can't say I have seen you do it yet)
My bad about chanserv.. my irc-experience is years old and much mixed up. I do not even have access to an eggdrop
Code: Select all
proc argue { args } {
set first [lindex [split [lindex $args 0]] 0]
set second [lindex [split [lindex $args 0]] 1]
set third [lrange [split [lindex $args 0]] 2 end]
Code: Select all
proc argue { args } {
set first [lindex $args 0]
set second [lindex $args 1]
set third [lrange $args 2 end]
Code: Select all
proc argue { args } {
set args [split $args]
set first [lindex $args 0]
set second [lindex $args 1]
set third [lrange $args 2 end]
I think you don't understand args like you think you do. This 2nd "argue" proc is actually the more correct method. $args is already in list format.speechles wrote: And so you know I know what Im talking about.
Say we have a bind of whatever to proc ARGUE { args }
parameters passed to $args : $nick $hand $textresut: first = $nick, second = $hand, third = $textCode: Select all
proc argue { args } { set first [lindex [split [lindex $args 0]] 0] set second [lindex [split [lindex $args 0]] 1] set third [lrange [split [lindex $args 0]] 2 end]
Correct use of $args, this guy r0x!
result: first = {$nick $hand $text} (yes, including curly braces), second = tcl error beyond list length or {} emptiness who knows, third = never executes or behaves as 2 did.Code: Select all
proc argue { args } { set first [lindex $args 0] set second [lindex $args 1] set third [lrange $args 2 end]
Boo! This guy sux!
Is this enough?![]()
Code: Select all
proc mypub {args} {
set nick [lindex $args 0]
set uhost [lindex $args 1]
set hand [lindex $args 2]
set chan [lindex $args 3]
set text [lindex $args 4]
putlog "$nick - $uhost - $hand - $chan - $text"
}
bind pub - !hi mypub
<[sL]> !hi moo moo da moo
<bot> [sL] - sl@strikelight.com - sL - #chan - moo moo da moo
His reason to use it was to supress defining variables in the declaration of the procedure that he will never use to begin with. Thus the need. I think you might be more upset at the fact that you yourself don't understand the practicality and usage of args.speechles wrote: The simple rule: If there is no need to use $args, then simply don't use it, otherwise your causing confusion...
Upset? Come again? The one getting upset is you. Words here are on a screen, given no audible sounds. I can't scream at you, that voice is in your head. Perhaps you both just need some psychiatry and the world will not be so loud.strikelight wrote:his reason to use it was to supress defining variables in the declaration of the procedure that he will never use to begin with. Thus the need. I think you might be more upset at the fact that you yourself don't understand the practicality and usage of args.
If I am unable to detect your emotion, then how are you able to detect mine? You can't talk out both sides of your mouth and not be called on it ;x In any event, I just wanted to point out that "args" exists to be used, so no need to denounce those who use it, as long as they use it properly.speechles wrote: Upset? Come again? The one getting upset is you. Words here are on a screen, given no audible sounds. I can't scream at you, that voice is in your head. Perhaps you both just need some psychiatry and the world will not be so loud.
Age begets wisdom and insight...strikelight wrote: If I am unable to detect your emotion, then how are you able to detect mine?
What you mean is, both sides of your body. Mouth talks, other side talks, well.. talks.. you know.. 5H17 (forgive my swearing)strikelight wrote:You can't talk out both sides of your mouth and not be called on it ;x
/me points over there somewhere.strikelight wrote:In any event, I just wanted to point out that "args" exists to be used, so no need to denounce those who use it, as long as they use it properly.
I don't want to compare age, as my age has made me wise enough to never date myself, although in saying that, I probably have let on too much as is ;xspeechles wrote:Age begets wisdom and insight...strikelight wrote: If I am unable to detect your emotion, then how are you able to detect mine?
I meant mouth, two separate idioms.speechles wrote:What you mean is, both sides of your body. Mouth talks, other side talks, well.. talks.. you know.. 5H17 (forgive my swearing)strikelight wrote:You can't talk out both sides of your mouth and not be called on it ;x
..pff.. you clearly do NOT know what you are talking about.And so you know I know what Im talking about.
Say we have a bind of whatever to proc ARGUE { args }
parameters passed to $args : $nick $hand $text
Code:
proc argue { args } {
set first [lindex [split [lindex $args 0]] 0]
set second [lindex [split [lindex $args 0]] 1]
set third [lrange [split [lindex $args 0]] 2 end]
resut: first = $nick, second = $hand, third = $text
Correct use of $args, this guy r0x!
Code:
proc argue { args } {
set first [lindex $args 0]
set second [lindex $args 1]
set third [lrange $args 2 end]
result: first = {$nick $hand $text} (yes, including curly braces), second = tcl error beyond list length or {} emptiness who knows, third = never executes or behaves as 2 did.
Boo! This guy sux!
Is this enough? Rolling Eyes
Code: Select all
% set nick Papillon; set hand Whatever; set text "Let's write it with some \[special chars in for fun\]"
% proc testing {args} { puts "nick: [lindex $args 0] -- hand:[lindex $args 1] -- text: [lindex $args 2]" }
% testing $nick $hand $text
nick: Papillon -- hand: Whatever -- text: Let's write it with some [special chars in for fun]
or even..
% testing $hand $text $nick
nick: Whatever -- hand: Let's write it with some [special chars in for fun] -- text: Papillon
Code: Select all
% set text [list first last]; set nick Papillon
% proc x {args} { puts "[lindex [lindex $args 0] 1] and [lindex [lindex $args 0] 0], right [lindex $args 1]?" }
% x $text $nick
last and first right Papillon?
Code: Select all
set r [argue "$nick $hand $text"]
Code: Select all
set r [argue $nick $hand $text]
tclsh...get real guy.. Realize not everybody wants to install a full unix environment just to run a simple eggdrop on windows, and take that chip off your shoulder jeez..Papillon wrote:..pff.. you clearly do NOT know what you are talking about.
It is the 2. example that is correct, the one you so clearly define as wrong. Do some testing in tclsh next time before you pass judgment on others.