| View previous topic :: View next topic |
| Author |
Message |
Kaio Voice
Joined: 20 Feb 2009 Posts: 3
|
Posted: Fri Feb 20, 2009 3:59 pm Post subject: Problem with "timer loop" or topic arg |
|
|
Teh script: http://pastebin.com/m2d5a0a1c
I get this error if i call the script with ?topic_status
#
error: Tcl error [topic_status]: wrong # args: should be "topic_status topic"
I have no idea how to pass the argument or a other method to get the topic title |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Feb 20, 2009 4:35 pm Post subject: |
|
|
Make sure the argument-list in the proc header matches the parameters passed when the binding triggers (see doc/tcl-commands.doc).
Also, you'll have to modify your utimer-command to pass the very same number of parameters if you intend to use that recursive calling. This would also have to be done in a safe manner, so I'd recommend using lists there.
IE:
| Code: | | utimer 30 [list command param1 param2 param3] |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Kaio Voice
Joined: 20 Feb 2009 Posts: 3
|
Posted: Fri Feb 20, 2009 6:54 pm Post subject: |
|
|
i noticed...it issnt the timer who does the error... but i cant find out ...
(sorry for the bad english ;P) |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Feb 20, 2009 7:27 pm Post subject: |
|
|
'k, let me point you in the right direction then:
| doc/tcl-commands.doc wrote: | (4) PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>
Description: used for commands given on a channel. The first word
becomes the command and everything else is the text argument.
Module: irc
|
This means, that when the binding triggers, <proc> will be called with 5 parameters (being nick user@host handle channel and text). Your proc must be able to accept these parameters as arguments...
In your case, your proc has only 1 argument, which you've called topic. Obviously, that's 4 arguments short of what bind expects, and more important, it's not the order bind expects..
Hence, bind calls the proc with the wrong number and order of arguments, and you get the error posted.
Solution?
Adjust your proc to accept the proper amount of parameters:
| Code: | | proc yourproc {nickname host handle channel text} { |
Then adjust your proc to make use of these arguments appropriately. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Kaio Voice
Joined: 20 Feb 2009 Posts: 3
|
Posted: Fri Feb 20, 2009 7:45 pm Post subject: |
|
|
| It works! Thank you very much ^^ |
|
| Back to top |
|
 |
|